TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Boundary_field_uniform_keps_from_ud.h
1/****************************************************************************
2* Copyright (c) 2015 - 2016, CEA
3* All rights reserved.
4*
5* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
9*
10* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
11* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
12* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
13*
14*****************************************************************************/
15
16
17#ifndef Boundary_field_uniform_keps_from_ud_included
18#define Boundary_field_uniform_keps_from_ud_included
19
20#include <Champ_front_uniforme.h>
21
22
23
24/*! @brief classe Boundary_field_uniform_keps_from_ud Classe derivee de Champ_front_uniforme which is for uniform fields
25 *
26 * in space and time
27 *
28 * @sa Champ_front_base Champ_front_uniforme
29 */
34
35struct pair
36{
37 double k;
38 double eps;
39};
40
41inline pair k_eps_from_udi(const double u, const double d, const double I, const int dimension)
42{
43 //Now compute associated K and Eps by appling formula given by :
44 //http://en.wikipedia.org/wiki/Turbulence_kinetic_energy
45 //http://www.cfd-online.com/Wiki/Turbulence_length_
46 //http://support.esi-cfd.com/esi-users/turb_parameters/
47
48 //Hypothesis:
49 //Cmu=0.09 : k-eps parameter
50 //l=0.038 Dh where Dh is the hydraulic diameter
51 //Note that Cmu^(3/4)=0.1643
52
53
54 //in 3D we have
55 //k = 3/2*(u*I)^2
56 //in 2D we have
57 //k = (u*I)^2
58 //with u = initial velocity magnitude
59 //eps = Cmu^(3/4) * k^(3/2) * l^(-1)
60 //where l is the turbulence length scale which can be expressed as 0.038 Dh
61 //Dh is the hydraulic diameter
62 double l=0.038*d;
63 pair val;
64 val.k = ( dimension == 2 ? 1 : 3./2. )*(u*I)*(u*I);
65 val.eps = 0.1643*pow(val.k,1.5)/l;
66 return val;
67}
68#endif
classe Boundary_field_uniform_keps_from_ud Classe derivee de Champ_front_uniforme which is for unifor...
classe Champ_front_uniforme Classe derivee de Champ_front_base qui represente les