TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Boundary_field_uniform_keps_from_ud.cpp
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#include <Boundary_field_uniform_keps_from_ud.h>
17#include <Param.h>
18
19Implemente_instanciable(Boundary_field_uniform_keps_from_ud,"Boundary_field_uniform_keps_from_ud",Champ_front_uniforme);
20
21
22
23/*! @brief Imprime le champ sur flot de sortie.
24 *
25 * Imprime la taille du champ et la valeur (constante) sur
26 * la frontiere.
27 *
28 * @param (Sortie& os) un flot de sortie
29 * @return (Sortie&) le flot de sortie modifie
30 */
32{
33 const DoubleTab& tab=valeurs();
34 os << tab.size() << " ";
35 for(int i=0; i<tab.size(); i++)
36 os << tab(0,i);
37 return os;
38}
39
40
41/*! @brief Lit le champ a partir d'un flot d'entree.
42 *
43 * Format:
44 * Boundary_field_uniform_keps_from_ud nb_compo u_value d_value
45 * we expect that nb_compo=2 (one for u and one for d)
46 *
47 * @param (Entree& is) un flot d'entree
48 * @return (Entree& is) le flot d'entree modifie
49 */
51{
52 double u=0,d=0;
53 DoubleTab& tab=les_valeurs->valeurs();
54
55 Param param(que_suis_je());
56 param.ajouter("U", &u,Param::REQUIRED); //initial velocity magnitude
57 param.ajouter("D", &d,Param::REQUIRED); //hydraulic diameter
58 param.lire_avec_accolades(is);
59
60 int keps_size=2;// k and eps
61 tab.resize(1,keps_size);
62 fixer_nb_comp(keps_size);
63
64 double I=0.05; //: initial turbulence intensity
65
66 pair val = k_eps_from_udi(u, d, I, dimension);
67 tab(0,0)= val.k;
68 tab(0,1)= val.eps;
69 return is;
70}
classe Boundary_field_uniform_keps_from_ud Classe derivee de Champ_front_uniforme which is for unifor...
virtual DoubleTab & valeurs() override
Renvoie le tableau des valeurs du champ.
classe Champ_front_uniforme Classe derivee de Champ_front_base qui represente les
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
virtual void fixer_nb_comp(int i)
Fixe le nombre de composantes du champ.
static int dimension
Definition Objet_U.h:99
const Nom & que_suis_je() const
renvoie la chaine identifiant la classe.
Definition Objet_U.cpp:104
virtual Entree & readOn(Entree &)
Lecture d'un Objet_U sur un flot d'entree Methode a surcharger.
Definition Objet_U.cpp:293
virtual Sortie & printOn(Sortie &) const
Ecriture de l'objet sur un flot de sortie Methode a surcharger.
Definition Objet_U.cpp:282
@ REQUIRED
Definition Param.h:115
Classe de base des flux de sortie.
Definition Sortie.h:52
void resize(_SIZE_ n, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
Definition TRUSTTab.tpp:469
_SIZE_ size() const
Definition TRUSTVect.tpp:45