COOLFluiD  Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
Functions.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 
8 #include "cf3/math/Defs.hpp"
10 
11 namespace cf3 {
12 namespace physics {
13 namespace navierstokes {
14 namespace navierstokes1d {
15 
17 
19  RowVector_NEQS& flux, Real& wave_speed )
20 {
21  compute_diffusive_flux(p,normal,flux);
22  compute_diffusive_wave_speed(p,normal,wave_speed);
23 }
24 
26  RowVector_NEQS& flux )
27 {
28  const Real& nx = normal[XX];
29 
30  // Viscous stress tensor
31  // tau_ij = mu ( du_i/dx_j + du_j/dx_i - delta_ij 2/3 div(u) )
32  Real tau_xx = p.mu*4./3.*p.grad_u[XX];
33 
34  // Heat flux
35  Real heat_flux = -p.kappa*(p.grad_T[XX]*nx);
36 
37  flux[0] = 0.;
38  flux[1] = tau_xx*nx;
39  flux[2] = (tau_xx*p.u)*nx - heat_flux;
40 }
41 
43  Real& wave_speed )
44 {
45  // maximum of kinematic viscosity nu and thermal diffusivity alpha
46  wave_speed = std::max(p.mu/p.rho, p.kappa/(p.rho*p.Cp));
47 }
48 
50 
51 } // navierstokes1d
52 } // navierstokes
53 } // physics
54 } // cf3
boost::proto::terminal< SFOp< NormalOp > >::type const normal
void compute_diffusive_flux(const Data &p, const ColVector_NDIM &normal, RowVector_NEQS &flux, Real &wave_speed)
Diffusive flux in conservative form.
Definition: Functions.cpp:18
MatrixTypes< NDIM, NEQS >::RowVector_NEQS RowVector_NEQS
Definition: Types.hpp:22
ColVector_NDIM grad_T
gradient of temperature
Definition: Data.hpp:32
void compute_diffusive_wave_speed(const Data &p, const ColVector_NDIM &normal, Real &wave_speed)
Maximum absolute wave speed.
Definition: Functions.cpp:42
Real max(const Real a, const Real b)
Maximum between two scalars.
Definition: Terminals.hpp:228
MatrixTypes< NDIM, NEQS >::ColVector_NDIM ColVector_NDIM
Definition: Types.hpp:23
Definition: Defs.hpp:17
ColVector_NDIM grad_u
gradient of x velocity
Definition: Data.hpp:31
Real u
velocity along XX
Definition: Data.hpp:33
Top-level namespace for coolfluid.
Definition: Action.cpp:18
Send comments to:
COOLFluiD Web Admin