GRINS-0.7.0
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
GRINS::BoussinesqBuoyancyBase Class Reference

#include <boussinesq_buoyancy_base.h>

Inheritance diagram for GRINS::BoussinesqBuoyancyBase:
Inheritance graph
[legend]
Collaboration diagram for GRINS::BoussinesqBuoyancyBase:
Collaboration graph
[legend]

Public Member Functions

 BoussinesqBuoyancyBase (const std::string &physics_name, const GetPot &input)
 
 ~BoussinesqBuoyancyBase ()
 
virtual void init_variables (libMesh::FEMSystem *system)
 Initialization of BoussinesqBuoyancy variables. More...
 
- Public Member Functions inherited from GRINS::Physics
 Physics (const GRINS::PhysicsName &physics_name, const GetPot &input)
 
virtual ~Physics ()
 
virtual bool enabled_on_elem (const libMesh::Elem *elem)
 Find if current physics is active on supplied element. More...
 
void set_is_steady (bool is_steady)
 Sets whether this physics is to be solved with a steady solver or not. More...
 
bool is_steady () const
 Returns whether or not this physics is being solved with a steady solver. More...
 
virtual void set_time_evolving_vars (libMesh::FEMSystem *system)
 Set which variables are time evolving. More...
 
virtual void auxiliary_init (MultiphysicsSystem &system)
 Any auxillary initialization a Physics class may need. More...
 
virtual void register_postprocessing_vars (const GetPot &input, PostProcessedQuantities< libMesh::Real > &postprocessing)
 Register name of postprocessed quantity with PostProcessedQuantities. More...
 
virtual void init_context (AssemblyContext &context)
 Initialize context for added physics variables. More...
 
virtual void element_time_derivative (bool compute_jacobian, AssemblyContext &context, CachedValues &cache)
 Time dependent part(s) of physics for element interiors. More...
 
virtual void side_time_derivative (bool compute_jacobian, AssemblyContext &context, CachedValues &cache)
 Time dependent part(s) of physics for boundaries of elements on the domain boundary. More...
 
virtual void nonlocal_time_derivative (bool compute_jacobian, AssemblyContext &context, CachedValues &cache)
 Time dependent part(s) of physics for scalar variables. More...
 
virtual void element_constraint (bool compute_jacobian, AssemblyContext &context, CachedValues &cache)
 Constraint part(s) of physics for element interiors. More...
 
virtual void side_constraint (bool compute_jacobian, AssemblyContext &context, CachedValues &cache)
 Constraint part(s) of physics for boundaries of elements on the domain boundary. More...
 
virtual void nonlocal_constraint (bool compute_jacobian, AssemblyContext &context, CachedValues &cache)
 Constraint part(s) of physics for scalar variables. More...
 
virtual void damping_residual (bool compute_jacobian, AssemblyContext &context, CachedValues &cache)
 Damping matrix part(s) for element interiors. All boundary terms lie within the time_derivative part. More...
 
virtual void mass_residual (bool compute_jacobian, AssemblyContext &context, CachedValues &cache)
 Mass matrix part(s) for element interiors. All boundary terms lie within the time_derivative part. More...
 
virtual void nonlocal_mass_residual (bool compute_jacobian, AssemblyContext &context, CachedValues &cache)
 Mass matrix part(s) for scalar variables. More...
 
void init_ics (libMesh::FEMSystem *system, libMesh::CompositeFunction< libMesh::Number > &all_ics)
 
virtual void compute_element_time_derivative_cache (const AssemblyContext &context, CachedValues &cache)
 
virtual void compute_side_time_derivative_cache (const AssemblyContext &context, CachedValues &cache)
 
virtual void compute_nonlocal_time_derivative_cache (const AssemblyContext &context, CachedValues &cache)
 
virtual void compute_element_constraint_cache (const AssemblyContext &context, CachedValues &cache)
 
virtual void compute_side_constraint_cache (const AssemblyContext &context, CachedValues &cache)
 
virtual void compute_nonlocal_constraint_cache (const AssemblyContext &context, CachedValues &cache)
 
virtual void compute_damping_residual_cache (const AssemblyContext &context, CachedValues &cache)
 
virtual void compute_mass_residual_cache (const AssemblyContext &context, CachedValues &cache)
 
virtual void compute_nonlocal_mass_residual_cache (const AssemblyContext &context, CachedValues &cache)
 
virtual void compute_postprocessed_quantity (unsigned int quantity_index, const AssemblyContext &context, const libMesh::Point &point, libMesh::Real &value)
 
ICHandlingBaseget_ic_handler ()
 
- Public Member Functions inherited from GRINS::ParameterUser
 ParameterUser (const std::string &user_name)
 
virtual ~ParameterUser ()
 
virtual void set_parameter (libMesh::Number &param_variable, const GetPot &input, const std::string &param_name, libMesh::Number param_default)
 Each subclass can simultaneously read a parameter value from. More...
 
virtual void set_parameter (libMesh::ParsedFunction< libMesh::Number, libMesh::Gradient > &func, const GetPot &input, const std::string &func_param_name, const std::string &param_default)
 Each subclass can simultaneously read a parsed function from. More...
 
virtual void set_parameter (libMesh::ParsedFEMFunction< libMesh::Number > &func, const GetPot &input, const std::string &func_param_name, const std::string &param_default)
 Each subclass can simultaneously read a parsed function from. More...
 
virtual void move_parameter (const libMesh::Number &old_parameter, libMesh::Number &new_parameter)
 When cloning an object, we need to update parameter pointers. More...
 
virtual void move_parameter (const libMesh::ParsedFunction< libMesh::Number, libMesh::Gradient > &old_func, libMesh::ParsedFunction< libMesh::Number, libMesh::Gradient > &new_func)
 When cloning an object, we need to update parameter pointers. More...
 
virtual void move_parameter (const libMesh::ParsedFEMFunction< libMesh::Number > &old_func, libMesh::ParsedFEMFunction< libMesh::Number > &new_func)
 When cloning an object, we need to update parameter pointers. More...
 
virtual void register_parameter (const std::string &param_name, libMesh::ParameterMultiAccessor< libMesh::Number > &param_pointer) const
 Each subclass will register its copy of an independent. More...
 

Protected Member Functions

void read_property (const GetPot &input, const std::string &old_option, const std::string &property, libMesh::Real &value)
 Helper function for parsing/maintaing backward compatibility. More...
 
void no_input_warning (const GetPot &input, const std::string &old_option, const std::string &material, const std::string &property)
 Helper function for parsing/maintaing backward compatibility. More...
 
- Protected Member Functions inherited from GRINS::Physics
libMesh::UniquePtr< libMesh::FEGenericBase< libMesh::Real > > build_new_fe (const libMesh::Elem *elem, const libMesh::FEGenericBase< libMesh::Real > *fe, const libMesh::Point p)
 
void parse_enabled_subdomains (const GetPot &input, const std::string &physics_name)
 

Protected Attributes

VelocityFEVariables _flow_vars
 
PressureFEVariable _press_var
 
PrimitiveTempFEVariables _temp_vars
 
libMesh::Number _rho
 $ \rho = $ density More...
 
libMesh::Number _T_ref
 $ T_0 = $ reference temperature More...
 
libMesh::Number _beta_T
 $ \beta_T = $ coefficient of thermal expansion More...
 
libMesh::Point _g
 Gravitational vector. More...
 
unsigned int _dim
 Physical dimension of problem. More...
 
- Protected Attributes inherited from GRINS::Physics
const PhysicsName _physics_name
 Name of the physics object. Used for reading physics specific inputs. More...
 
GRINS::ICHandlingBase_ic_handler
 
std::set< libMesh::subdomain_id_type > _enabled_subdomains
 Subdomains on which the current Physics class is enabled. More...
 

Private Member Functions

 BoussinesqBuoyancyBase ()
 
void register_variables ()
 

Additional Inherited Members

- Static Public Member Functions inherited from GRINS::Physics
static void set_is_axisymmetric (bool is_axisymmetric)
 Set whether we should treat the problem as axisymmetric. More...
 
static bool is_axisymmetric ()
 
- Static Public Attributes inherited from GRINS::ParameterUser
static std::string zero_vector_function = std::string("{0}")
 A parseable function string with LIBMESH_DIM components, all 0. More...
 
- Static Protected Attributes inherited from GRINS::Physics
static bool _is_steady = false
 Caches whether or not the solver that's being used is steady or not. More...
 
static bool _is_axisymmetric = false
 Caches whether we are solving an axisymmetric problem or not. More...
 

Detailed Description

Definition at line 40 of file boussinesq_buoyancy_base.h.

Constructor & Destructor Documentation

GRINS::BoussinesqBuoyancyBase::BoussinesqBuoyancyBase ( const std::string &  physics_name,
const GetPot &  input 
)

Definition at line 44 of file boussinesq_buoyancy_base.C.

References _beta_T, _g, _rho, _T_ref, GRINS::PhysicsNaming::boussinesq_buoyancy(), read_property(), and register_variables().

45  : Physics(physics_name,input),
47  _press_var(input,PhysicsNaming::incompressible_navier_stokes(), true /*is_constraint_var*/),
49  _rho(0.0),
50  _T_ref(1.0),
51  _beta_T(1.0)
52  {
53  this->read_property(input,
54  "Physics/"+PhysicsNaming::boussinesq_buoyancy()+"/rho_ref",
55  "Density",
56  _rho);
57 
58  this->read_property(input,
59  "Physics/"+PhysicsNaming::boussinesq_buoyancy()+"/T_ref",
60  "ReferenceTemperature",
61  _T_ref);
62 
63 
64  this->read_property(input,
65  "Physics/"+PhysicsNaming::boussinesq_buoyancy()+"/beta_T",
66  "ThermalExpansionCoeff",
67  _beta_T);
68 
69  unsigned int g_dim = input.vector_variable_size("Physics/"+PhysicsNaming::boussinesq_buoyancy()+"/g");
70 
71  _g(0) = input("Physics/"+PhysicsNaming::boussinesq_buoyancy()+"/g", 0.0, 0 );
72  _g(1) = input("Physics/"+PhysicsNaming::boussinesq_buoyancy()+"/g", 0.0, 1 );
73 
74  if( g_dim == 3)
75  _g(2) = input("Physics/"+PhysicsNaming::boussinesq_buoyancy()+"/g", 0.0, 2 );
76 
77  this->register_variables();
78  }
void read_property(const GetPot &input, const std::string &old_option, const std::string &property, libMesh::Real &value)
Helper function for parsing/maintaing backward compatibility.
libMesh::Point _g
Gravitational vector.
static PhysicsName heat_transfer()
libMesh::Number _T_ref
reference temperature
static PhysicsName boussinesq_buoyancy()
static PhysicsName incompressible_navier_stokes()
libMesh::Number _beta_T
coefficient of thermal expansion
PrimitiveTempFEVariables _temp_vars
GRINS::BoussinesqBuoyancyBase::~BoussinesqBuoyancyBase ( )

Definition at line 80 of file boussinesq_buoyancy_base.C.

81  {
82  return;
83  }
GRINS::BoussinesqBuoyancyBase::BoussinesqBuoyancyBase ( )
private

Member Function Documentation

void GRINS::BoussinesqBuoyancyBase::init_variables ( libMesh::FEMSystem *  system)
virtual

Initialization of BoussinesqBuoyancy variables.

Implements GRINS::Physics.

Definition at line 95 of file boussinesq_buoyancy_base.C.

References _dim, _flow_vars, _press_var, _temp_vars, GRINS::VelocityFEVariables::init(), and GRINS::SingleFETypeVariable::init().

96  {
97  // Get libMesh to assign an index for each variable
98  this->_dim = system->get_mesh().mesh_dimension();
99 
100  _temp_vars.init(system);
101  _flow_vars.init(system);
102  this->_press_var.init(system);
103 
104  return;
105  }
virtual void init(libMesh::FEMSystem *system)
Add variables to the system.
unsigned int _dim
Physical dimension of problem.
virtual void init(libMesh::FEMSystem *system)
Add variables to the system.
PrimitiveTempFEVariables _temp_vars
void GRINS::BoussinesqBuoyancyBase::no_input_warning ( const GetPot &  input,
const std::string &  old_option,
const std::string &  material,
const std::string &  property 
)
protected

Helper function for parsing/maintaing backward compatibility.

Definition at line 153 of file boussinesq_buoyancy_base.C.

References GRINS::PhysicsNaming::boussinesq_buoyancy(), grins_warning, and GRINS::MaterialsParsing::have_material().

Referenced by read_property().

157  {
158  std::string warning;
160  {
161  warning = "WARNING: Neither "+old_option+"\n";
162  warning += " nor a material_name was detected in input\n";
163  warning + " "+property+" is defaulting to 1.0. This behavior is DEPRECATED!\n";
164  warning += " Please update to use Material/MATERIAL_NAME/"+property+"/value\n";
165  }
166  else
167  {
168  warning = "WARNING: Neither "+old_option+"\n";
169  warning += " nor Material/"+material+"/"+property+"/value\n";
170  warning + " "+property+" is defaulting to 1.0. This behavior is DEPRECATED!\n";
171  warning += " Please update to use Material/MATERIAL_NAME/"+property+"/value\n";
172  }
173 
174  grins_warning(warning);
175  }
#define grins_warning(message)
Definition: common.h:34
static PhysicsName boussinesq_buoyancy()
static bool have_material(const GetPot &input, const std::string &physics)
Check if Physics/physics section has a material variable.
void GRINS::BoussinesqBuoyancyBase::read_property ( const GetPot &  input,
const std::string &  old_option,
const std::string &  property,
libMesh::Real &  value 
)
protected

Helper function for parsing/maintaing backward compatibility.

Definition at line 107 of file boussinesq_buoyancy_base.C.

References GRINS::PhysicsNaming::boussinesq_buoyancy(), GRINS::MaterialsParsing::dep_input_warning(), GRINS::MaterialsParsing::duplicate_input_test(), GRINS::MaterialsParsing::material_name(), no_input_warning(), and GRINS::ParameterUser::set_parameter().

Referenced by BoussinesqBuoyancyBase().

111  {
113 
114  // Can't specify both material and rho_ref
116  old_option,
117  "Materials/"+material+"/"+property+"/value" );
118 
119  // Deprecated
120  if( input.have_variable(old_option) )
121  {
122  MaterialsParsing::dep_input_warning( old_option,property+"/value" );
123 
124  this->set_parameter
125  (value, input,
126  old_option, 1.0 /*Old default*/);
127  }
128  // Preferred
129  else if( input.have_variable("Materials/"+material+"/"+property+"/value" ) )
130  {
131  this->set_parameter
132  (value, input,
133  "Materials/"+material+"/"+property+"/value", 0.0 /*default*/);
134  }
135  // If nothing was set, we default to 1.0. Deprecated, what was I thinking
136  else
137  {
138  this->no_input_warning( input,
139  old_option,
140  material,
141  property );
142  this->set_parameter
143  (value, input, old_option, 1.0 /*default*/);
144  }
145 
146  // Make sure density is positive
147  if( value <= 0.0 )
148  {
149  libmesh_error_msg("ERROR: Detected non-positive "+property+"!");
150  }
151  }
virtual void set_parameter(libMesh::Number &param_variable, const GetPot &input, const std::string &param_name, libMesh::Number param_default)
Each subclass can simultaneously read a parameter value from.
static PhysicsName boussinesq_buoyancy()
void no_input_warning(const GetPot &input, const std::string &old_option, const std::string &material, const std::string &property)
Helper function for parsing/maintaing backward compatibility.
static void dep_input_warning(const std::string &old_option, const std::string &property)
Helper function for parsing/maintaing backward compatibility.
static void duplicate_input_test(const GetPot &input, const std::string &option1, const std::string &option2)
Helper function for parsing/maintaing backward compatibility.
static std::string material_name(const GetPot &input, const std::string &physics)
Get the name of the material in the Physics/physics section.
void GRINS::BoussinesqBuoyancyBase::register_variables ( )
private

Definition at line 85 of file boussinesq_buoyancy_base.C.

References _flow_vars, _press_var, _temp_vars, GRINS::GRINSPrivate::VariableWarehouse::check_and_register_variable(), GRINS::VariablesParsing::pressure_section(), GRINS::VariablesParsing::temperature_section(), and GRINS::VariablesParsing::velocity_section().

Referenced by BoussinesqBuoyancyBase().

86  {
88  this->_press_var);
90  this->_flow_vars);
92  this->_temp_vars);
93  }
static std::string temperature_section()
static void check_and_register_variable(const std::string &var_name, const FEVariablesBase &variable)
First check if var_name is registered and then register.
static std::string velocity_section()
static std::string pressure_section()
PrimitiveTempFEVariables _temp_vars

Member Data Documentation

libMesh::Number GRINS::BoussinesqBuoyancyBase::_beta_T
protected

$ \beta_T = $ coefficient of thermal expansion

Definition at line 76 of file boussinesq_buoyancy_base.h.

Referenced by BoussinesqBuoyancyBase(), and GRINS::BoussinesqBuoyancy::element_time_derivative().

unsigned int GRINS::BoussinesqBuoyancyBase::_dim
protected

Physical dimension of problem.

Definition at line 82 of file boussinesq_buoyancy_base.h.

Referenced by GRINS::BoussinesqBuoyancy::element_time_derivative(), and init_variables().

VelocityFEVariables GRINS::BoussinesqBuoyancyBase::_flow_vars
protected
libMesh::Point GRINS::BoussinesqBuoyancyBase::_g
protected

Gravitational vector.

Definition at line 79 of file boussinesq_buoyancy_base.h.

Referenced by BoussinesqBuoyancyBase(), and GRINS::BoussinesqBuoyancy::element_time_derivative().

PressureFEVariable GRINS::BoussinesqBuoyancyBase::_press_var
protected

Definition at line 66 of file boussinesq_buoyancy_base.h.

Referenced by init_variables(), and register_variables().

libMesh::Number GRINS::BoussinesqBuoyancyBase::_rho
protected
libMesh::Number GRINS::BoussinesqBuoyancyBase::_T_ref
protected

$ T_0 = $ reference temperature

Definition at line 73 of file boussinesq_buoyancy_base.h.

Referenced by BoussinesqBuoyancyBase(), and GRINS::BoussinesqBuoyancy::element_time_derivative().

PrimitiveTempFEVariables GRINS::BoussinesqBuoyancyBase::_temp_vars
protected

The documentation for this class was generated from the following files:

Generated on Thu Jun 2 2016 21:52:30 for GRINS-0.7.0 by  doxygen 1.8.10