GRINS-0.6.0
scalar_ode.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // GRINS - General Reacting Incompressible Navier-Stokes
5 //
6 // Copyright (C) 2014-2015 Paul T. Bauman, Roy H. Stogner
7 // Copyright (C) 2010-2013 The PECOS Development Team
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the Version 2.1 GNU Lesser General
11 // Public License as published by the Free Software Foundation.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc. 51 Franklin Street, Fifth Floor,
21 // Boston, MA 02110-1301 USA
22 //
23 //-----------------------------------------------------------------------el-
24 
25 
26 #ifndef GRINS_SCALAR_ODE_H
27 #define GRINS_SCALAR_ODE_H
28 
29 // GRINS
30 #include "grins_config.h"
31 #include "grins/assembly_context.h"
32 #include "grins/cached_values.h"
34 
35 // libMesh
36 #include "libmesh/fem_system.h"
37 #include "libmesh/getpot.h"
38 
39 // C++
40 #include <string>
41 
42 namespace GRINS
43 {
44 
46  /*
47  This physics class allows ODEs specified in ParsedFEMFunction
48  config file arguments to be solved.
49  */
50  class ScalarODE : public Physics
51  {
52  public:
53 
54  ScalarODE( const std::string& physics_name, const GetPot& input );
55 
56  ~ScalarODE();
57 
59 
62  virtual void init_variables( libMesh::FEMSystem* system );
63 
65  virtual void set_time_evolving_vars( libMesh::FEMSystem* system );
66 
68  virtual void read_input_options( const GetPot& input );
69 
71  virtual void init_context( AssemblyContext& context );
72 
73  // residual and jacobian calculations
74 
75  // User-specified ODE(s)
76  virtual void nonlocal_time_derivative ( bool compute_jacobian,
77  AssemblyContext& context,
78  CachedValues& cache );
79 
80  // User-specified constraint equation
81  virtual void nonlocal_constraint ( bool compute_jacobian,
82  AssemblyContext& context,
83  CachedValues& cache );
84 
85  // User-specified (or default "s'") mass term
86  virtual void nonlocal_mass_residual ( bool compute_jacobian,
87  AssemblyContext& context,
88  CachedValues& cache );
89 
91 
92  private:
93 
94  // strings describing the mass, time derivative, and
95  // constraint components of an ODE.
99 
100  // ParsedFEMFunctions evaluating the mass, time derivative, and
101  // constraint components of an ODE.
102  libMesh::AutoPtr<libMesh::FEMFunctionBase<libMesh::Number> >
106 
107  // Number of components of the scalar solution variable; defaults
108  // to 1.
109  libMesh::Number _order;
110 
111  // Perturbation to use for finite differencing of functions
112  libMesh::Number _epsilon;
113 
114  VariableIndex _scalar_ode_var; /* Index for turbine speed scalar */
115 
116  std::string _scalar_ode_var_name;
117 
118  ScalarODE();
119  };
120 
121 } // end namespace block
122 
123 #endif // GRINS_SCALAR_ODE_H
Physics class for arbitrary scalar-valued ODEs.
Definition: scalar_ode.h:50
unsigned int VariableIndex
More descriptive name of the type used for variable indices.
Definition: var_typedefs.h:40
std::string _scalar_ode_var_name
Definition: scalar_ode.h:116
Physics abstract base class. Defines API for physics to be added to MultiphysicsSystem.
Definition: physics.h:106
libMesh::Number _order
Definition: scalar_ode.h:109
std::string mass_residual_function_string
Definition: scalar_ode.h:96
virtual void read_input_options(const GetPot &input)
Read options from GetPot input file.
Definition: scalar_ode.C:84
virtual void init_context(AssemblyContext &context)
Prepare the context for evaluations.
Definition: scalar_ode.C:116
std::string time_deriv_function_string
Definition: scalar_ode.h:96
GRINS namespace.
std::string constraint_function_string
Definition: scalar_ode.h:96
libMesh::Number _epsilon
Definition: scalar_ode.h:112
virtual void nonlocal_mass_residual(bool compute_jacobian, AssemblyContext &context, CachedValues &cache)
Mass matrix part(s) for scalar variables.
Definition: scalar_ode.C:170
virtual void nonlocal_constraint(bool compute_jacobian, AssemblyContext &context, CachedValues &cache)
Constraint part(s) of physics for scalar variables.
Definition: scalar_ode.C:216
libMesh::AutoPtr< libMesh::FEMFunctionBase< libMesh::Number > > mass_residual_function
Definition: scalar_ode.h:103
libMesh::AutoPtr< libMesh::FEMFunctionBase< libMesh::Number > > constraint_function
Definition: scalar_ode.h:103
virtual void set_time_evolving_vars(libMesh::FEMSystem *system)
Sets scalar variable(s) to be time-evolving.
Definition: scalar_ode.C:62
virtual void init_variables(libMesh::FEMSystem *system)
Initialization of variables.
Definition: scalar_ode.C:55
libMesh::AutoPtr< libMesh::FEMFunctionBase< libMesh::Number > > time_deriv_function
Definition: scalar_ode.h:103
virtual void nonlocal_time_derivative(bool compute_jacobian, AssemblyContext &context, CachedValues &cache)
Time dependent part(s) of physics for scalar variables.
Definition: scalar_ode.C:124
VariableIndex scalar_ode_var() const
Definition: scalar_ode.h:90
VariableIndex _scalar_ode_var
Definition: scalar_ode.h:114

Generated on Mon Jun 22 2015 21:32:20 for GRINS-0.6.0 by  doxygen 1.8.9.1