TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Op_Dift_EF_Q1.cpp
1/****************************************************************************
2* Copyright (c) 2026, 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 <Op_Dift_EF_Q1.h>
17#include <Domaine_EF.h>
18#include <Champ_Uniforme.h>
19#include <Milieu_base.h>
20#include <Debog.h>
21#include <TRUSTTrav.h>
22#include <Probleme_base.h>
23#include <Dirichlet_paroi_fixe.h>
24#include <Dirichlet_paroi_defilante.h>
25#include <Neumann_paroi.h>
26#include <Echange_global_impose.h>
27#include <Echange_interne_global_impose.h>
28#include <Echange_couplage_thermique.h>
29#include <Echange_interne_global_parfait.h>
30#include <Champ_front_calc_interne.h>
31#include <Param.h>
32#include <Op_Conv_EF.h>
33#include <vector>
34#include <Champ_Fonc_P0_base.h>
35
36Implemente_instanciable_sans_constructeur(Op_Dift_EF_Q1,"Op_Dift_EF_Q1",Op_Dift_EF_base);
37
38Op_Dift_EF_Q1::Op_Dift_EF_Q1():transpose_(1),transpose_partout_(0),nouvelle_expression_(0) { }
39
40Sortie& Op_Dift_EF_Q1::printOn(Sortie& s ) const { return s << que_suis_je() ; }
41
42Entree& Op_Dift_EF_Q1::readOn(Entree& s ) { return s ; }
43
44Implemente_instanciable(Op_Dift_EF_Q1_option,"Op_Dift_EF_Q1_option",Op_Dift_EF_Q1);
45
46Sortie& Op_Dift_EF_Q1_option::printOn(Sortie& s ) const { return s << que_suis_je() ; }
47
49{
50 Param param(que_suis_je());
51 param.ajouter("grad_u_transpose", &transpose_ );
52 param.ajouter("grad_u_transpose_partout", &transpose_partout_ );
53 param.ajouter("nouvelle_expression",&nouvelle_expression_);
54 param.ajouter_condition("(value_of_grad_u_transpose_EQ_0)_OR_(value_of_grad_u_transpose_EQ_1)"," grad_u_transpose doit valoir 0 ou 1 ");
55 param.ajouter_condition("(value_of_grad_u_transpose_partout_EQ_0)_OR_(value_of_grad_u_transpose_partout_EQ_1)"," grad_u_transpose_partout doit valoir 0 ou 1 ");
56 param.ajouter_condition("(value_of_grad_u_transpose_partout_EQ_0)_OR_((value_of_grad_u_transpose_partout_EQ_1)_AND_(value_of_grad_u_transpose_EQ_1))"," si grad_u_transpose_partout vaut 1 alors grad_u_transpose doit valoir 1");
57 param.lire_avec_accolades_depuis(s);
58
59 return s ;
60}
61
62void Op_Dift_EF_Q1::remplir_marqueur_elem_CL_paroi(ArrOfInt& marqueur,const Domaine_EF& domaine_EF,const Domaine_Cl_EF& domaine_Cl_EF) const
63{
64 const IntTab& face_voisins=domaine_EF.face_voisins();
65 marqueur.resize_array(domaine_EF.nb_elem_tot());
66 if (!(le_modele_turbulence->utiliser_loi_paroi())) return;
67
68 int nb_bords=domaine_EF.nb_front_Cl();
69 for (int n_bord=0; n_bord<nb_bords; n_bord++)
70 {
71 const Cond_lim& la_cl = domaine_Cl_EF.les_conditions_limites(n_bord);
72 // Paroi fixe, Paroi defilante :
73 if (sub_type(Dirichlet_paroi_fixe,la_cl.valeur()) ||
74 sub_type(Dirichlet_paroi_defilante,la_cl.valeur()) )
75 {
76 const Front_VF& le_bord = ref_cast(Front_VF,la_cl->frontiere_dis());
77 int nfin =le_bord.nb_faces_tot();
78 for (int ind_face=0; ind_face<nfin; ind_face++)
79 {
80 int face=le_bord.num_face(ind_face);
81 int elem=face_voisins(face,0);
82 marqueur(elem)=1;
83 }
84 }
85 }
86}
87
88/*! @brief Associates the diffusivity field.
89 *
90 */
92{
93 diffusivite_ = diffu;
94}
95
96void Op_Dift_EF_Q1::remplir_nu(DoubleTab& nu) const
97{
98 const Domaine_EF& domaine_EF = le_dom_EF.valeur();
99 // Size nu
100 if (!nu.get_md_vector())
101 domaine_EF.domaine().creer_tableau_elements(nu);
102 const DoubleTab& diffu=diffusivite().valeurs();
103 if (diffu.size()==1)
104 nu = diffu(0,0);
105 else if (diffu.nb_dim()==1)
106 nu = diffu;
107 else
108 {
109 assert(diffu.dimension(1)==1);
110 for (int i=0; i<diffu.size_totale(); i++) nu(i)=diffu(i,0);
111 }
112
113// nu.echange_espace_virtuel();
114}
115
116
117DoubleTab& Op_Dift_EF_Q1::ajouter(const DoubleTab& tab_inconnue, DoubleTab& resu) const
118{
119 if ((equation().nombre_d_operateurs()>1)&&sub_type(Op_Conv_EF,equation().operateur(1).l_op_base()))
120 ref_cast(Op_Conv_EF,equation().operateur(1).l_op_base()).ajouter_a_la_diffusion(tab_inconnue,resu);
121 // ref_cast(Op_Conv_EF,equation().operateur(1).l_op_base()).ajouter_sous_cond(tab_inconnue,resu,0,0,1);
123 return ajouter_new(tab_inconnue,resu);
124
125
126
128 // const Domaine_Cl_EF& domaine_Cl_EF = la_zcl_EF.valeur();
129 const Domaine_EF& domaine_ef = le_dom_EF.valeur();
130 int nb_som_elem=domaine_ef.domaine().nb_som_elem();
131
132 int N = resu.line_size();
133 Nature_du_champ nat= equation().inconnue().nature_du_champ();
134 if (nat==vectoriel)
135 {
136 if ((dimension==3)&&(nb_som_elem==8))
137 return ajouter_vectoriel_dim3_nbn_8(tab_inconnue,resu);
138 else if ((dimension==2)&&(nb_som_elem==4))
139 {
140 return ajouter_vectoriel_dim2_nbn_4(tab_inconnue,resu);
141 }
142 else
143 {
144 Cerr<<__FILE__<<(int)__LINE__<< "cas non optimise "<<finl;
145 return ajouter_vectoriel_gen(tab_inconnue,resu);
146 }
147 }
148 else
149 {
150 if (N != 1)
151 {
152 Cerr<<__FILE__<<(int)__LINE__<< "cas non prevu "<<finl;
153 assert(0);
154 exit();
155 return ajouter(tab_inconnue,resu);
156 }
157 if ((dimension==3)&&(nb_som_elem==8))
158 return ajouter_scalaire_dim3_nbn_8(tab_inconnue,resu);
159 else if ((dimension==2)&&(nb_som_elem==4))
160 {
161 return ajouter_scalaire_dim2_nbn_4(tab_inconnue,resu);
162 }
163 else
164 {
165 Cerr<<__FILE__<<(int)__LINE__<< "cas non optimise "<<finl;
166 return ajouter_scalaire_gen(tab_inconnue,resu);
167 }
168
169 }
170 //
171}
172
173
174
175DoubleTab& Op_Dift_EF_Q1::ajouter_vectoriel_dim3_nbn_8(const DoubleTab& tab_inconnue, DoubleTab& resu) const
176{
177 return ajouter_vectoriel_template<AJOUTE_VECT::D3_8>(tab_inconnue,resu);
178}
179
180DoubleTab& Op_Dift_EF_Q1::ajouter_vectoriel_dim2_nbn_4(const DoubleTab& tab_inconnue, DoubleTab& resu) const
181{
182 return ajouter_vectoriel_template<AJOUTE_VECT::D2_4>(tab_inconnue,resu);
183}
184
185DoubleTab& Op_Dift_EF_Q1::ajouter_scalaire_dim3_nbn_8(const DoubleTab& tab_inconnue, DoubleTab& resu) const
186{
187 return ajouter_scalaire_template<AJOUTE_SCAL::D3_8>(tab_inconnue, resu);
188}
189
190DoubleTab& Op_Dift_EF_Q1::ajouter_scalaire_dim2_nbn_4(const DoubleTab& tab_inconnue, DoubleTab& resu) const
191{
192 return ajouter_scalaire_template<AJOUTE_SCAL::D2_4>(tab_inconnue, resu);
193}
194
195DoubleTab& Op_Dift_EF_Q1::ajouter_scalaire_gen(const DoubleTab& tab_inconnue, DoubleTab& resu) const
196{
197 return ajouter_scalaire_template<AJOUTE_SCAL::GEN>(tab_inconnue, resu);
198}
199
200DoubleTab& Op_Dift_EF_Q1::ajouter_vectoriel_gen(const DoubleTab& tab_inconnue, DoubleTab& resu) const
201{
202 return ajouter_vectoriel_template<AJOUTE_VECT::GEN>(tab_inconnue,resu);
203}
204
205DoubleTab& Op_Dift_EF_Q1::ajouter_new(const DoubleTab& tab_inconnue, DoubleTab& resu) const
206{
207 Cerr<<"NEW"<<finl;
209 // const Domaine_Cl_EF& domaine_Cl_EF = la_zcl_EF.valeur();
210 //const Domaine_EF& domaine_EF = le_dom_EF.valeur();
211
212 DoubleVect diffu_turb(diffusivite_turbulente().valeurs());
213 DoubleTab diffu(nu_);
214
215 const int N = resu.line_size();
216 ArrOfInt marqueur_neuman;
217 ArrOfInt marqueur_paroi=0;
218 const Domaine_EF& domaine_ef=ref_cast(Domaine_EF,equation().domaine_dis());
219 if(N > 1)
220 {
221 remplir_marqueur_sommet_neumann( marqueur_neuman,domaine_ef,la_zcl_EF.valeur(),transpose_partout_ );
222 remplir_marqueur_elem_CL_paroi( marqueur_paroi,domaine_ef,la_zcl_EF.valeur() );
223 }
224
225 const DoubleVect& volumes= domaine_ef.volumes();
226
227 const DoubleTab& bij=domaine_ef.Bij();
228 const DoubleTab& bij_thilde=domaine_ef.Bij_thilde();
229 int nb_elem_tot=domaine_ef.domaine().nb_elem_tot();
230 int nb_som_elem=domaine_ef.domaine().nb_som_elem();
231 const IntTab& elems=domaine_ef.domaine().les_elems() ;
232
233 for (int elem=0; elem<nb_elem_tot; elem++)
234 if (elem_contribue(elem)&&(!marqueur_paroi(elem)))
235 {
236 double pond=1./volumes(elem);
237 assert(N == dimension || N == 1);
238
239 for (int i1=0; i1<nb_som_elem; i1++)
240 {
241 int glob=elems(elem,i1);
242 int transpose = (marqueur_neuman[glob] == 1 || N == 1) ? 0 : transpose_;
243 for (int i2=0; i2<nb_som_elem; i2++)
244 {
245 int glob2=elems(elem,i2);
246 for (int n = 0; n < N; n++)
247 for (int d = 0; d < dimension; d++)
248 resu(glob, n) -= bij(elem, i1, d) * (bij_thilde(elem, i2, d) * tab_inconnue(glob2, n) + transpose * bij_thilde(elem, i2, n) * tab_inconnue(glob2, d)) * (diffu[elem]+diffu_turb[elem]) * pond;
249 }
250 }
251 }
252 // Debog::verifier(" Op_Dift_EF_Q1::ajouter, resu 0 ",resu);
253 // Journal()<<max(resu)<<" "<<min(resu)<<finl;
254
255
256 // add the contribution from boundaries
257 ajouter_bords(tab_inconnue,resu);
258 return resu;
259}
260
261DoubleTab& Op_Dift_EF_Q1::calculer(const DoubleTab& tab_inconnue, DoubleTab& resu) const
262{
263 resu = 0;
264 return ajouter(tab_inconnue,resu);
265}
266
267
268
269/////////////////////////////////////////
270// Method for the implicit scheme
271/////////////////////////////////////////
272
273
274// essai
275inline double& coeff_opt(Matrice_Morse& matrice,int i, int j)
276{
277 const auto& tab1_ = matrice.get_tab1();
278 const auto& tab2_ = matrice.get_tab2();
279 auto k1=tab1_[i]-1;
280 auto k2=tab1_[i+1]-1;
281 for (auto k=k1; k<k2; k++)
282 if (tab2_[k]-1 == j) return(matrice.get_set_coeff()(k));
283 Cerr << "i ou j ne conviennent pas " << finl;
284 Cerr << "i=" << i << finl;
285 Cerr << "j=" << j << finl;
286 Cerr << "n_lignes=" << matrice.nb_lignes() << finl;
287 Cerr << "n_colonnes=" << matrice.nb_colonnes() << finl;
289 return coeff_opt(matrice,i,j);
290}
291//#define matrice_coef(i,j) coeff_opt(matrice,i,j)
292#define matrice_coef(i,j) matrice.coef(i,j)
293void Op_Dift_EF_Q1::ajouter_contribution(const DoubleTab& transporte, Matrice_Morse& matrice ) const
294{
295 if (1)
296 if ((equation().nombre_d_operateurs()>1)&&sub_type(Op_Conv_EF,equation().operateur(1).l_op_base()))
297 ref_cast(Op_Conv_EF,equation().operateur(1).l_op_base()).ajouter_contribution_a_la_diffusion(transporte,matrice);
298
300 {
301 ajouter_contribution_new(transporte,matrice);
302 }
303 // Fill the nu array because matrix assembly with ajouter_contribution
304 // can happen before the first time step
306
307 DoubleVect diffu_turb(diffusivite_turbulente().valeurs());
308 DoubleTab diffu(nu_);
309
310 const int N = transporte.line_size();
311 const Domaine_EF& domaine_ef=ref_cast(Domaine_EF,equation().domaine_dis());
312 const DoubleVect& volumes_thilde= domaine_ef.volumes_thilde();
313 const DoubleVect& volumes= domaine_ef.volumes();
314
315 const DoubleTab& bij=domaine_ef.Bij();
316 int nb_elem_tot=domaine_ef.domaine().nb_elem_tot();
317 int nb_som_elem=domaine_ef.domaine().nb_som_elem();
318 const IntTab& elems=domaine_ef.domaine().les_elems() ;
319 int nb_som=domaine_ef.domaine().nb_som();
320
321 ArrOfInt marqueur_neuman;
322 remplir_marqueur_sommet_neumann( marqueur_neuman,domaine_ef,la_zcl_EF.valeur(),transpose_partout_ );
323 ArrOfInt marqueur_paroi = 0;
324 remplir_marqueur_elem_CL_paroi( marqueur_paroi,domaine_ef,la_zcl_EF.valeur() );
325 for (int elem=0; elem<nb_elem_tot; elem++)
326 if (elem_contribue(elem)&&(!marqueur_paroi(elem)))
327 {
328 double pond=volumes_thilde(elem)/volumes(elem)/volumes(elem);
329
330 for (int i1=0; i1<nb_som_elem; i1++)
331 {
332 int glob=elems(elem,i1);
333
334 int transpose = (marqueur_neuman[glob] == 1 || N == 1) ? 0 : transpose_;
335 if (glob<nb_som)
336 for (int i2=0; i2<nb_som_elem; i2++)
337 {
338 int glob2=elems(elem,i2);
339 double cb=0;
340 for (int b=0; b<dimension; b++)
341 cb+=bij(elem,i1,b)*bij(elem,i2,b);
342 for (int n = 0; n < N; n++)
343 {
344 matrice_coef(glob * N + n, glob2 * N + n) += cb * (diffu[elem]+diffu_turb[elem]) * pond;
345 if (transpose)
346 for (int d = 0; d < dimension; d++)
347 matrice_coef(glob * N + n, glob2 * N + d) += bij(elem, i1, d) * bij(elem, i2, n) * (diffu[elem]+diffu_turb[elem]) * pond;
348 }
349 }
350 }
351 }
352 if (N == 1) ajouter_contributions_bords(matrice);
353
354
355
356}
357
358void Op_Dift_EF_Q1::ajouter_contribution_new(const DoubleTab& transporte, Matrice_Morse& matrice ) const
359{
360 //Cerr<<" NEW"<<finl;
361 // Fill the nu array because matrix assembly with ajouter_contribution
362 // can happen before the first time step
364
365 DoubleVect diffu_turb(diffusivite_turbulente().valeurs());
366 DoubleTab diffu(nu_);
367
368 const int N = transporte.line_size();
369 const Domaine_EF& domaine_ef=ref_cast(Domaine_EF,equation().domaine_dis());
370 //const DoubleVect& volumes_thilde= domaine_ef.volumes_thilde();
371 const DoubleVect& volumes= domaine_ef.volumes();
372
373 const DoubleTab& bij=domaine_ef.Bij();
374 const DoubleTab& bij_thilde=domaine_ef.Bij_thilde();
375 int nb_elem_tot=domaine_ef.domaine().nb_elem_tot();
376 int nb_som_elem=domaine_ef.domaine().nb_som_elem();
377 const IntTab& elems=domaine_ef.domaine().les_elems() ;
378 int nb_som=domaine_ef.domaine().nb_som();
379
380 ArrOfInt marqueur_neuman;
381 remplir_marqueur_sommet_neumann( marqueur_neuman,domaine_ef,la_zcl_EF.valeur(),transpose_partout_ );
382 ArrOfInt marqueur_paroi = 0;
383 remplir_marqueur_elem_CL_paroi( marqueur_paroi,domaine_ef,la_zcl_EF.valeur() );
384 for (int elem=0; elem<nb_elem_tot; elem++)
385 if (elem_contribue(elem)&&(!marqueur_paroi(elem)))
386 {
387 double pond=1./volumes(elem);
388
389 for (int i1=0; i1<nb_som_elem; i1++)
390 {
391 int glob=elems(elem,i1);
392
393 int transpose = (marqueur_neuman[glob] == 1 || N == 1) ? 0 : transpose_;
394 if (glob<nb_som)
395 for (int i2=0; i2<nb_som_elem; i2++)
396 {
397 int glob2=elems(elem,i2);
398 double cb=0;
399 for (int b=0; b<dimension; b++)
400 cb+=bij(elem,i1,b)*bij_thilde(elem,i2,b);
401 for (int n = 0; n < N; n++)
402 {
403 matrice_coef(glob * N + n, glob2 * N + n) += cb * (diffu[elem]+diffu_turb[elem]) * pond;
404 if (transpose)
405 for (int d = 0; d < dimension; d++)
406 matrice_coef(glob * N + n, glob2 * N + d) += bij(elem, i1, d) * bij_thilde(elem, i2, n) * (diffu[elem]+diffu_turb[elem]) * pond;
407 }
408 }
409 }
410 }
411
412
413
414
415}
417{
418
419 if ((equation().nombre_d_operateurs()>1)&&sub_type(Op_Conv_EF,equation().operateur(1).l_op_base()))
420 ref_cast(Op_Conv_EF,equation().operateur(1).l_op_base()).contribue_au_second_membre_a_la_diffusion(resu);
421 const DoubleTab& tab_inconnue=equation().inconnue().valeurs();
422 ajouter_bords(tab_inconnue,resu,0);
423}
424void Op_Dift_EF_Q1::ajouter_bords(const DoubleTab& tab_inconnue,DoubleTab& resu, int contrib_interne ) const
425{
426 // to be moved into calculer_flux_bord....
427
428 const Domaine_Cl_EF& domaine_Cl_EF = la_zcl_EF.valeur();
429 const Domaine_EF& domaine_EF = le_dom_EF.valeur();
430 flux_bords_=0.;
431 // const DoubleTab& tab_inconnue=equation().inconnue().valeurs();
432 // loop over all boundary faces and compute lambda*gradT
433 const Domaine_EF& domaine_ef=ref_cast(Domaine_EF,equation().domaine_dis());
434 const IntTab& face_voisins=domaine_ef.face_voisins();
435 const DoubleTab& bij=domaine_ef.Bij();
436 int nb_som_elem=domaine_ef.domaine().nb_som_elem();
437 const IntTab& elems=domaine_ef.domaine().les_elems() ;
438 const DoubleTab& face_normales=domaine_ef.face_normales();
439 const DoubleVect& volumes_thilde= domaine_ef.volumes_thilde();
440 const DoubleVect& volumes= domaine_ef.volumes();
441
442 const IntTab& face_sommets=domaine_ef.face_sommets();
443 int nb_som_face=domaine_ef.nb_som_face();
444 int nb_faces_elem = domaine_ef.domaine().nb_faces_elem();
445 const IntTab& elem_faces = domaine_ef.elem_faces();
446 int nb_som_free = nb_som_elem-nb_som_face;
447
448 const int N = resu.line_size();
449
450 DoubleVect diffu_turb(diffusivite_turbulente().valeurs());
451 DoubleTab diffu(nu_);
452
453 if (N > 1)
454 {
455 for (int n_bord=0; n_bord<domaine_ef.nb_front_Cl(); n_bord++)
456 {
457
458 const Cond_lim& la_cl = domaine_Cl_EF.les_conditions_limites(n_bord);
459 const Front_VF& le_bord = ref_cast(Front_VF,la_cl->frontiere_dis());
460 int nb_faces_bord = le_bord.nb_faces_tot();
461 int num1=0;
462 int num2=nb_faces_bord;
463
464 if (sub_type(Dirichlet_paroi_fixe,la_cl.valeur()) ||
465 sub_type(Dirichlet_paroi_defilante,la_cl.valeur()) )
466 {
467 if (le_modele_turbulence->utiliser_loi_paroi())
468 {
469 DoubleVect n(dimension);
470 DoubleTrav Tgrad(dimension,dimension);
471 ArrOfDouble effort_face(dimension);
472 ArrOfDouble effort_elem(dimension);
473 ArrOfInt som_CL(nb_som_face);
474
475 // Loop over the BC faces
476 for (int ind_face=num1; ind_face<num2; ind_face++)
477 {
478 int num_face = le_bord.num_face(ind_face);
479 for (int isom=0; isom<nb_som_face; isom++)
480 {
481 int glob2=face_sommets(num_face,isom);
482 som_CL(isom) = glob2;
483 }
484 int elem=face_voisins(num_face,0);
485 double pond=volumes_thilde(elem)/volumes(elem);
486 for (int a=0; a<dimension; a++) n[a]=face_normales(num_face,a);
487 n/=norme_array(n);
488
489 // Compute gradient gradU via tau
490 // At the boundary, n is always oriented outward
491 for (int nc=0; nc<dimension; nc++)
492 for (int nc2=0; nc2<dimension; nc2++)
493 Tgrad(nc,nc2)=tau_tan_(num_face,nc)*n[nc2];
494
495 // Loop over the element faces
496 // (Sigma_e sum_face n = 0 => -Sigma_e sum_face_cl n = + Sigma_e sum_face_non_cl n)
497 effort_elem = 0.;
498 for (int i=0; i<nb_faces_elem; i++)
499 {
500 int face_i=elem_faces(elem,i);
501 // Compute the contribution of the face:
502 effort_face = 0.;
503 double ori=1.;
504 if ( face_voisins(face_i,0) != elem ) ori=-1;
505 if (face_i != num_face)
506 for (int nc=0; nc<dimension; nc++)
507 for (int nc2=0; nc2<dimension; nc2++)
508 effort_face(nc)+=ori*(Tgrad(nc,nc2)*face_normales(face_i,nc2))*pond;
509 // Cerr<<"force cisaillement face "<<i<<" => "<<effort_face<<finl;
510 effort_elem+=effort_face;
511 }
512 // Cerr<<"force cisaillement elem "<<elem<<" => "<<effort_elem<<finl;
513
514 // Compute the contribution to each element node:
515 // (the nb_som_face nodes of the Dirichlet BC face are not concerned)
516 int nb_iok = 0;
517 for (int jsom=0; jsom<nb_som_elem; jsom++)
518 {
519 int num_som = elems(elem,jsom);
520 int iok = 1;
521 for (int isom=0; isom<nb_som_face; isom++)
522 if (num_som == som_CL(isom)) iok = 0;
523 nb_iok += iok;
524 if (iok)
525 for (int nc=0; nc<dimension; nc++)
526 resu(num_som,nc)+= effort_elem(nc)/(nb_som_free);
527 }
528 if (nb_iok != nb_som_free)
529 {
530 Cerr<<"Op_Dift_EF_Q1::ajouter_bords: error in node count"<<finl;
531 exit();
532 }
533 }
534 }
535 }
536 }
537 // Cerr<<__PRETTY_FUNCTION__<<" non code pour les vecteurs"<<finl;
538 modifier_flux(*this);
539 return;
540 }
541 int premiere_face_int=domaine_ef.premiere_face_int();
542 for (int face=0; face<premiere_face_int; face++)
543 {
544 int elem=face_voisins(face,0);
545 if (elem==-1) face_voisins(face,1);
546
547 double pond= volumes_thilde(elem)/volumes(elem)/volumes(elem);
548
549 for (int i1=0; i1<nb_som_elem; i1++)
550 {
551
552 int glob2=elems(elem,i1);
553 {
554
555 for (int a=0; a<dimension; a++)
556 {
557 flux_bords_(face,0)+=face_normales(face,a)*bij(elem,i1,a)*tab_inconnue(glob2)*(diffu[elem]+diffu_turb[elem])*pond;
558 }
559 }
560 }
561
562 }
563
564 // Neumann :
565 int n_bord;
566 int nb_bords=domaine_Cl_EF.nb_cond_lim();
567
568 for (n_bord=0; n_bord<nb_bords; n_bord++)
569 {
570 const Cond_lim& la_cl = domaine_Cl_EF.les_conditions_limites(n_bord);
571 const Front_VF& le_bord = ref_cast(Front_VF,la_cl->frontiere_dis());
572 int ndeb = le_bord.num_premiere_face();
573 int nfin = ndeb + le_bord.nb_faces();
574
575 if (sub_type(Neumann_paroi,la_cl.valeur()))
576 {
577 const Neumann_paroi& la_cl_paroi = ref_cast(Neumann_paroi, la_cl.valeur());
578 for (int face=ndeb; face<nfin; face++)
579 {
580
581 double flux=la_cl_paroi.flux_impose(face-ndeb)*domaine_EF.surface(face);
582 for (int i1=0; i1<nb_som_face; i1++)
583 {
584 int glob2=face_sommets(face,i1);
585 {
586
587 resu[glob2] += flux/nb_som_face;
588 }
589 flux_bords_(face,0) = flux;
590 }
591 }
592 }
593 else if (sub_type(Echange_couplage_thermique, la_cl.valeur()))
594 {
595 const Echange_couplage_thermique& la_cl_paroi = ref_cast(Echange_couplage_thermique, la_cl.valeur());
596 for (int face=ndeb; face<nfin; face++)
597 {
598
599 double h=la_cl_paroi.h_imp(face-ndeb);
600 double Text=la_cl_paroi.T_ext(face-ndeb);
601 double phiext=la_cl_paroi.flux_exterieur_impose(face-ndeb);
602
603 double tm=0;
604 if (contrib_interne)
605 {
606 for (int i1=0; i1<nb_som_face; i1++)
607 {
608 int glob2=face_sommets(face,i1);
609 tm+=tab_inconnue(glob2);
610 }
611 tm/=nb_som_face;
612 }
613 double flux=(phiext+h*(Text-tm))*domaine_EF.surface(face);
614 flux_bords_(face,0) = flux;
615 flux/=nb_som_face;
616 for (int i1=0; i1<nb_som_face; i1++)
617 {
618 int glob2=face_sommets(face,i1);
619 resu[glob2] += flux;
620 }
621 }
622 }
623 else if (sub_type(Echange_interne_global_parfait, la_cl.valeur()))
624 {
625 if (contrib_interne)
626 {
627 const Echange_interne_global_parfait& la_cl_paroi = ref_cast(Echange_interne_global_parfait, la_cl.valeur());
628 const Champ_front_calc_interne& Text = ref_cast(Champ_front_calc_interne, la_cl_paroi.T_ext());
629 const IntVect& fmap = Text.face_map();
630 std::vector<bool> hit(nfin-ndeb);
631 std::fill(hit.begin(), hit.end(), false);
632 for (int face=ndeb; face<nfin; face++)
633 {
634 int opp_face = fmap(face-ndeb)+ndeb; // face on the other side of the inner wall:
635
636 // STRONG assumption : 1D, only one node per face:
637 int som=face_sommets(face,0);
638 int som_opp=face_sommets(opp_face,0);
639 if (!hit[face-ndeb]) // first time we encounter one of the face of the pair
640 {
641 // This where we write the heat equation skipping duplicated face: -A.T(i-1) + (A*T(i)+B.T(i)) - B.T(i+2)
642 // By default, we just have -A.T(i-1) + A*T(i)
643 // Recompute the extra bit of flux coming from the other side:
644 // Get opposite element
645 int elem1 = domaine_EF.face_voisins(opp_face, 0);
646 int elem_opp = (elem1 != -1) ? elem1 : domaine_EF.face_voisins(opp_face, 1);
647 // Other face of the opposite element (i.e. face "after" opp_face)
648 int f1 = domaine_EF.elem_faces(elem_opp, 0);
649 int face_plus_2 = f1 != opp_face ? f1 : domaine_EF.elem_faces(elem_opp, 1); // 2 faces per elem max - 1D
650 int som_p2 = face_sommets(face_plus_2, 0);
651
652 double pond = volumes_thilde(elem_opp)/volumes(elem_opp)/volumes(elem_opp); // taken from ajouter() ...
653 double B = nu_(elem_opp)*pond;
654 resu[som] -= B*(tab_inconnue[som]-tab_inconnue[som_p2]);
655 }
656 else
657 {
658 // This is where we set a Dirichlet T(face) = T(opposite_face)
659 // Initially, flux for this som is -B.T(i+1) + B.T(i+2) with B = nu(i+1) (nu being the diffusivity)
660 // -> We want to have B.T(i) - B.T(i+1)
661 int elem = domaine_EF.face_voisins(face, 0);
662 int f1 = domaine_EF.elem_faces(elem, 0);
663 int face_p2 = f1 != face ? f1 : domaine_EF.elem_faces(elem, 1); // other face of the current elem
664 int som_p2=face_sommets(face_p2,0);
665
666 double pond = volumes_thilde(elem)/volumes(elem)/volumes(elem); // taken from ajouter() ...
667 double B = nu_(elem)*pond;
668 resu[som] += B*(-tab_inconnue[som_p2] + tab_inconnue[som_opp]); // remove B.T(i+2) and add B.T(i)
669 }
670 hit[face-ndeb] = true;
671 hit[opp_face-ndeb] = true;
672 }
673 }
674 else // contrib_interne=0 --> implicit
675 {
676 for (int face=ndeb; face<nfin; face++)
677 {
678 flux_bords_(face,0) = 0.0;
679 }
680 }
681 }
682 else if (sub_type(Echange_interne_global_impose, la_cl.valeur()))
683 {
684 const Echange_interne_global_impose& la_cl_paroi = ref_cast(Echange_interne_global_impose, la_cl.valeur());
685 const DoubleVect& surface_gap = la_cl_paroi.surface_gap();
686 for (int face=ndeb; face<nfin; face++)
687 {
688 double h=la_cl_paroi.h_imp(face-ndeb);
689 const Champ_front_calc_interne& Text = ref_cast(Champ_front_calc_interne, la_cl_paroi.T_ext());
690 const IntVect& fmap = Text.face_map();
691 int opp_face = fmap(face-ndeb)+ndeb;
692
693 double tm=0.0;
694 double to=0.0; // opposite temp.
695 double flux=0.0;
696 if (contrib_interne) // explicit case
697 {
698 for (int i1=0; i1<nb_som_face; i1++)
699 {
700 int glob2=face_sommets(face,i1);
701 int glob3 =face_sommets(opp_face,i1);
702 tm+=tab_inconnue(glob2);
703 to+=tab_inconnue(glob3);
704 }
705 tm/=nb_som_face;
706 to/=nb_som_face;
707 //flux=h*(to-tm)*domaine_EF.surface(face);
708 flux=h*(to-tm)*surface_gap(face-ndeb);
709 }
710 else // implicit case via contribuer_au_second_membre()
711 {
712 flux = 0.0;
713 }
714 flux_bords_(face,0) = flux;
715 flux/=nb_som_face;
716 for (int i1=0; i1<nb_som_face; i1++)
717 {
718 int glob2=face_sommets(face,i1);
719 resu[glob2] += flux;
720 }
721 }
722 }
723 else if (sub_type(Echange_global_impose, la_cl.valeur()))
724 {
725 const Echange_global_impose& la_cl_paroi = ref_cast(Echange_global_impose, la_cl.valeur());
726 for (int face=ndeb; face<nfin; face++)
727 {
728
729 double h=la_cl_paroi.h_imp(face-ndeb);
730 double Text=la_cl_paroi.T_ext(face-ndeb);
731
732
733 double tm=0;
734 if (contrib_interne)
735 {
736 for (int i1=0; i1<nb_som_face; i1++)
737 {
738 int glob2=face_sommets(face,i1);
739 {
740 tm+=tab_inconnue(glob2);
741 }
742 }
743 tm/=nb_som_face;
744 }
745 double flux=h*(Text-tm)*domaine_EF.surface(face);
746 flux_bords_(face,0) = flux;
747 flux/=nb_som_face;
748 for (int i1=0; i1<nb_som_face; i1++)
749 {
750 int glob2=face_sommets(face,i1);
751 {
752 resu[glob2] += flux;
753 }
754
755 }
756 }
757 }
758
759
760 }
761 modifier_flux(*this);
762}
763
764
765
766
768{
769 const Domaine_Cl_EF& domaine_Cl_EF = la_zcl_EF.valeur();
770 const Domaine_EF& domaine_EF = le_dom_EF.valeur();
771 const Domaine_EF& domaine_ef=ref_cast(Domaine_EF,equation().domaine_dis());
772
773 const IntTab& face_sommets=domaine_ef.face_sommets();
774 int nb_som_face=domaine_ef.nb_som_face();
775
776 int N = equation().inconnue().valeurs().line_size();
777
778 if (N > 1)
779 {
780 // Cerr<<__PRETTY_FUNCTION__<<" non code pour les vecteurs"<<finl;
781 throw;
782 }
783
784 // Neumann :
785 int n_bord;
786 int nb_bords=domaine_Cl_EF.nb_cond_lim();
787
788 for (n_bord=0; n_bord<nb_bords; n_bord++)
789 {
790 const Cond_lim& la_cl = domaine_Cl_EF.les_conditions_limites(n_bord);
791 const Front_VF& le_bord = ref_cast(Front_VF,la_cl->frontiere_dis());
792 int ndeb = le_bord.num_premiere_face();
793 int nfin = ndeb + le_bord.nb_faces();
794
795 if (sub_type(Echange_couplage_thermique, la_cl.valeur()))
796 {
797 // matrice.imprimer(Cout);
798 const Echange_couplage_thermique& la_cl_paroi = ref_cast(Echange_couplage_thermique, la_cl.valeur());
799 for (int face=ndeb; face<nfin; face++)
800 {
801
802 double h=la_cl_paroi.h_imp(face-ndeb);
803 double dphi_dT=la_cl_paroi.derivee_flux_exterieur_imposee(face-ndeb);
804
805 double tm=1./(nb_som_face*nb_som_face);
806 double flux=(dphi_dT+h)*domaine_EF.surface(face)*tm;
807
808 for (int i1=0; i1<nb_som_face; i1++)
809 {
810 int glob2=face_sommets(face,i1);
811 for (int j1=0; j1<nb_som_face; j1++)
812 {
813 int glob1=face_sommets(face,j1);
814 matrice.coef(glob1,glob2) += flux;
815 }
816 }
817 }
818 // matrice.imprimer(Cout);exit();
819 }
820 else if (sub_type(Echange_interne_global_parfait, la_cl.valeur()))
821 {
822 const Echange_interne_global_parfait& la_cl_paroi = ref_cast(Echange_interne_global_parfait, la_cl.valeur());
823 const Champ_front_calc_interne& Text = ref_cast(Champ_front_calc_interne, la_cl_paroi.T_ext());
824 const IntVect& fmap = Text.face_map();
825 std::vector<bool> hit(nfin-ndeb);
826 std::fill(hit.begin(), hit.end(), false);
827 for (int face=ndeb; face<nfin; face++)
828 {
829 // face on the other side of the inner wall:
830 int opp_face = fmap(face-ndeb)+ndeb;
831 // element attached to it
832 int elem1 = domaine_EF.face_voisins(opp_face, 0);
833 int elem_opp = (elem1 != -1) ? elem1 : domaine_EF.face_voisins(opp_face, 1);
834 // other face of the opposite element (i.e. face "after" opp_face)
835 int f1 = domaine_EF.elem_faces(elem_opp, 0);
836 int face_plus_2 = f1 != opp_face ? f1 : domaine_EF.elem_faces(elem_opp, 1); // 2 faces per elem max - 1D
837 // other face of the current elem
838 int elem = domaine_EF.face_voisins(face, 0);
839 f1 = domaine_EF.elem_faces(elem, 0);
840 int face_min_1 = f1 != face ? f1 : domaine_EF.elem_faces(elem, 1);
841
842 for (int i1=0; i1<nb_som_face; i1++)
843 {
844 int som=face_sommets(face,i1);
845 int som_opp=face_sommets(opp_face,i1);
846 if (!hit[face-ndeb]) // first time we encounter one of the face of the pair
847 {
848 for (int j1=0; j1<nb_som_face; j1++)
849 {
850 // heat equation skipping duplicated face: -T(i-1) + 2*T(i) - T(i+2)
851 int som_p2=face_sommets(face_plus_2,j1);
852 matrice.coef(som,som_p2) -= matrice.coef(som_opp, som_opp);
853 matrice.coef(som, som) += matrice.coef(som_opp, som_opp);
854 }
855 hit[face-ndeb] = true;
856 hit[opp_face-ndeb] = true;
857 }
858 else // we have already handled the opposite side of the wall
859 for (int j1=0; j1<nb_som_face; j1++)
860 {
861 // Dirichlet T(face) = T(opposite_face) and cancelling right term in the tri-band
862 int som_m1=face_sommets(face_min_1, j1);
863 matrice.coef(som,som_opp) = -matrice.coef(som,som);
864 matrice.coef(som,som_m1) = 0;
865 }
866 }
867 }
868// matrice.imprimer(Cout);
869 }
870 else if (sub_type(Echange_interne_global_impose, la_cl.valeur()))
871 {
872 const Echange_interne_global_impose& la_cl_paroi = ref_cast(Echange_interne_global_impose, la_cl.valeur());
873 const Champ_front_calc_interne& Text = ref_cast(Champ_front_calc_interne, la_cl_paroi.T_ext());
874 const IntVect& fmap = Text.face_map();
875 const DoubleVect& surface_gap = la_cl_paroi.surface_gap();
876 for (int face=ndeb; face<nfin; face++)
877 {
878 double h=la_cl_paroi.h_imp(face-ndeb);
879 double tm=1./(nb_som_face*nb_som_face);
880 //double flux=h*domaine_EF.surface(face)*tm;
881 double flux=h*surface_gap(face-ndeb)*tm;
882 int opp_face = fmap(face-ndeb)+ndeb;
883
884 for (int i1=0; i1<nb_som_face; i1++)
885 {
886 int glob2=face_sommets(face,i1);
887 int glob3=face_sommets(opp_face,i1);
888 for (int j1=0; j1<nb_som_face; j1++)
889 {
890 int glob1=face_sommets(face,j1);
891 matrice.coef(glob1,glob2) += flux;
892 matrice.coef(glob1,glob3) -= flux;
893 }
894 }
895 }
896// matrice.imprimer(Cout);
897 }
898 else if (sub_type(Echange_global_impose, la_cl.valeur()))
899 {
900 // matrice.imprimer(Cout);
901 const Echange_global_impose& la_cl_paroi = ref_cast(Echange_global_impose, la_cl.valeur());
902 for (int face=ndeb; face<nfin; face++)
903 {
904 double h=la_cl_paroi.h_imp(face-ndeb);
905 double tm=1./(nb_som_face*nb_som_face);
906 double flux=h*domaine_EF.surface(face)*tm;
907 for (int i1=0; i1<nb_som_face; i1++)
908 {
909 int glob2=face_sommets(face,i1);
910 for (int j1=0; j1<nb_som_face; j1++)
911 {
912 int glob1=face_sommets(face,j1);
913 matrice.coef(glob1,glob2) += flux;
914 }
915 }
916 }
917 }
918 }
919}
921{
922 static int testee=0;
923 if(testee)
924 return;
925 testee=1;
926}
927
928void Op_Dift_EF_Q1::calculer_pour_post(Champ_base& espace_stockage,const Nom& option,int comp) const
929{
930}
931
933{
934 // 12/04: First optimization efforts to account for
935 // stability time step factorization
936
937 // Compute dt_stab
938 // Diffusivity is constant per element, so
939 // dt_diff must be computed for each element and
940 // dt_stab=Min(dt_diff (K) = h(K)*h(K)/(2*dimension*diffu2_(K)))
941 // where diffu2_ is the sum of the laminar and turbulent diffusivities
942
943 //GF
944 // alpha_dt_stab=(alpha+alpha_t)*alpha_dt_stab/alpha
945 // alpha_dt_stab=(nu+diff_nu_turb)*valeurs_diffusivite_dt/nu
946
947 // Fill the nu array containing the diffusivity at each element
949
950 double dt_stab=1.e30;
951 double coef;
952 const Domaine_EF& mon_dom_EF = le_dom_EF.valeur();
953
954 const Domaine& mon_dom= mon_dom_EF.domaine();
955
956 DoubleVect diffu_turb(diffusivite_turbulente().valeurs());
957 DoubleTab diffu(nu_);
958 if (equation().que_suis_je().debute_par("Convection_Diffusion_Temp"))
959 {
960 double rhocp = mon_equation->milieu().capacite_calorifique().valeurs()(0, 0) * mon_equation->milieu().masse_volumique().valeurs()(0, 0);
961 diffu_turb /= rhocp;
962 diffu /= rhocp;
963 }
964 double alpha;
965
966 int mon_dom_nb_elem=mon_dom.nb_elem();
968 {
969 const DoubleTab& rho_elem = get_champ_masse_volumique().valeurs();
970 assert(rho_elem.size_array()==mon_dom_EF.nb_elem_tot());
971 for (int num_elem=0; num_elem<mon_dom_nb_elem; num_elem++)
972 {
973 alpha = diffu[num_elem] + diffu_turb[num_elem]; // PQ : 06/03
974 alpha/=rho_elem[num_elem];
975 // dt=1/(dimension/(pas*pas))/(2*alpha)
976
977 coef=mon_dom_EF.carre_pas_maille(num_elem)/(2.*dimension*(alpha+DMINFLOAT));
978
979 // dt_stab=min(dt);
980 if (coef<dt_stab) dt_stab = coef;
981 }
982 }
983 else
984 {
985
986 const Champ_base& champ_diffusivite = diffusivite_pour_pas_de_temps();
987 const DoubleTab& valeurs_diffusivite = champ_diffusivite.valeurs();
988 double valeurs_diffusivite_dt=-1;
989 int unif_diffu_dt;
990 const Nature_du_champ nature_champ = equation().inconnue().nature_du_champ();
991
992 if (sub_type(Champ_Uniforme,champ_diffusivite))
993 {
994 valeurs_diffusivite_dt=valeurs_diffusivite(0,0);
995 unif_diffu_dt=1;
996 }
997 else
998 unif_diffu_dt=0;
999 if (nature_champ!=multi_scalaire)
1000 {
1001 int nb_dim = valeurs_diffusivite.nb_dim();
1002 for (int num_elem=0; num_elem<mon_dom_nb_elem; num_elem++)
1003 {
1004 alpha = diffu[num_elem] + diffu_turb[num_elem]; // PQ : 06/03
1005 if(unif_diffu_dt==0)
1006 valeurs_diffusivite_dt=(nb_dim==1?valeurs_diffusivite(num_elem):valeurs_diffusivite(num_elem,0));
1007 alpha*=valeurs_diffusivite_dt/(diffu[num_elem]+DMINFLOAT);
1008 // dt=1/(dimension/(pas*pas))/(2*alpha)
1009 coef=mon_dom_EF.carre_pas_maille(num_elem)/(2.*dimension*(alpha+DMINFLOAT));
1010 assert(coef>=0);
1011 // dt_stab=min(dt);
1012 if (coef<dt_stab) dt_stab = coef;
1013 }
1014 }
1015 else
1016 {
1017 int nb_comp = valeurs_diffusivite.dimension(1);
1018 for (int nc=0; nc<nb_comp; nc++)
1019 {
1020 for (int num_elem=0; num_elem<mon_dom_nb_elem; num_elem++)
1021 {
1022 alpha = diffu(num_elem,nc) + diffu_turb[num_elem];
1023 //if(unif_diffu_dt==0)
1024 valeurs_diffusivite_dt=valeurs_diffusivite(0,nc);
1025 alpha*=valeurs_diffusivite_dt/(diffu(num_elem,nc)+DMINFLOAT);
1026 coef=mon_dom_EF.carre_pas_maille(num_elem)/(2.*dimension*(alpha+DMINFLOAT));
1027
1028 if (coef<dt_stab) dt_stab = coef;
1029 }
1030 }
1031 }
1032 }
1033
1034 dt_stab = Process::mp_min(dt_stab);
1035 return dt_stab;
1036}
1037
DoubleTab & valeurs() override
Returns the array of field values at the current time.
virtual DoubleTab & valeurs()=0
Champ_Uniforme Represents a field that is constant in space and time.
class Champ_base This class is the base of the fields hierarchy.
Definition Champ_base.h:43
class Champ_front_calc_interne Derived class of Champ_front_calc representing
const IntVect & face_map() const
class Cond_lim Generic class used to represent any class
Definition Cond_lim.h:31
Dirichlet_paroi_defilante Imposes the wall velocity in an equation of type Navier_Stokes.
Dirichlet_paroi_fixe Represents a fixed wall in a Navier-Stokes type equation.
int nb_som_elem() const
Returns the number of vertices of the geometric elements that make up the domain.
Definition Domaine.h:474
int_t nb_elem_tot() const
Definition Domaine.h:132
virtual void creer_tableau_elements(Array_base &, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT) const
Creates a parallel array of values at elements.
Definition Domaine.cpp:850
IntTab_t & les_elems()
Definition Domaine.h:129
int_t nb_elem() const
Definition Domaine.h:131
int nb_faces_elem(int=0) const
Returns the number of faces of type i of the geometric elements that make up the domain.
Definition Domaine.h:484
int_t nb_som() const
Returns the number of vertices of the domain.
Definition Domaine.h:121
int nb_cond_lim() const
Returns the number of boundary conditions.
const Cond_lim & les_conditions_limites(int) const
Returns the i-th boundary condition.
class Domaine_EF
Definition Domaine_EF.h:56
double carre_pas_maille(int i) const
Definition Domaine_EF.h:70
const DoubleTab & Bij() const
Definition Domaine_EF.h:89
const DoubleTab & Bij_thilde() const
Definition Domaine_EF.h:90
const DoubleVect & volumes_thilde() const
Definition Domaine_EF.h:82
virtual double face_normales(int face, int comp) const
Definition Domaine_VF.h:47
double volumes(int i) const
Definition Domaine_VF.h:113
int face_sommets(int i, int j) const
Returns the index of the i-th vertex of face num_face.
Definition Domaine_VF.h:582
virtual double surface(int i) const
Definition Domaine_VF.h:53
int nb_som_face() const
Returns the number of vertices per face.
Definition Domaine_VF.h:493
int elem_faces(int i, int j) const
Returns the index of the i-th face of element num_elem; the face numbering convention is.
Definition Domaine_VF.h:542
int premiere_face_int() const
A face is internal if and only if it separates two elements.
Definition Domaine_VF.h:463
int face_voisins(int num_face, int i) const
Returns the neighbouring element of num_face in direction i.
Definition Domaine_VF.h:418
int nb_elem_tot() const
int nb_front_Cl() const
const Domaine & domaine() const
: class Echange_couplage_thermique
double flux_exterieur_impose(int i) const override
Classe Echange_global_impose This class represents the special case of the class.
virtual double derivee_flux_exterieur_imposee(int i) const
virtual double h_imp(int num) const
Returns the value of the imposed heat exchange coefficient on the i-th component.
virtual double T_ext(int num) const
Returns the value of the imposed temperature on the i-th component of the boundary field.
Class Echange_interne_global_impose: This class represents the special case of.
Class Echange_interne_global_parfait: Special case of a perfect internal exchange (h=+inf).
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
virtual const Champ_Inc_base & inconnue() const =0
virtual Nature_du_champ nature_du_champ() const
Definition Field_base.h:77
class Front_VF
Definition Front_VF.h:36
int nb_faces() const
Definition Front_VF.h:53
int num_premiere_face() const
Definition Front_VF.h:63
int nb_faces_tot() const
Definition Front_VF.h:58
int num_face(const int) const
Definition Front_VF.h:68
Matrice_Morse class - Represents a (sparse) matrix M, not necessarily square,.
const auto & get_tab2() const
const auto & get_tab1() const
auto & get_set_coeff()
double coef(int i, int j) const
int nb_colonnes() const override
Return local number of columns (=size on the current proc).
int nb_lignes() const override
Return local number of lines (=size on the current proc).
const Equation_base & equation() const
Returns the reference to the equation pointed to by MorEqn::mon_equation.
Definition MorEqn.h:62
Classe Neumann_paroi This boundary condition corresponds to an imposed flux for the.
virtual double flux_impose(int i) const
Returns the value of the imposed flux on the i-th component of the field representing the flux at the...
Definition Neumann.cpp:35
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
static int dimension
Definition Objet_U.h:94
const Nom & que_suis_je() const
Returns the string identifying the class.
Definition Objet_U.cpp:104
virtual Entree & readOn(Entree &)
Reads an Objet_U from an input stream. Virtual method to override.
Definition Objet_U.cpp:289
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
Definition Objet_U.cpp:278
class Op_Conv_EF Represents the convection operator associated with a scalar transport equation.
Definition Op_Conv_EF.h:38
const Champ_Fonc_base & diffusivite_turbulente() const
class Op_Dift_EF_Q1 Represents the diffusion operator.
void calculer_pour_post(Champ_base &espace_stockage, const Nom &option, int comp) const override
const Champ_base & diffusivite() const override
DoubleTab & ajouter_vectoriel_template(const DoubleTab &, DoubleTab &) const
DoubleTab & ajouter(const DoubleTab &, DoubleTab &) const override
void verifier() const
DoubleTab & ajouter_scalaire_dim2_nbn_4(const DoubleTab &, DoubleTab &) const
DoubleTab & ajouter_scalaire_template(const DoubleTab &, DoubleTab &) const
void ajouter_bords(const DoubleTab &, DoubleTab &, int contrib_interne=1) const
void ajouter_contribution_new(const DoubleTab &, Matrice_Morse &) const
void ajouter_contribution(const DoubleTab &, Matrice_Morse &) const
double calculer_dt_stab() const override
Computes dt_stab.
void ajouter_contributions_bords(Matrice_Morse &matrice) const
void associer_diffusivite(const Champ_base &) override
Associates the diffusivity field.
void contribuer_au_second_membre(DoubleTab &) const override
DOES NOTHING - to override in derived classes.
DoubleTab & ajouter_vectoriel_dim2_nbn_4(const DoubleTab &, DoubleTab &) const
void remplir_nu(DoubleTab &) const override
DoubleTab & ajouter_vectoriel_gen(const DoubleTab &, DoubleTab &) const
DoubleTab & ajouter_scalaire_gen(const DoubleTab &, DoubleTab &) const
DoubleTab & calculer(const DoubleTab &, DoubleTab &) const override
DoubleTab & ajouter_new(const DoubleTab &, DoubleTab &) const
DoubleTab & ajouter_scalaire_dim3_nbn_8(const DoubleTab &, DoubleTab &) const
void remplir_marqueur_elem_CL_paroi(ArrOfInt &, const Domaine_EF &, const Domaine_Cl_EF &) const
DoubleTab & ajouter_vectoriel_dim3_nbn_8(const DoubleTab &, DoubleTab &) const
int elem_contribue(const int elem) const
void modifier_flux(const Operateur_base &) const
Multiplies the boundary flux by rho cp or rho if necessary.
virtual const Champ_base & diffusivite_pour_pas_de_temps() const
Returns the field corresponding to the true diffusivity of the medium used for the time step computat...
DoubleTab flux_bords_
static double mp_min(double)
Definition Process.cpp:391
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Definition Process.cpp:466
Base class for output streams.
Definition Sortie.h:52
virtual const Champ_base & get_champ_masse_volumique() const
Returns the density field.
virtual int has_champ_masse_volumique() const
Returns 1 if the density field has been associated, 0 otherwise.
_SIZE_ size_array() const
void resize_array(_SIZE_ new_size, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
int nb_dim() const
Definition TRUSTTab.h:199
_SIZE_ dimension(int d) const
Definition TRUSTTab.tpp:133
_SIZE_ size() const
Definition TRUSTVect.tpp:45
_SIZE_ size_totale() const
Definition TRUSTVect.tpp:61
int line_size() const
Definition TRUSTVect.tpp:67
virtual const MD_Vector & get_md_vector() const
Definition TRUSTVect.h:123