www.mooseframework.org
Public Member Functions | Protected Attributes | List of all members
NSInitialCondition Class Reference

NSInitialCondition sets intial constant values for all variables given the: .) Initial pressure .) Initial temperature .) Initial velocity and a FluidProperties UserObject. More...

#include <NSInitialCondition.h>

Inheritance diagram for NSInitialCondition:
[legend]

Public Member Functions

 NSInitialCondition (const InputParameters &parameters)
 
virtual Real value (const Point &p)
 The value of the variable at a point. More...
 

Protected Attributes

Real _initial_pressure
 
Real _initial_temperature
 
RealVectorValue _initial_velocity
 
const IdealGasFluidProperties_fp
 

Detailed Description

NSInitialCondition sets intial constant values for all variables given the: .) Initial pressure .) Initial temperature .) Initial velocity and a FluidProperties UserObject.

Definition at line 28 of file NSInitialCondition.h.

Constructor & Destructor Documentation

NSInitialCondition::NSInitialCondition ( const InputParameters &  parameters)

Definition at line 36 of file NSInitialCondition.C.

37  : InitialCondition(parameters),
38  _initial_pressure(getParam<Real>("initial_pressure")),
39  _initial_temperature(getParam<Real>("initial_temperature")),
40  _initial_velocity(getParam<RealVectorValue>("initial_velocity")),
41  _fp(getUserObject<IdealGasFluidProperties>("fluid_properties"))
42 {
43 }
const IdealGasFluidProperties & _fp
RealVectorValue _initial_velocity

Member Function Documentation

Real NSInitialCondition::value ( const Point &  p)
virtual

The value of the variable at a point.

Definition at line 46 of file NSInitialCondition.C.

47 {
48  const Real rho_initial = _fp.rho(_initial_pressure, _initial_temperature);
49 
50  // TODO: The internal energy could be computed by the IdealGasFluidProperties.
51  const Real e_initial = _fp.cv() * _initial_temperature;
52  const Real E_initial = e_initial + 0.5 * _initial_velocity.norm_sq();
53  const Real v_initial = 1. / rho_initial;
54 
55  if (_var.name() == NS::enthalpy)
56  return E_initial + _initial_pressure / rho_initial;
57 
58  if (_var.name() == NS::internal_energy)
59  return e_initial;
60 
61  if (_var.name() == NS::mach_number)
62  return _initial_velocity.norm() / _fp.c(v_initial, e_initial);
63 
64  if (_var.name() == NS::pressure)
65  return _initial_pressure;
66 
67  if (_var.name() == NS::density)
68  return rho_initial;
69 
70  if (_var.name() == NS::momentum_x)
71  return rho_initial * _initial_velocity(0);
72 
73  if (_var.name() == NS::momentum_y)
74  return rho_initial * _initial_velocity(1);
75 
76  if (_var.name() == NS::momentum_z)
77  return rho_initial * _initial_velocity(2);
78 
79  if (_var.name() == NS::total_energy)
80  return rho_initial * E_initial;
81 
82  if (_var.name() == NS::specific_volume)
83  return v_initial;
84 
85  if (_var.name() == NS::temperature)
86  return _initial_temperature;
87 
88  if (_var.name() == NS::velocity_x)
89  return _initial_velocity(0);
90 
91  if (_var.name() == NS::velocity_y)
92  return _initial_velocity(1);
93 
94  if (_var.name() == NS::velocity_z)
95  return _initial_velocity(2);
96 
97  // If we got here, then the variable name was not one of the ones we know about.
98  mooseError("Unrecognized variable: ", _var.name());
99  return 0.;
100 }
const std::string momentum_x
Definition: NS.h:16
const std::string mach_number
Definition: NS.h:27
virtual Real rho(Real pressure, Real temperature) const override
Computes density from pressure and temperature.
const std::string velocity_z
Definition: NS.h:23
const std::string density
Definition: NS.h:15
const std::string velocity_x
Definition: NS.h:21
const std::string temperature
Definition: NS.h:25
const std::string enthalpy
Definition: NS.h:26
virtual Real cv(Real v=0., Real u=0.) const override
Isochoric specific heat.
const IdealGasFluidProperties & _fp
RealVectorValue _initial_velocity
const std::string specific_volume
Definition: NS.h:29
virtual Real c(Real v, Real u) const override
Sound speed.
const std::string velocity_y
Definition: NS.h:22
const std::string momentum_y
Definition: NS.h:17
const std::string pressure
Definition: NS.h:24
const std::string total_energy
Definition: NS.h:19
const std::string internal_energy
Definition: NS.h:28
const std::string momentum_z
Definition: NS.h:18

Member Data Documentation

const IdealGasFluidProperties& NSInitialCondition::_fp
protected

Definition at line 44 of file NSInitialCondition.h.

Referenced by value().

Real NSInitialCondition::_initial_pressure
protected

Definition at line 39 of file NSInitialCondition.h.

Referenced by value().

Real NSInitialCondition::_initial_temperature
protected

Definition at line 40 of file NSInitialCondition.h.

Referenced by value().

RealVectorValue NSInitialCondition::_initial_velocity
protected

Definition at line 41 of file NSInitialCondition.h.

Referenced by value().


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