TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Operateur_IJK_faces_diff.cpp
1/****************************************************************************
2* Copyright (c) 2023, 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 <Operateur_IJK_faces_diff.h>
17#include <Param.h>
18
19Implemente_instanciable_sans_constructeur( Operateur_IJK_faces_diff, "Operateur_IJK_faces_diff", OWN_PTR( Operateur_IJK_faces_diff_base_double ) );
20
21Operateur_IJK_faces_diff::Operateur_IJK_faces_diff()
22{
23 /* simple_arithmetic : div(mu grad(u))
24 * full_arithmetic : Tenseur des contraintes complet : div[mu (grad(u)+grad^T(u))]
25 * mu : moyenne arithmetique
26 * full_adaptative : Tenseur des contraintes complet : div[mu (grad(u)+grad^T(u))]
27 * mu : switch from arithmetic to geometric mean depending on the direction (Not available yet)
28 */
29 diffusion_op_words_ = Motcles(17);
30 {
31 diffusion_op_words_[0] = "standard"; //
32 diffusion_op_words_[1] = "turb"; //
33 diffusion_op_words_[2] = "anisotropic"; //
34 diffusion_op_words_[3] = "laminar_transpose"; //
35 diffusion_op_words_[4] = "tensorial_zero_wall";
36 diffusion_op_words_[5] = "tensorial_anisotropic_zero_wall";
37 diffusion_op_words_[6] = "laminar_transpose_anisotropic"; //
38 diffusion_op_words_[7] = "laminar_transpose_tensorial_zero_wall"; //
39 diffusion_op_words_[8] = "laminar_transpose_tensorial_anisotropic_zero_wall"; //
40 diffusion_op_words_[9] = "laminar_transpose_divergence"; //
41 diffusion_op_words_[10] = "laminar_transpose_divergence_anisotropic"; //
42 diffusion_op_words_[11] = "laminar_transpose_divergence_tensorial_anisotropic_zero_wall"; //
43 diffusion_op_words_[12] = "laminar_transpose_divergence_tensorial_zero_wall"; //
44 diffusion_op_words_[13] = "structural_zero_wall"; //
45 diffusion_op_words_[14] = "simple_arithmetic";
46 diffusion_op_words_[15] = "full_arithmetic";
47 diffusion_op_words_[16] = "full_adaptative";
48 }
49 diffusion_op_ = "";
50 diffusion_op_options_ = Motcles(3);
51 {
52 diffusion_op_options_[0] = "simple_arithmetic";
53 diffusion_op_options_[1] = "full_arithmetic";
54 diffusion_op_options_[2] = "full_adaptative";
55 }
57 prefix_ = Nom("OpDiff");
58 suffix_ = Nom("IJK_double");
59 is_cast_ = false;
62}
63
64Sortie& Operateur_IJK_faces_diff::printOn(Sortie& os) const
65{
66 // OWN_PTR(Operateur_IJK_faces_diff_base_double)::printOn( os );
68 return os;
69}
70
71Entree& Operateur_IJK_faces_diff::readOn(Entree& is)
72{
73
75 return is;
76}
77
79{
80 param.ajouter_non_std("velocity_diffusion_form", (this));
81}
82
84{
85 if (mot == "velocity_diffusion_form")
86 {
87 Motcle motlu;
88 is >> motlu;
90 Cerr << mot << " " << motlu << finl;
91 int option_rank = diffusion_op_options_.search(motlu);
92 if (option_rank < diffusion_op_options_.size() && option_rank != -1)
94 else
96 }
97 return 1;
98}
99
101{
102 Cerr << "Read and Cast Operateur_IJK_faces_diff :" << finl;
103 Motcle word;
104 is >> word;
105 Nom type(get_diffusion_op_type(word));
106 typer(type);
107 is >> valeur();
108 is_cast_ = true;
109 return is;
110}
111
113{
114 Cerr << "Read and Cast Operateur_IJK_faces_diff :" << finl;
115 Motcle word(diffusion_op);
116 Motcle type(get_diffusion_op_type(word));
117 typer(type);
118 is_cast_ = true;
119}
120
122{
124 if (diffusion_option_rank_ == -1)
127
129 Nom type(prefix_);
130 // TODO: Use enum instead such as in IJK_FT: enum TimeScheme { EULER_EXPLICITE, RK3_FT }; ??
131 switch(diffusion_rank_)
132 {
133 case 0:
134 {
135 break;
136 }
137 case 1:
138 {
139 diffusion_op_ += "Turb";
140 break;
141 }
142 case 2:
143 {
144 diffusion_op_ += "Anisotropic";
145 break;
146 }
147 case 3:
148 {
149 diffusion_op_ += "StdWithLaminarTranspose";
150 break;
151 }
152 case 4:
153 {
154 diffusion_op_ += "TensorialZeroatwall";
155 break;
156 }
157 case 5:
158 {
159 diffusion_op_ += "TensorialAnisotropicZeroatwall";
160 break;
161 }
162 case 6:
163 {
164 diffusion_op_ += "StdWithLaminarTransposeAnisotropic";
165 break;
166 }
167 case 7:
168 {
169 diffusion_op_ += "StdWithLaminarTransposeTensorialZeroatwall";
170 break;
171 }
172 case 8:
173 {
174 diffusion_op_ += "StdWithLaminarTransposeTensorialAnisotropicZeroatwall";
175 break;
176 }
177 case 9:
178 {
179 diffusion_op_ += "StdWithLaminarTransposeAndDivergence";
180 break;
181 }
182 case 10:
183 {
184 diffusion_op_ += "StdWithLaminarTransposeAndDivergenceAnisotropic";
185 break;
186 }
187 case 11:
188 {
189 diffusion_op_ += "StdWithLaminarTransposeAndDivergenceTensorialAnisotropicZeroatwall";
190 break;
191 }
192 case 12:
193 {
194 diffusion_op_ += "StdWithLaminarTransposeAndDivergenceTensorialZeroatwall";
195 break;
196 }
197 case 13:
198 {
199 diffusion_op_ += "StructuralOnlyZeroatwall";
200 break;
201 }
202 case 14:
203 {
204 break;
205 }
206 case 15:
207 {
208 diffusion_op_ += "StdWithLaminarTranspose";
209 break;
210 }
211 case 16:
212 {
213 // TODO: Full adaptive (viscosity with direction dependancy !)
214 Cerr << "Unknown velocity diffusion operator! " << finl;
215 abort();
216 // Process::exit();
217 break;
218 }
219 default:
220 {
221 Cerr << "ERROR : Diffusion operators (faces) that are already implemented are:" << finl;
222 Cerr << diffusion_op_words_ << finl;
223 abort();
224 }
225 }
226 type += diffusion_op_;
227 type += suffix_;
228 return type;
229}
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
Une chaine de caractere (Nom) en majuscules.
Definition Motcle.h:26
class Nom Une chaine de caractere pour nommer les objets de TRUST
Definition Nom.h:31
int lire_motcle_non_standard(const Motcle &mot, Entree &is) override
void set_param(Param &param) const override
Helper class to factorize the readOn method of Objet_U classes.
Definition Param.h:112
void ajouter_non_std(const char *keyword, const Objet_U *value, Param::Nature nat=Param::OPTIONAL)
Register a keyword handled by Objet_U::lire_motcle_non_standard.
Definition Param.cpp:489
static int je_suis_maitre()
renvoie 1 si on est sur le processeur maitre du groupe courant (c'est a dire me() == 0),...
Definition Process.cpp:86
Classe de base des flux de sortie.
Definition Sortie.h:52