Commit 264a13a9 authored by Ron Rahaman's avatar Ron Rahaman

Added circle/cylinder cases w/ BCs defined as Functions

parent 93025185
......@@ -19,10 +19,19 @@
[../]
[]
[ICs]
[./T_IC]
type = FunctionIC
variable = T
# function = 'exp(-3.14159*(x*x+y*y))'
function = '0.0'
[../]
[]
[Kernels]
[./HeatSource]
type = HeatSource
function = '100*cos(3.14159*x)*cos(3.14159*y)'
function = '1.0'
variable = T
[../]
[./HeatDiff]
......@@ -35,12 +44,19 @@
[../]
[]
[Functions]
# BCFunction just returns 0.0 right now
[./bc_func]
type = BCFunction
[../]
[]
[BCs]
[./wall]
type = DirichletBC
type = FunctionDirichletBC
variable = T
boundary = 'wall'
value = 0
function = bc_func
[../]
[]
......@@ -48,39 +64,40 @@
[./k]
type = GenericConstantMaterial
prop_names = 'thermal_conductivity'
prop_values = '0.95' #copper in cal/(cm sec C)
prop_values = '1'
block = 'interior'
[../]
[./cp]
type = GenericConstantMaterial
prop_names = 'specific_heat'
prop_values = '0.092' #copper in cal/(g C)
prop_values = '1'
block = 'interior'
[../]
[./rho]
type = GenericConstantMaterial
prop_names = 'density'
prop_values = '8.92' #copper in g/(cm^3)
prop_values = '1'
block = 'interior'
[../]
[]
[Postprocessors]
[./error]
type = NodalL2Error
function = '100*sin(3.14159*x/80)*exp(-0.95/(0.092*8.92)*3.14159^2/80^2*t)' #T(x,t) = 100sin(pix/L)exp(-rho/(cp k) pi^2/L^2 t)
variable = T
[../]
[]
# [Postprocessors]
# [./error]
# type = NodalL2Error
# function = '100*sin(3.14159*x/80)*exp(-0.95/(0.092*8.92)*3.14159^2/80^2*t)' #T(x,t) = 100sin(pix/L)exp(-rho/(cp k) pi^2/L^2 t)
# variable = T
# [../]
# []
[Executioner]
type = Transient
scheme = bdf2 # Others available: backward Euler, Crank-Nicholson, etc.
dt = 0.5 # Initial timestep size
scheme = bdf2 # Others available: backward Euler, Crank-Nicholson, etc.
#scheme = 'Explicit-Euler'
dt = 0.001 # Initial timestep size
start_time = 0 # Starting time
num_steps = 6 # DIVERGES AFTER 6 TIMESTEPS...
nl_rel_tol = 1e-12 # Nonlinear relative tolerance
num_steps = 200 # DIVERGES AFTER 6 TIMESTEPS...
nl_rel_tol = 1e-8 # Nonlinear relative tolerance
l_tol = 1e-6 # Linear tolerance
petsc_options_iname = '-pc_type -pc_hypre_type'
......
......@@ -19,10 +19,20 @@
[../]
[]
[ICs]
[./T_IC]
type = FunctionIC
variable = T
# function = 'exp(-3.14159*(x*x+y*y))'
function = '0.0'
[../]
[]
[Kernels]
[./HeatSource]
type = HeatSource
function = '100*cos(3.14159*x)*cos(3.14159*y)'
# function = '100*cos(3.14159*x)*cos(3.14159*y)'
function = '1.0'
variable = T
[../]
[./HeatDiff]
......@@ -35,24 +45,31 @@
[../]
[]
[Functions]
# BCFunction just returns 0.0 right now
[./bc_func]
type = BCFunction
[../]
[]
[BCs]
[./top]
type = DirichletBC
type = FunctionDirichletBC
variable = T
boundary = 'top'
value = 0
function = bc_func
[../]
[./bottom]
type = DirichletBC
type = FunctionDirichletBC
variable = T
boundary = 'bottom'
value = 0
function = bc_func
[../]
[./wall]
type = DirichletBC
type = FunctionDirichletBC
variable = T
boundary = 'wall'
value = 0
function = bc_func
[../]
[]
......@@ -60,19 +77,19 @@
[./k]
type = GenericConstantMaterial
prop_names = 'thermal_conductivity'
prop_values = '0.95' #copper in cal/(cm sec C)
prop_values = '1'
block = 'interior'
[../]
[./cp]
type = GenericConstantMaterial
prop_names = 'specific_heat'
prop_values = '0.092' #copper in cal/(g C)
prop_values = '1'
block = 'interior'
[../]
[./rho]
type = GenericConstantMaterial
prop_names = 'density'
prop_values = '8.92' #copper in g/(cm^3)
prop_values = '1'
block = 'interior'
[../]
[]
......@@ -89,10 +106,10 @@
type = Transient
scheme = bdf2 # Others available: backward Euler, Crank-Nicholson, etc.
dt = 0.5 # Initial timestep size
dt = 0.001 # Initial timestep size
start_time = 0 # Starting time
num_steps = 4 # DIVERGES AFTER 4 TIMESTEPS
nl_rel_tol = 1e-12 # Nonlinear relative tolerance
num_steps = 10 # DIVERGES AFTER 4 TIMESTEPS
nl_rel_tol = 1e-8 # Nonlinear relative tolerance
l_tol = 1e-6 # Linear tolerance
petsc_options_iname = '-pc_type -pc_hypre_type'
......
/****************************************************************/
/* DO NOT MODIFY THIS HEADER */
/* MOOSE - Multiphysics Object Oriented Simulation Environment */
/* */
/* (c) 2010 Battelle Energy Alliance, LLC */
/* ALL RIGHTS RESERVED */
/* */
/* Prepared by Battelle Energy Alliance, LLC */
/* Under Contract No. DE-AC07-05ID14517 */
/* With the U. S. Department of Energy */
/* */
/* See COPYRIGHT for full restrictions */
/****************************************************************/
#ifndef BCFUNCTION_H
#define BCFUNCTION_H
#include "Function.h"
class BCFunction;
template<>
InputParameters validParams<BCFunction>();
class BCFunction : public Function
{
public:
BCFunction(const InputParameters & parameters);
virtual Real value(Real t, const Point & p) override;
protected:
Real _alpha;
};
#endif //BCFUNCTION_H
......@@ -9,6 +9,8 @@
#include "AppFactory.h"
#include "MooseSyntax.h"
#include "BCFunction.h"
#include "AddSlaveFluxVectorAction.h"
#include "ConvectiveFluxFunction.h"
#include "GapConductance.h"
......@@ -94,6 +96,8 @@ HeatConductionApp::registerObjects(Factory & factory)
registerPostprocessor(ThermalConductivity);
registerConstraint(GapConductanceConstraint);
registerFunction(BCFunction);
}
// External entry point for dynamic syntax association
......
/****************************************************************/
/* DO NOT MODIFY THIS HEADER */
/* MOOSE - Multiphysics Object Oriented Simulation Environment */
/* */
/* (c) 2010 Battelle Energy Alliance, LLC */
/* ALL RIGHTS RESERVED */
/* */
/* Prepared by Battelle Energy Alliance, LLC */
/* Under Contract No. DE-AC07-05ID14517 */
/* With the U. S. Department of Energy */
/* */
/* See COPYRIGHT for full restrictions */
/****************************************************************/
#include "BCFunction.h"
template<>
InputParameters validParams<BCFunction>()
{
InputParameters params = validParams<Function>();
//params.addParam<Real>("alpha", 1.0, "The value of alpha");
return params;
}
// BCFunction::BCFunction(const InputParameters & parameters) :
// Function(parameters),
// _alpha(getParam<Real>("alpha"))
// {}
BCFunction::BCFunction(const InputParameters & parameters) : Function(parameters) {}
Real
BCFunction::value(Real /*t*/, const Point & p)
{
return 0.0;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment