Memosa-FVM  0.2
IdealGasDensityModel< T >::Impl Class Reference

#include <IdealGasDensityModel_impl.h>

Collaboration diagram for IdealGasDensityModel< T >::Impl:

Public Types

typedef Array< T > TArray
 

Public Member Functions

 Impl (const GeomFields &geomFields, FlowFields &flowFields, const MeshList &meshes)
 
VCMapgetVCMap ()
 
void init ()
 
bool advance (const int niter, bool init=false)
 

Private Attributes

const MeshList _meshes
 
const GeomFields_geomFields
 
FlowFields_flowFields
 
VCMap _vcMap
 

Detailed Description

template<class T>
class IdealGasDensityModel< T >::Impl

Definition at line 13 of file IdealGasDensityModel_impl.h.

Member Typedef Documentation

template<class T>
typedef Array<T> IdealGasDensityModel< T >::Impl::TArray

Definition at line 16 of file IdealGasDensityModel_impl.h.

Constructor & Destructor Documentation

template<class T>
IdealGasDensityModel< T >::Impl::Impl ( const GeomFields geomFields,
FlowFields flowFields,
const MeshList meshes 
)
inline

Definition at line 18 of file IdealGasDensityModel_impl.h.

References Model::_meshes, and Mesh::getID().

20  :
21  _meshes(meshes),
22  _geomFields(geomFields),
23  _flowFields(flowFields)
24  {
25  const int numMeshes = _meshes.size();
26  for (int n=0; n<numMeshes; n++)
27  {
28  const Mesh& mesh = *_meshes[n];
29 
30  IdealGasVC<T> *vc(new IdealGasVC<T>());
31  _vcMap[mesh.getID()] = vc;
32  }
33  }
Definition: Mesh.h:49
int getID() const
Definition: Mesh.h:106

Member Function Documentation

template<class T>
bool IdealGasDensityModel< T >::Impl::advance ( const int  niter,
bool  init = false 
)
inline

Definition at line 39 of file IdealGasDensityModel_impl.h.

References Model::_meshes, Mesh::getCells(), StorageSite::getCount(), Mesh::getID(), FloatVarDict< T >::getVal(), and IdealGasDensityModel< T >::init().

40  {
41  const int numMeshes = _meshes.size();
42  for (int n=0; n<numMeshes; n++)
43  {
44  const Mesh& mesh = *_meshes[n];
45 
46  const IdealGasVC<T>& vc = *_vcMap[mesh.getID()];
47 
48  const StorageSite& cells = mesh.getCells();
49 
50  TArray& density = dynamic_cast<TArray&>(_flowFields.density[cells]);
51 
52  FloatValEvaluator<T> cellP(vc.getVal("pressure"),cells);
53  FloatValEvaluator<T> cellT(vc.getVal("temperature"),cells);
54 
55  const T operatingPressure = vc["operatingPressure"];
56  const T molWt = vc["molecularWeight"];
57 
58  const T Rgas = 8314.472/molWt;
59  const int nCells = cells.getCount();
60 
61  const T pMin(1000);
62  const T TMin(1);
63  const T urf = init ? T(1) : T(vc["urf"]);
64 
65  for(int c=0; c<nCells; c++)
66  {
67  T absP = (cellP[c] + operatingPressure);
68  T temp = cellT[c];
69  if (absP < pMin) absP = pMin;
70  if (temp < TMin) temp = TMin;
71 
72  if (init)
73  density[c] = absP/(Rgas*temp);
74  else
75  density[c] = urf*absP/(Rgas*temp) + (1.0-urf)*density[c];
76  }
77  }
78  return true;
79  }
Definition: Mesh.h:49
FloatVal< T > getVal(const string varName) const
Definition: FloatVarDict.h:85
const StorageSite & getCells() const
Definition: Mesh.h:109
Field density
Definition: FlowFields.h:22
int getCount() const
Definition: StorageSite.h:39
int getID() const
Definition: Mesh.h:106
template<class T>
VCMap& IdealGasDensityModel< T >::Impl::getVCMap ( )
inline

Definition at line 35 of file IdealGasDensityModel_impl.h.

template<class T>
void IdealGasDensityModel< T >::Impl::init ( )
inline

Definition at line 37 of file IdealGasDensityModel_impl.h.

References IdealGasDensityModel< T >::advance().

37 { advance(1,true); }
bool advance(const int niter, bool init=false)

Member Data Documentation

template<class T>
FlowFields& IdealGasDensityModel< T >::Impl::_flowFields
private

Definition at line 85 of file IdealGasDensityModel_impl.h.

template<class T>
const GeomFields& IdealGasDensityModel< T >::Impl::_geomFields
private

Definition at line 84 of file IdealGasDensityModel_impl.h.

template<class T>
const MeshList IdealGasDensityModel< T >::Impl::_meshes
private

Definition at line 83 of file IdealGasDensityModel_impl.h.

template<class T>
VCMap IdealGasDensityModel< T >::Impl::_vcMap
private

Definition at line 87 of file IdealGasDensityModel_impl.h.


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