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 "cf3/math/Defs.hpp"
9 
10 namespace cf3 {
11 namespace physics {
12 namespace euler {
13 namespace euler2d {
14 
16 
18 {
19  // cons: rho, rho*u, rho*E
20  cons = _cons;
21  rho=cons[0];
22  U[XX]=cons[1]/rho;
23  U[YY]=cons[2]/rho;
24  E=cons[3]/rho;
25  U2=U[XX]*U[XX] + U[YY]*U[YY];
26  p=(gamma-1.)*rho*(E - 0.5*U2);
27  H=E+p/rho;
28  c2=gamma*p/rho;
29  c=std::sqrt(c2);
30  M=std::sqrt(U2)/c;
31  T=p/(rho*R);
32 }
33 
35 {
36  // prim: rho, u, p
37  rho=prim[0];
38  U[XX]=prim[1];
39  U[YY]=prim[2];
40  p=prim[3];
41  U2=U[XX]*U[XX] + U[YY]*U[YY];
42  c2=gamma*p/rho;
43  c=std::sqrt(c2);
44  H=c2/(gamma-1.)+0.5*U2;
45  E=H-p/rho;
46  M=std::sqrt(U2)/c;
47  T=p/(rho*R);
48  cons[0]=rho;
49  cons[1]=rho*U[XX];
50  cons[2]=rho*U[YY];
51  cons[3]=rho*E;
52 }
53 
55 
56 } // euler2d
57 } // euler
58 } // physics
59 } // cf3
void compute_from_conservative(const RowVector_NEQS &cons)
Compute the data given conservative state.
Definition: Data.cpp:17
Real U2
velocity squared
Definition: Data.hpp:39
void compute_from_primitive(const RowVector_NEQS &prim)
Compute the data given primitive state.
Definition: Data.cpp:34
ColVector_NDIM U
velocity
Definition: Data.hpp:38
Definition: Defs.hpp:17
Real H
specific enthalpy
Definition: Data.hpp:40
Real c2
square of speed of sound, very commonly used
Definition: Data.hpp:41
Top-level namespace for coolfluid.
Definition: Action.cpp:18
Real c
speed of sound
Definition: Data.hpp:42
Real E
specific total energy
Definition: Data.hpp:45
Real gamma
specific heat ratio
Definition: Data.hpp:33
Definition: Defs.hpp:17
MatrixTypes< NDIM, NEQS >::RowVector_NEQS RowVector_NEQS
Definition: Types.hpp:22
Send comments to:
COOLFluiD Web Admin