COOLFluiD
Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
plugins
Physics
cf3
physics
euler
euler2d
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
"
8
#include "
cf3/physics/euler/euler2d/Data.hpp
"
9
10
namespace
cf3
{
11
namespace
physics
{
12
namespace
euler {
13
namespace
euler2d {
14
16
17
void
Data::compute_from_conservative
(
const
RowVector_NEQS
& _cons)
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
34
void
Data::compute_from_primitive
(
const
RowVector_NEQS
& prim)
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
cf3::physics::euler::euler2d::Data::p
Real p
pressure
Definition:
Data.hpp:43
cf3::physics::euler::euler2d::Data::R
Real R
gas constant
Definition:
Data.hpp:34
atest-boussinesq.physics
tuple physics
Definition:
atest-boussinesq.py:20
cf3::physics::euler::euler2d::Data::compute_from_conservative
void compute_from_conservative(const RowVector_NEQS &cons)
Compute the data given conservative state.
Definition:
Data.cpp:17
cf3::physics::euler::euler2d::Data::U2
Real U2
velocity squared
Definition:
Data.hpp:39
cf3::physics::euler::euler2d::Data::compute_from_primitive
void compute_from_primitive(const RowVector_NEQS &prim)
Compute the data given primitive state.
Definition:
Data.cpp:34
cf3::physics::euler::euler2d::Data::U
ColVector_NDIM U
velocity
Definition:
Data.hpp:38
cf3::physics::euler::euler2d::Data::T
Real T
temperature
Definition:
Data.hpp:44
cf3::physics::euler::euler2d::Data::cons
RowVector_NEQS cons
Definition:
Data.hpp:29
cf3::XX
Definition:
Defs.hpp:17
cf3::physics::euler::euler2d::Data::H
Real H
specific enthalpy
Definition:
Data.hpp:40
cf3::physics::euler::euler2d::Data::c2
Real c2
square of speed of sound, very commonly used
Definition:
Data.hpp:41
cf3
Top-level namespace for coolfluid.
Definition:
Action.cpp:18
cf3::physics::euler::euler2d::Data::c
Real c
speed of sound
Definition:
Data.hpp:42
cf3::physics::euler::euler2d::Data::M
Real M
Mach number.
Definition:
Data.hpp:46
cf3::physics::euler::euler2d::Data::E
Real E
specific total energy
Definition:
Data.hpp:45
Defs.hpp
cf3::physics::euler::euler2d::Data::rho
Real rho
density
Definition:
Data.hpp:37
cf3::physics::euler::euler2d::Data::gamma
Real gamma
specific heat ratio
Definition:
Data.hpp:33
cf3::YY
Definition:
Defs.hpp:17
Data.hpp
cf3::physics::euler::euler2d::RowVector_NEQS
MatrixTypes< NDIM, NEQS >::RowVector_NEQS RowVector_NEQS
Definition:
Types.hpp:22
Generated on Sun Jun 14 2015 21:20:15 for COOLFluiD by
1.8.9.1
Send comments to:
COOLFluiD Web Admin