COOLFluiD  Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
Data.cpp
Go to the documentation of this file.
1 // Copyright (C) 2010-2013 von Karman Institute for Fluid Dynamics, Belgium
2 //
3 // This software is distributed under the terms of the
4 // GNU Lesser General Public License version 3 (LGPLv3).
5 // See doc/lgpl.txt and doc/gpl.txt for the license text.
6 
7 #include "Data.hpp"
8 
9 namespace cf3 {
10 namespace physics {
11 namespace euler {
12 namespace euler1d {
13 
15 
17 {
18  // cons: rho, rho*u, rho*E
19  cons = _cons;
20  rho=cons[0];
21  u=cons[1]/rho;
22  E=cons[2]/rho;
23  u2=u*u;
24  p=(gamma-1.)*rho*(E - 0.5*u2);
25  H=E+p/rho;
26  c2=gamma*p/rho;
27  c=std::sqrt(c2);
28  M=u/c;
29  T=p/(rho*R);
30 }
31 
33 {
34  // prim: rho, u, p
35  rho=prim[0];
36  u=prim[1];
37  p=prim[2];
38  u2=u*u;
39  c2=gamma*p/rho;
40  c=std::sqrt(c2);
41  H=c2/(gamma-1.)+0.5*u2;
42  E=H-p/rho;
43  M=u/c;
44  T=p/(rho*R);
45  cons[0]=rho;
46  cons[1]=rho*u;
47  cons[2]=rho*E;
48 }
49 
51 
52 } // euler1D
53 } // euler
54 } // physics
55 } // cf3
void compute_from_conservative(const RowVector_NEQS &cons)
Compute the data given conservative state.
Definition: Data.cpp:16
void compute_from_primitive(const RowVector_NEQS &prim)
Compute the data given primitive state.
Definition: Data.cpp:32
MatrixTypes< NDIM, NEQS >::RowVector_NEQS RowVector_NEQS
Definition: Types.hpp:22
Real H
specific enthalpy
Definition: Data.hpp:35
Real c2
square of speed of sound, very commonly used
Definition: Data.hpp:36
Real u
velocity along XX
Definition: Data.hpp:33
Top-level namespace for coolfluid.
Definition: Action.cpp:18
Real c
speed of sound
Definition: Data.hpp:37
Real E
specific total energy
Definition: Data.hpp:40
Real u2
velocity along XX squared
Definition: Data.hpp:34
Real gamma
specific heat ratio
Definition: Data.hpp:28
Send comments to:
COOLFluiD Web Admin