GRINS-0.8.0
List of all members | Public Member Functions | Private Member Functions | Private Attributes
GRINS::ConstantViscosity Class Reference

#include <constant_viscosity.h>

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

Public Member Functions

 ConstantViscosity (const GetPot &input, const std::string &material)
 Constructor with specified material. More...
 
 ConstantViscosity (const GetPot &input)
 Deprecated constructor. More...
 
virtual ~ConstantViscosity ()
 
libMesh::Real operator() () const
 
libMesh::Real operator() (AssemblyContext &context, unsigned int qp) const
 
libMesh::Real operator() (const libMesh::Point &p, const libMesh::Real time)
 
libMesh::Real operator() (const libMesh::Real T) const
 
libMesh::Real deriv (const libMesh::Real T) const
 
- 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...
 
- Public Member Functions inherited from GRINS::ViscosityBase
 ViscosityBase ()
 
virtual ~ViscosityBase ()
 

Private Member Functions

 ConstantViscosity ()
 

Private Attributes

libMesh::Real _mu
 

Additional Inherited Members

- 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...
 
- Protected Member Functions inherited from GRINS::ViscosityBase
void check_input_consistency (const GetPot &input, const std::string &material) const
 
void old_mu_warning () const
 

Detailed Description

Definition at line 43 of file constant_viscosity.h.

Constructor & Destructor Documentation

GRINS::ConstantViscosity::ConstantViscosity ( const GetPot &  input,
const std::string &  material 
)

Constructor with specified material.

Will look in the input file for [Materials/material/Viscosity/value] for the value of viscosity.

Definition at line 65 of file constant_viscosity.C.

References _mu, GRINS::ViscosityBase::check_input_consistency(), grins_warning, GRINS::PhysicsNaming::incompressible_navier_stokes(), GRINS::ViscosityBase::old_mu_warning(), and GRINS::ParameterUser::set_parameter().

66  : ParameterUser("ConstantViscosity"),
67  ViscosityBase(),
68  _mu( 0.0 ) // Initialize to nonsense value
69  {
70  this->check_input_consistency(input,material);
71 
72  if( input.have_variable("Materials/"+material+"/Viscosity/value") &&
73  input.have_variable("Physics/"+PhysicsNaming::incompressible_navier_stokes()+"/mu") )
74  {
75  libmesh_error_msg("Error: Cannot specify both Materials/"+material+"/Viscosity/value and Physics/"+PhysicsNaming::incompressible_navier_stokes()+"/mu");
76  }
77 
78  // If we have the "new" version, then parse it
79  if( input.have_variable("Materials/"+material+"/Viscosity/value") )
80  {
81  this->set_parameter
82  (_mu, input, "Materials/"+material+"/Viscosity/value", _mu);
83  }
84  // If instead we have the old version, use that.
85  else if( input.have_variable("Materials/Viscosity/mu") )
86  {
87  this->old_mu_warning();
88 
89  this->set_parameter
90  (_mu, input, "Materials/Viscosity/mu", _mu);
91  }
92  /* If we don't have the new version of materials parsing or
93  explicitly have the old version, we're assuming an even older
94  version. Both of the older versions are deprecated. */
95  else if( !input.have_variable("Materials/Viscosity/mu") &&
96  !input.have_variable("Materials/"+material+"/Viscosity/value") )
97  {
98  std::string warning = "WARNING: No Materials/Viscosity/mu or\n";
99  warning += " Materials/"+material+"/Viscosity/value specified!\n";
100  warning += " We are assuming then that you want to specify through\n";
101  warning += " Physics/"+PhysicsNaming::incompressible_navier_stokes()+"/mu.\n";
102  warning += " This is DEPRECATED. Please updated to use Materials/"+material+"/Viscosity/value.\n";
103  grins_warning(warning);
104 
105  // Try and get the viscosity from other specifications
106  this->set_parameter
107  (_mu, input, "Physics/"+PhysicsNaming::incompressible_navier_stokes()+"/mu", _mu);
108  }
109  else
110  {
111  // This shouldn't happen
112  libmesh_error();
113  }
114 
115  // We'd better have postive viscosity when we're all done.
116  libmesh_assert_greater( _mu, 0.0 );
117  }
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.
void old_mu_warning() const
#define grins_warning(message)
Definition: common.h:34
ParameterUser(const std::string &user_name)
static PhysicsName incompressible_navier_stokes()
void check_input_consistency(const GetPot &input, const std::string &material) const
GRINS::ConstantViscosity::ConstantViscosity ( const GetPot &  input)

Deprecated constructor.

Definition at line 39 of file constant_viscosity.C.

References _mu, grins_warning, GRINS::PhysicsNaming::incompressible_navier_stokes(), and GRINS::ParameterUser::set_parameter().

40  : ParameterUser("ConstantViscosity"),
41  ViscosityBase(),
42  _mu(1.0)
43  {
44  // Warning about this constructor being deprecated
45  {
46  std::string warning = "WARNING: Use of this constructor is DEPRECATED.\n";
47  warning += " Please update to use constructor with input material name.\n";
48  grins_warning(warning);
49  }
50 
51  if( !input.have_variable("Materials/Viscosity/mu") )
52  {
53  libmesh_warning("No Materials/Viscosity/mu specified!\n");
54  // Try and get the viscosity from other specifications
55  this->set_parameter
56  (_mu, input, "Physics/"+PhysicsNaming::incompressible_navier_stokes()+"/mu", _mu);
57  }
58  else
59  {
60  this->set_parameter
61  (_mu, input, "Materials/Viscosity/mu", _mu);
62  }
63  }
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.
#define grins_warning(message)
Definition: common.h:34
ParameterUser(const std::string &user_name)
static PhysicsName incompressible_navier_stokes()
GRINS::ConstantViscosity::~ConstantViscosity ( )
virtual

Definition at line 119 of file constant_viscosity.C.

120  {
121  return;
122  }
GRINS::ConstantViscosity::ConstantViscosity ( )
private

Member Function Documentation

libMesh::Real GRINS::ConstantViscosity::deriv ( const libMesh::Real  T) const
inline

Definition at line 102 of file constant_viscosity.h.

103  {
104  return 0.0;
105  }
libMesh::Real GRINS::ConstantViscosity::operator() ( ) const
inline

Definition at line 77 of file constant_viscosity.h.

References _mu.

78  {
79  return _mu;
80  }
libMesh::Real GRINS::ConstantViscosity::operator() ( AssemblyContext context,
unsigned int  qp 
) const
inline

Definition at line 83 of file constant_viscosity.h.

References _mu.

84  {
85  return _mu;
86  }
libMesh::Real GRINS::ConstantViscosity::operator() ( const libMesh::Point &  p,
const libMesh::Real  time 
)
inline

Definition at line 89 of file constant_viscosity.h.

References _mu.

91  {
92  return _mu;
93  }
libMesh::Real GRINS::ConstantViscosity::operator() ( const libMesh::Real  T) const
inline

Definition at line 96 of file constant_viscosity.h.

97  {
98  return (*this)();
99  }

Member Data Documentation

libMesh::Real GRINS::ConstantViscosity::_mu
private

Definition at line 71 of file constant_viscosity.h.

Referenced by ConstantViscosity(), and operator()().


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

Generated on Tue Dec 19 2017 12:47:30 for GRINS-0.8.0 by  doxygen 1.8.9.1