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 navierstokes2d {
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  const Real& ny = normal[YY];
30 
31  Real two_third_divergence_U = 2./3.*(p.grad_u[XX] + p.grad_v[YY]);
32 
33  // Viscous stress tensor
34  // tau_ij = mu ( du_i/dx_j + du_j/dx_i - delta_ij 2/3 div(u) )
35  Real tau_xx = p.mu*(2.*p.grad_u[XX] - two_third_divergence_U);
36  Real tau_yy = p.mu*(2.*p.grad_v[YY] - two_third_divergence_U);
37  Real tau_xy = p.mu*(p.grad_u[YY] + p.grad_v[XX]);
38 
39  // Heat flux
40  Real heat_flux = -p.kappa*(p.grad_T[XX]*nx + p.grad_T[YY]*ny);
41 
42  flux[0] = 0.;
43  flux[1] = tau_xx*nx + tau_xy*ny;
44  flux[2] = tau_xy*nx + tau_yy*ny;
45  flux[3] = (tau_xx*p.U[XX] + tau_xy*p.U[YY])*nx + (tau_xy*p.U[XX] + tau_yy*p.U[YY])*ny - heat_flux;
46 }
47 
49  Real& wave_speed )
50 {
51  // maximum of kinematic viscosity nu and thermal diffusivity alpha
52  wave_speed = std::max(p.mu/p.rho, p.kappa/(p.rho*p.Cp));
53 }
54 
56 
57 } // navierstokes2d
58 } // navierstokes
59 } // physics
60 } // cf3
void compute_diffusive_wave_speed(const Data &p, const ColVector_NDIM &normal, Real &wave_speed)
Maximum absolute wave speed.
Definition: Functions.cpp:48
boost::proto::terminal< SFOp< NormalOp > >::type const normal
ColVector_NDIM grad_T
gradient of temperature
Definition: Data.hpp:33
MatrixTypes< NDIM, NEQS >::RowVector_NEQS RowVector_NEQS
Definition: Types.hpp:22
ColVector_NDIM grad_v
gradient of y velocity
Definition: Data.hpp:32
MatrixTypes< NDIM, NEQS >::ColVector_NDIM ColVector_NDIM
Definition: Types.hpp:23
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
ColVector_NDIM U
velocity
Definition: Data.hpp:38
Real max(const Real a, const Real b)
Maximum between two scalars.
Definition: Terminals.hpp:228
Definition: Defs.hpp:17
ColVector_NDIM grad_u
gradient of x velocity
Definition: Data.hpp:31
Top-level namespace for coolfluid.
Definition: Action.cpp:18
Real kappa
Thermal conductivity.
Definition: Data.hpp:27
Definition: Defs.hpp:17
Send comments to:
COOLFluiD Web Admin