16#include <Navier_Stokes_FTD_IJK_tools.h>
17#include <Schema_Euler_explicite_IJK.h>
18#include <Probleme_FTD_IJK_tools.h>
19#include <Navier_Stokes_FTD_IJK.h>
20#include <Probleme_FTD_IJK_base.h>
21#include <Fluide_Diphasique_IJK.h>
22#include <Schema_RK3_IJK.h>
23#include <Option_IJK.h>
25#include <Perf_counters.h>
27#define COMPLEMENT_ANTI_DEVIATION_RESIDU
55 Cerr<<
"Reading of data for a "<<
que_suis_je()<<
" equation"<<finl;
58 param.lire_avec_accolades_depuis(is);
271 Cerr <<
"Error for the method Navier_Stokes_FTD_IJK::associer_pb_base\n";
272 Cerr <<
" Navier_Stokes_FTD_IJK equation must be associated to\n";
273 Cerr <<
" a Probleme_FTD_IJK_base problem type\n";
288 Cerr <<
"You forgot to associate a fluid to the problem named " <<
probleme().
le_nom() << finl;
291 return le_fluide_.valeur();
298 Cerr <<
"You forgot to associate a fluid to the problem named " <<
probleme().
le_nom() << finl;
301 return le_fluide_.valeur();
309 le_fluide_ = un_fluide;
313 Cerr <<
"Error of fluid type for the method Navier_Stokes_FTD_IJK::associer_milieu_base" << finl;
330 std::vector<FieldInfo_t> c =
334 {
"VELOCITY", Entity::FACE, Nature_du_champ::vectoriel,
false },
335 {
"VITESSE", Entity::FACE, Nature_du_champ::vectoriel,
false },
336 {
"VELOCITY_FT", Entity::FACE, Nature_du_champ::vectoriel,
false },
337 {
"PRESSURE", Entity::ELEMENT, Nature_du_champ::scalaire,
false },
338 {
"PRESSION", Entity::ELEMENT, Nature_du_champ::scalaire,
false },
339 {
"PRESSURE_RHS", Entity::ELEMENT, Nature_du_champ::scalaire,
false },
340 {
"PRESSION_RHS", Entity::ELEMENT, Nature_du_champ::scalaire,
false },
341 {
"SOURCE_QDM_INTERF", Entity::FACE, Nature_du_champ::vectoriel,
false },
342 {
"SHIELD_REPULSTION", Entity::FACE, Nature_du_champ::vectoriel,
false },
343 {
"SHIELD_REPULSTION_ABS", Entity::FACE, Nature_du_champ::vectoriel,
false },
344 {
"RHO", Entity::ELEMENT, Nature_du_champ::scalaire,
false },
345 {
"DENSITY", Entity::ELEMENT, Nature_du_champ::scalaire,
false },
346 {
"MU", Entity::ELEMENT, Nature_du_champ::scalaire,
false },
347 {
"VISCOSITY", Entity::ELEMENT, Nature_du_champ::scalaire,
false },
348 {
"EXTERNAL_FORCE", Entity::FACE, Nature_du_champ::vectoriel,
false },
350 chps.insert(chps.end(), c.begin(), c.end());
364 if (nom==
"EXTERNAL_FORCE")
368 if (!
probleme_ijk().get_interface().get_forcing_method())
369 for (
int dir = 0; dir < 3; dir++)
373 Cerr <<
"Posttraitement demande pour EXTERNAL_FORCE but ignored because coef_immobilisation_ <= 1e-16" << endl;
379 Cerr <<
"ERROR in Navier_Stokes_FTD_IJK::get_IJK_field_vector : " << finl;
380 Cerr <<
"Requested field '" << nom <<
"' is not recognized by Navier_Stokes_FTD_IJK::get_IJK_field_vector()." << finl;
389 Cerr <<
"ERROR in Navier_Stokes_FTD_IJK::get_IJK_field : " << finl;
390 Cerr <<
"Requested field '" << nom <<
"' is not recognized by Navier_Stokes_FTD_IJK::get_IJK_field()." << finl;
401 interfaces_->freeze();
402 Cout <<
"The option frozen_velocity automatically freeze the interface motion " <<
"by activating the flag interfaces_.frozen_" << finl;
408 Cerr <<
"expression_potential_phi and expression_variable_source are used together" <<
"nabla(phi) will be added to the expression given for the variable source" << finl;
414 Cerr <<
"When using pressure increment in u^star, expression_p_init " <<
expression_pression_initiale_ <<
"becomes a required parameter. " << finl;
423 Cerr <<
"Attention, conflit entre les options : vol_bulle_monodisperse_ et vol_bulles." <<
"Merci de choisir" << finl;
434 Cerr <<
"Option diffusion_alternative activee : le champ mu contient nu (la viscosite dynamique)" << finl;
435 Cerr <<
"TODO FIXME " << finl;
479 Cout <<
"Lecture vitesse initiale dans fichier " << fichier_reprise_vitesse <<
" timestep= " <<
timestep_reprise_vitesse_ << finl;
480 const Nom& geom_name =
velocity_[0].get_domaine().le_nom();
496#ifdef CONVERT_AT_READING_FROM_NURESAFE_TO_ADIM_TRYGGVASON_FOR_LIQUID_VELOCITY
497 const double coef = 14.353432757182377;
498 for (
int dir=0; dir< 3; dir++)
507 Cerr <<
"Erreur dans l'initialisation: la vitesse initiale doit etre fournie avec trois expressions" << finl;
512 Cout <<
"Initialisation vitesse \nvx = " << expression_vitesse_initiale[0] <<
"\nvy = " << expression_vitesse_initiale[1] <<
"\nvz = " << expression_vitesse_initiale[2] << finl;
513 for (
int i = 0; i < 3; i++)
516 set_field_data(
velocity_[i], expression_vitesse_initiale[i]);
539 if (interfaces_->get_nb_bulles_reelles() == 0)
552 interfaces_->parcourir_maillage();
560 const int nx = interfaces_->I().ni();
561 const int ny = interfaces_->I().nj();
562 const int nz = interfaces_->I().nk();
563 for (
int k = 0; k < nz; k++)
564 for (
int j = 0; j < ny; j++)
565 for (
int i = 0; i < nx; i++)
567 double chi_l = interfaces_->I(i, j, k);
568 rho_field_(i, j, k) = rho_l * chi_l + (1. - chi_l) * rho_v;
571 molecular_mu_(i, j, k) = 1. / (chi_l / mu_l + (1. - chi_l) / mu_v);
581 for (
int k = 0; k < nz; k++)
582 for (
int j = 0; j < ny; j++)
583 for (
int i = 0; i < nx; i++)
621 Cerr <<
"Navier_Stokes_FTD_IJK::initialise_ns_fields()" << finl;
629 Cerr <<
"Nb of cells / proc in z-direction must be >=4 for shear periodic run" << finl;
630 Cerr <<
"Nb of cells / proc in z-direction must be >=8 for shear periodic run if only one proc on z-direction" << finl;
631 Cerr <<
"Or find an other way to stock indic_ghost_zmin and zmax than IJK_Field" << finl;
636 Cerr <<
" Shear_periodic conditions works only without splitting in i-direction " << finl;
637 Cerr <<
"if splitting in i-direction --> get_neighbour_processor has to be changed" << finl;
643 allocate_velocity(
d_velocity_, dom_ijk, 1,
"D_VELOCITY");
654 for (
auto field : fields)
655 allocate_velocity(*field, dom_ijk, 1);
670 pressure_.allocate(dom_ijk,
Domaine_IJK::ELEM, 3, 0, 1,
"PRESSURE",
false, 1, rho_v, rho_l,
use_inv_rho_in_poisson_solver_);
686 allocate_velocity(
rho_v_, dom_ijk, 2);
698 molecular_mu_.allocate(dom_ijk,
Domaine_IJK::ELEM, 2, 0, 1,
"VISCOSITY",
false, 2, mu_v, mu_l, 0);
699 rho_field_.allocate(dom_ijk,
Domaine_IJK::ELEM, 2, 0, 1,
"DENSITY",
false, 2, rho_v, rho_l, 0);
733 for (
int dir = 0; dir < 3; dir++)
757 for (
int dir = 0; dir < 3; dir++)
773 constexpr int ft_ghost_cells = 4;
783 for (
auto field : fields)
784 allocate_velocity(*field, dom_ijk, 1);
800 Cerr <<
"Schema temps de type : RK3_FT" << finl;
804 Cerr <<
"Schema temps de type : Euler_Explicite" << finl;
838 Cerr <<
"Improved initial pressure" << finl;
852 for (
int dir = 0; dir < 3; dir++)
861 assert(interfaces_->get_nb_bulles_reelles() == 1);
862 DoubleTab bounding_box;
863 interfaces_->calculer_bounding_box_bulles(bounding_box);
865 const double Dbx = bounding_box(0, 0, 1) - bounding_box(0, 0, 0);
866 const double kappa = 2. / (Dbx / 2.);
873 for (
int k = 0; k < nk; k++)
874 for (
int j = 0; j < nj; j++)
875 for (
int i = 0; i < ni; i++)
877 double phi = gravite(0,0) * coords[0](i, j, k) + gravite(0,1) * coords[1](i, j, k) + gravite(0,2) * coords[2](i, j, k);
878 double potentiel_elem =
milieu_ijk().
sigma() * kappa - delta_rho * phi;
880 pressure_(i, j, k) = potentiel_elem * interfaces_->I(i, j, k);
891 for (
int dir = 0; dir < 3; dir++)
894 for (
int dir = 0; dir < 3; dir++)
897 for (
int k = 0; k < kmax; k++)
913 Cerr <<
"*****************************************************************************\n"
914 <<
" Attention : projection du champ de vitesse initial sur div(u)=0\n"
915 <<
"*****************************************************************************" << finl;
937 Cerr <<
" Warning: Possible incoherence des mots-cles\n"
938 <<
" ===========================================\n"
940 <<
"Avec correction_semi_locale_volume_bulle, la conservation du volume de la bulle repose entierement sur le fait que la divergence de la vitesse est numeriquement nulle en tout point.\n"
941 <<
"Il est suspect d'utiliser cette option avec disable_solveur_poisson.\n" << finl;
945 Cerr <<
" Warning: Possible incoherence des mots-cles\n"
946 <<
" ===========================================\n"
948 <<
"Avec correction_semi_locale_volume_bulle, la conservation du volume de la bulle repose entierement sur le fait que la divergence de la vitesse est numeriquement nulle en tout point.\n"
949 <<
"Pour securite, il est recommande d'utiliser avec cette option une projection initiale du champ de vitesse, garantissant cette propriete [mot-cle : projection_initiale].\n" << finl;
952 Cerr <<
"End of initial velocity projection" << finl;
959 if (!
probleme_ijk().domaine_ijk().get_periodic_flag(DIRECTION_K))
974 Cerr <<
"Cas normal diphasique Probleme_FTD_IJK_base::run()" << finl;
976 const double indic_moyen = calculer_v_moyen(interfaces_->I());
977 rho_moyen_ = indic_moyen * rho_l + (1 - indic_moyen) * rho_v;
978 if (
probleme_ijk().get_post().is_post_required(
"EXTERNAL_FORCE"))
979 for (
int dir = 0; dir < 3; dir++)
989 for (
int direction = 0; direction < 3; direction++)
996 Cout <<
"forcage_.get_type_forcage() : " <<
forcage_.get_type_forcage() << finl;
997 if (
forcage_.get_type_forcage() > 0)
1006 Cout <<
"BF compute_initial_chouippe" << finl;
1007 Cout <<
"ni : " << my_ni <<
" ,nj : " << my_nj <<
" ,nk : " << my_nk << finl;
1008 std::cout <<
"in initialise i_offset : " << gbz_splitting.
get_offset_local(DIRECTION_I) << std::endl;
1009 std::cout <<
"Process::me()" <<
Process::me() << std::endl;
1010 forcage_.compute_initial_chouippe(nproc_tot, my_geom, my_ni, my_nj, my_nk, gbz_splitting, pb_ijk.
nom_sauvegarde());
1016 Cout <<
"AF compute_initial_chouippe" << finl;
1040 double indicator_sum = 0;
1041 double terme_source_acceleration_increment;
1042 const int ni = interfaces_->I().ni();
1043 const int nj = interfaces_->I().nj();
1044 const int nk = interfaces_->I().nk();
1046 for (
int k = 0; k < nk; k++)
1047 for (
int j = 0; j < nj; j++)
1048 for (
int i = 0; i < ni; i++)
1050 const double indic = interfaces_->I(i, j, k);
1051 indicator_sum += indic;
1052 terme_source_acceleration_increment = rho_l * indic + rho_v * (1 - indic);
1074 if (interfaces_->get_flag_positions_reference() == 0)
1076 Cerr <<
"Saving interfacial positions as references." << finl;
1077 interfaces_->set_positions_reference();
1087 rho_field_.get_shear_BC_helpler().set_indicatrice_ghost_zmin_(
I_ns_, 0);
1098 interfaces_->calculer_kappa_ft(
kappa_ft_);
1116 rho_field_.get_shear_BC_helpler().set_indicatrice_ghost_zmin_(
I_ns_, 0);
1127 interfaces_->calculer_kappa_ft(
kappa_ft_);
1168 double v_moyx = calculer_v_moyen(
velocity_[0]);
1169 double v_moyy = calculer_v_moyen(
velocity_[1]);
1170 double v_moyz = calculer_v_moyen(
velocity_[2]);
1172 double rhov_moyx = calculer_v_moyen(
rho_v_[DIRECTION_I]);
1173 double rhov_moyy = calculer_v_moyen(
rho_v_[DIRECTION_J]);
1174 double rhov_moyz = calculer_v_moyen(
rho_v_[DIRECTION_K]);
1181 double vol_dom = Lz * Lx * Ly;
1186 alv = 1. - calculer_v_moyen(interfaces_->I());
1190 if (std::fabs(alv * drho) > DMINFLOAT)
1192 facv = 1. / (alv * drho);
1194 double uvx = facv * (rho_l * v_moyx - rhov_moyx);
1195 double uvy = facv * (rho_l * v_moyy - rhov_moyy);
1196 double uvz = facv * (rho_l * v_moyz - rhov_moyz);
1200 ArrOfDouble volumes;
1201 DoubleTab centre_gravite;
1203 const int nbulles_reelles = interfaces_->get_nb_bulles_reelles();
1204 const int nbulles_ghost = interfaces_->get_nb_bulles_ghost();
1205 const int nbulles_tot = nbulles_reelles + nbulles_ghost;
1207 volumes.resize_array(nbulles_tot);
1209 centre_gravite.
resize(nbulles_tot, 3);
1210 centre_gravite = 0.;
1212 double centre_moyx = 0;
1213 double centre_moyy = 0;
1214 double centre_moyz = 0;
1216 interfaces_->calculer_volume_bulles(volumes, centre_gravite);
1218 for (
int i = 0; i < nbulles_tot; i++)
1220 centre_moyx += 1.0 * centre_gravite(i, 0) / nbulles_tot;
1221 centre_moyy += 1.0 * centre_gravite(i, 1) / nbulles_tot;
1222 centre_moyz += 1.0 * centre_gravite(i, 2) / nbulles_tot;
1225 ax = -
Kp_ * (centre_moyx - Lx / 2) -
Kd_ * uvx;
1226 ay = -
Kp_ * (centre_moyy - Ly / 2) -
Kd_ * uvy;
1227 az = -
Kp_ * (centre_moyz - Lz / 2) -
Kd_ * uvz;
1234 for (
int dir = 0; dir < 3; dir++)
1239 const int ghost =
velocity_[dir].ghost();
1242 for (
int j = 0; j < jmax; j++)
1243 for (
int i = 0; i < imax; i++)
1247 for (
int k = -ghost; k < 0; k++)
1266 for (
int k = kmax; k < kmax + ghost; k++)
1290 for (
int dir = 0; dir < 3; dir++)
1308 const int ni = vx.
ni();
1309 const int nj = vx.
nj();
1310 const int nk = vx.
nk();
1315 const int nbulles_reelles = interfaces_->get_nb_bulles_reelles();
1316 const int nbulles_ghost = interfaces_->get_nb_bulles_ghost();
1317 const int nbulles_tot = nbulles_reelles + nbulles_ghost;
1319 u_bulles_.
resize(nbulles_tot, 3);
1322 compteur_vBulles_.
resize(nbulles_tot, 1);
1323 compteur_vBulles_ = 0.;
1325 ArrOfDouble volumes;
1326 ArrOfDouble aspect_ratios;
1327 DoubleTab centre_gravite;
1333 centre_gravite.
resize(nbulles_tot, 3);
1334 centre_gravite = 0.;
1348 interfaces_->calculer_aspect_ratio(aspect_ratios);
1349 interfaces_->calculer_volume_bulles(volumes,centre_gravite);
1353 centre_gravite.
resize(nbulles_tot, 3);
1360 for (
int ib = 0; ib < nbulles_tot; ib++)
1362 rayon = pow(3*volumes[ib]/(4.0*3.141592654),1.0/3.0);
1363 klim =
static_cast<int>( (aspect_ratios[ib]*rayon)/dx*1.05 );
1365 for (
int k_gamma = -klim; k_gamma <= klim; k_gamma++)
1367 for (
int k_beta = -klim; k_beta <= klim; k_beta++)
1369 for (
int k_alpha = -klim; k_alpha <= klim; k_alpha++)
1373 x_point = centre_gravite(ib,0) + k_beta*dx*1.0;
1374 y_point = centre_gravite(ib,1) + k_gamma*dx*1.0;
1375 z_point = centre_gravite(ib,2) + k_alpha*dx*1.0;
1386 while ( (z_point >= Lz) || (z_point < 0) || (y_point >= Ly) || (y_point < 0) || (x_point >= Lx) || (x_point < 0) )
1388 if ( z_point >= Lz )
1410 i_point =
static_cast<int>( x_point/dx );
1411 j_point =
static_cast<int>( y_point/dy );
1412 k_point =
static_cast<int>( z_point/dz );
1420 u_bulles_(ib,0) += (vx(i_local,j_local,k_local) + test*
boundary_conditions_.get_dU_perio())*(1.0-interfaces_->I(i_local,j_local,k_local));
1421 u_bulles_(ib,1) += (vy(i_local,j_local,k_local))*(1.0-interfaces_->I(i_local,j_local,k_local));
1422 u_bulles_(ib,2) += (vz(i_local,j_local,k_local))*(1.0-interfaces_->I(i_local,j_local,k_local));
1425 compteur_vBulles_(ib,0) += (1.0-interfaces_->I(i_local,j_local,k_local));
1434 for (
int i = 0; i < nbulles_tot; i++)
1437 const double x = (compteur_vBulles_(i,0) == 0.) ? 0. : 1. / compteur_vBulles_(i,0);
1438 u_bulles_(i, 0) *= x;
1439 u_bulles_(i, 1) *= x;
1440 u_bulles_(i, 2) *= x;
1445void Navier_Stokes_FTD_IJK::calculer_v_amont_bulle(
const IJK_Field_double& vx,
const IJK_Field_double& vy,
const IJK_Field_double& vz,
const IJK_Field_double& wx,
const IJK_Field_double& wy,
const IJK_Field_double& wz, DoubleTab& v_amont_, DoubleTab& w_amont_,
const DoubleTab& d1_amont_,
const DoubleTab& d2_amont_,
const DoubleTab& d3_amont_, DoubleTab& compteur_)
1448 cout <<
"v !!!!!!!!!!" << endl;
1456 const int ni = vx.
ni();
1457 const int nj = vx.
nj();
1458 const int nk = vx.
nk();
1463 const int nbulles_reelles = interfaces_->get_nb_bulles_reelles();
1464 const int nbulles_ghost = interfaces_->get_nb_bulles_ghost();
1465 const int nbulles_tot = nbulles_reelles + nbulles_ghost;
1467 v_amont_.
resize(nbulles_tot, 3);
1469 w_amont_.
resize(nbulles_tot, 3);
1471 compteur_.
resize(nbulles_tot, 1);
1474 ArrOfDouble volumes;
1475 ArrOfDouble aspect_ratios;
1476 DoubleTab centre_gravite;
1482 centre_gravite.
resize(nbulles_tot, 3);
1483 centre_gravite = 0.;
1509 interfaces_->calculer_aspect_ratio(aspect_ratios);
1510 interfaces_->calculer_volume_bulles(volumes,centre_gravite);
1514 centre_gravite.
resize(nbulles_tot, 3);
1522 for (
int ib = 0; ib < nbulles_tot; ib++)
1524 rayon = pow(3*volumes[ib]/(4.0*3.141592654),1.0/3.0);
1525 klim =
static_cast<int>( (aspect_ratios[ib]*rayon)/dx*
L_ );
1527 d1x = d1_amont_(ib,0);
1528 d1y = d1_amont_(ib,1);
1529 d1z = d1_amont_(ib,2);
1531 d2x = d2_amont_(ib,0);
1532 d2y = d2_amont_(ib,1);
1533 d2z = d2_amont_(ib,2);
1535 d3x = d3_amont_(ib,0);
1536 d3y = d3_amont_(ib,1);
1537 d3z = d3_amont_(ib,2);
1539 for (
int k_gamma = -klim; k_gamma <= klim; k_gamma++)
1541 klim2 =
static_cast<int>( sqrt(klim*klim - k_gamma*k_gamma) );
1542 for (
int k_beta = -klim2; k_beta <= klim2; k_beta++)
1544 for (
int k_alpha = 0; k_alpha <= 2; k_alpha++)
1548 x_point = centre_gravite(ib,0) + (
delta_ + k_alpha*dx) * d1x + (k_beta*d2x*1.0+k_gamma*d3x*1.0)*dx*1.0;
1549 y_point = centre_gravite(ib,1) + (
delta_ + k_alpha*dx) * d1y + (k_beta*d2y*1.0+k_gamma*d3y*1.0)*dx*1.0;
1550 z_point = centre_gravite(ib,2) + (
delta_ + k_alpha*dx) * d1z + (k_beta*d2z*1.0+k_gamma*d3z*1.0)*dx*1.0;
1561 while ( (z_point >= Lz) || (z_point < 0) || (y_point >= Ly) || (y_point < 0) || (x_point >= Lx) || (x_point < 0) )
1563 if ( z_point >= Lz )
1585 i_point =
static_cast<int>( x_point/dx );
1586 j_point =
static_cast<int>( y_point/dy );
1587 k_point =
static_cast<int>( z_point/dz );
1596 v_amont_(ib,1) += (vy(i_local,j_local,k_local));
1597 v_amont_(ib,2) += (vz(i_local,j_local,k_local));
1600 compteur_(ib,0) += 1;
1602 w_amont_(ib,0) += wx(i_local,j_local,k_local);
1603 w_amont_(ib,1) += wy(i_local,j_local,k_local);
1604 w_amont_(ib,2) += wz(i_local,j_local,k_local);
1614 for (
int i = 0; i < nbulles_tot; i++)
1617 const double x = (compteur_(i,0) == 0.) ? 0. : 1. / compteur_(i,0);
1618 v_amont_(i, 0) *= x;
1619 v_amont_(i, 1) *= x;
1620 v_amont_(i, 2) *= x;
1622 w_amont_(i, 0) *= x;
1623 w_amont_(i, 1) *= x;
1624 w_amont_(i, 2) *= x;
1628void Navier_Stokes_FTD_IJK::calculer_base_amont_bulle(
const IJK_Field_double& vx,
const IJK_Field_double& vy,
const IJK_Field_double& vz,
const DoubleTab& ubulles, DoubleTab& d1_amont_, DoubleTab& d2_amont_, DoubleTab& d3_amont_, DoubleTab& compteur_base_)
1631 cout <<
"base !!!!!!!!!!" << endl;
1636 const int nbulles_reelles = interfaces_->get_nb_bulles_reelles();
1637 const int nbulles_ghost = interfaces_->get_nb_bulles_ghost();
1638 const int nbulles_tot = nbulles_reelles + nbulles_ghost;
1640 d1_amont_.
resize(nbulles_tot, 3);
1641 d2_amont_.
resize(nbulles_tot, 3);
1642 d3_amont_.
resize(nbulles_tot, 3);
1643 compteur_base_.
resize(nbulles_tot, 1);
1644 compteur_base_ = 0.;
1649 v_amont_.
resize(nbulles_tot,3);
1651 w_amont_.
resize(nbulles_tot, 3);
1666 double normalisation = 1.;
1668 for (
int ib=0; ib < nbulles_tot; ib++)
1670 d1_amont_(ib,0) = 1.0;
1671 d1_amont_(ib,1) = 0.;
1672 d1_amont_(ib,2) = 0.;
1674 d2_amont_(ib,0) = 0.;
1675 d2_amont_(ib,1) = 1.0;
1676 d2_amont_(ib,2) = 0.;
1678 d3_amont_(ib,0) = 0.;
1679 d3_amont_(ib,1) = 0.;
1680 d3_amont_(ib,2) = 1.0;
1683 calculer_v_amont_bulle(vx,vy,vz,vx,vy,vz,v_amont_,w_amont_,d1_amont_,d2_amont_,d3_amont_,compteur_base_);
1685 compteur_base_ = 0.;
1690 compteur_base_ = 0.;
1692 for (
int ib = 0; ib < nbulles_tot; ib++)
1694 d1x = ubulles(ib,0)-v_amont_(ib,0);
1695 d1y = ubulles(ib,1)-v_amont_(ib,1);
1696 d1z = ubulles(ib,2)-v_amont_(ib,2);
1697 normalisation = sqrt(d1x*d1x + d1y*d1y + d1z*d1z)*1.0;
1698 d1x /= normalisation;
1699 d1y /= normalisation;
1700 d1z /= normalisation;
1704 normalisation = sqrt(d2x*d2x + d2y*d2y + d2z*d2z);
1705 d2x /= normalisation;
1706 d2z /= normalisation;
1709 d3y = -(d1x*d1x + d1z*d1z);
1711 normalisation = sqrt(d3x*d3x + d3y*d3y + d3z*d3z);
1712 d3x /= normalisation;
1713 d3y /= normalisation;
1714 d3z /= normalisation;
1716 d1_amont_(ib,0) += d1x;
1717 d1_amont_(ib,1) += d1y;
1718 d1_amont_(ib,2) += d1z;
1720 d2_amont_(ib,0) += d2x;
1721 d2_amont_(ib,1) += d2y;
1722 d2_amont_(ib,2) += d2z;
1724 d3_amont_(ib,0) += d3x;
1725 d3_amont_(ib,1) += d3y;
1726 d3_amont_(ib,2) += d3z;
1728 compteur_base_(ib,0) += 1;
1736 for (
int i = 0; i < nbulles_tot; i++)
1739 const double x = (compteur_base_(i,0) == 0.) ? 0. : 1. / compteur_base_(i,0);
1740 d1_amont_(i, 0) *= x;
1741 d1_amont_(i, 1) *= x;
1742 d1_amont_(i, 2) *= x;
1744 d2_amont_(i, 0) *= x;
1745 d2_amont_(i, 1) *= x;
1746 d2_amont_(i, 2) *= x;
1748 d3_amont_(i, 0) *= x;
1749 d3_amont_(i, 1) *= x;
1750 d3_amont_(i, 2) *= x;
1763 const int ni = vx.
ni();
1764 const int nj = vx.
nj();
1765 const int nk = vx.
nk();
1772 const int nbulles_reelles = interfaces_->get_nb_bulles_reelles();
1773 const int nbulles_ghost = interfaces_->get_nb_bulles_ghost();
1774 const int nbulles_tot = nbulles_reelles + nbulles_ghost;
1776 S.
resize(nbulles_tot, 3);
1779 ArrOfDouble volumes;
1780 DoubleTab centre_gravite;
1784 centre_gravite.
resize(nbulles_tot, 3);
1785 centre_gravite = 0.;
1799 interfaces_->calculer_volume_bulles(volumes,centre_gravite);
1802 centre_gravite.
resize(nbulles_tot, 3);
1806 for (
int ib = 0; ib < nbulles_tot; ib++)
1808 for (
int k_gamma = -klim; k_gamma <= klim; k_gamma++)
1810 for (
int k_beta = -klim; k_beta <= klim; k_beta++)
1813 y_point = centre_gravite(ib,1) + k_beta*1.0*dy;
1814 z_point = centre_gravite(ib,2) + k_gamma*1.0*dz;
1819 while ( (z_point >= Lz) || (z_point < 0) || (y_point >= Ly) || (y_point < 0) || (x_point >= Lx) || (x_point < 0) )
1821 if ( z_point >= Lz )
1843 i_point =
static_cast<int>( x_point/dx );
1844 j_point =
static_cast<int>( y_point/dy );
1845 k_point =
static_cast<int>( z_point/dz );
1860 S(ib,0) += nx*( 2*mu_l*(vx(i_local,j_local,k_local)-vx(i_local-1,j_local,k_local))/dx - p(i_local,j_local,k_local) )*dy*dz;
1861 S(ib,1) += nx*( mu_l*( (vx(i_local,j_local,k_local)-vx(i_local,j_local-1,k_local))/dy + (vy(i_local,j_local,k_local)-vy(i_local-1,j_local,k_local))/dx) )*dy*dz;
1862 S(ib,2) += nx*( mu_l*( (vx(i_local,j_local,k_local)-vx(i_local,j_local,k_local-1))/dz + (vz(i_local,j_local,k_local)-vz(i_local-1,j_local,k_local))/dx) )*dy*dz;
1881 const int ni = vx.
ni();
1882 const int nj = vx.
nj();
1883 const int nk = vx.
nk();
1890 const int nbulles_reelles = interfaces_->get_nb_bulles_reelles();
1891 const int nbulles_ghost = interfaces_->get_nb_bulles_ghost();
1892 const int nbulles_tot = nbulles_reelles + nbulles_ghost;
1894 S.
resize(nbulles_tot, 3);
1897 ArrOfDouble volumes;
1898 DoubleTab centre_gravite;
1902 centre_gravite.
resize(nbulles_tot, 3);
1903 centre_gravite = 0.;
1917 interfaces_->calculer_volume_bulles(volumes,centre_gravite);
1920 centre_gravite.
resize(nbulles_tot, 3);
1924 for (
int ib = 0; ib < nbulles_tot; ib++)
1926 for (
int k_gamma = -klim; k_gamma <= klim; k_gamma++)
1928 for (
int k_beta = -klim; k_beta <= klim; k_beta++)
1930 x_point = centre_gravite(ib,0) + k_beta*1.0*dx;
1932 z_point = centre_gravite(ib,2) + k_gamma*1.0*dz;
1937 while ( (z_point >= Lz) || (z_point < 0) || (y_point >= Ly) || (y_point < 0) || (x_point >= Lx) || (x_point < 0) )
1939 if ( z_point >= Lz )
1961 i_point =
static_cast<int>( x_point/dx );
1962 j_point =
static_cast<int>( y_point/dy );
1963 k_point =
static_cast<int>( z_point/dz );
1978 S(ib,0) += ny*( mu_l*( (vy(i_local,j_local,k_local)-vy(i_local-1,j_local,k_local))/dx + (vx(i_local,j_local,k_local)-vx(i_local,j_local-1,k_local))/dy) )*dx*dz;
1979 S(ib,1) += ny*( 2*mu_l*(vy(i_local,j_local,k_local)-vy(i_local,j_local-1,k_local))/dy - p(i_local,j_local,k_local) )*dx*dz;
1980 S(ib,2) += ny*( mu_l*( (vy(i_local,j_local,k_local)-vy(i_local,j_local,k_local-1))/dz + (vz(i_local,j_local,k_local)-vz(i_local,j_local-1,k_local))/dy) )*dx*dz;
1999 const int ni = vx.
ni();
2000 const int nj = vx.
nj();
2001 const int nk = vx.
nk();
2008 const int nbulles_reelles = interfaces_->get_nb_bulles_reelles();
2009 const int nbulles_ghost = interfaces_->get_nb_bulles_ghost();
2010 const int nbulles_tot = nbulles_reelles + nbulles_ghost;
2012 S.
resize(nbulles_tot, 3);
2015 ArrOfDouble volumes;
2016 DoubleTab centre_gravite;
2020 centre_gravite.
resize(nbulles_tot, 3);
2021 centre_gravite = 0.;
2035 interfaces_->calculer_volume_bulles(volumes,centre_gravite);
2038 centre_gravite.
resize(nbulles_tot, 3);
2042 for (
int ib = 0; ib < nbulles_tot; ib++)
2044 for (
int k_gamma = -klim; k_gamma <= klim; k_gamma++)
2046 for (
int k_beta = -klim; k_beta <= klim; k_beta++)
2048 x_point = centre_gravite(ib,0) + k_beta*1.0*dx;
2049 y_point = centre_gravite(ib,1) + k_gamma*1.0*dy;
2055 while ( (z_point >= Lz) || (z_point < 0) || (y_point >= Ly) || (y_point < 0) || (x_point >= Lx) || (x_point < 0) )
2057 if ( z_point >= Lz )
2079 i_point =
static_cast<int>( x_point/dx );
2080 j_point =
static_cast<int>( y_point/dy );
2081 k_point =
static_cast<int>( z_point/dz );
2096 S(ib,0) += nz*( mu_l*( (vz(i_local,j_local,k_local)-vz(i_local-1,j_local,k_local))/dx + (vx(i_local,j_local,k_local)-vx(i_local,j_local,k_local-1))/dz) )*dx*dy;
2097 S(ib,1) += nz*( mu_l*( (vz(i_local,j_local,k_local)-vz(i_local,j_local-1,k_local))/dy + (vy(i_local,j_local,k_local)-vy(i_local,j_local,k_local-1))/dz) )*dx*dy;
2098 S(ib,2) += nz*( 2*mu_l*(vz(i_local,j_local,k_local)-vz(i_local,j_local,k_local-1))/dz - p(i_local,j_local,k_local) )*dx*dy;
2117 const int ni = vx.
ni();
2118 const int nj = vx.
nj();
2119 const int nk = vx.
nk();
2124 const int nbulles_reelles = interfaces_->get_nb_bulles_reelles();
2125 const int nbulles_ghost = interfaces_->get_nb_bulles_ghost();
2126 const int nbulles_tot = nbulles_reelles + nbulles_ghost;
2128 S.
resize(nbulles_tot, 3);
2131 ArrOfDouble volumes;
2132 DoubleTab centre_gravite;
2136 centre_gravite.
resize(nbulles_tot, 3);
2137 centre_gravite = 0.;
2151 interfaces_->calculer_volume_bulles(volumes,centre_gravite);
2154 centre_gravite.
resize(nbulles_tot, 3);
2158 for (
int ib = 0; ib < nbulles_tot; ib++)
2160 for (
int k_gamma = -klim; k_gamma <= klim; k_gamma++)
2162 for (
int k_beta = -klim; k_beta <= klim; k_beta++)
2164 for (
int k_alpha = -klim; k_alpha <= klim; k_alpha++)
2166 x_point = centre_gravite(ib,0) + k_beta*1.0*dx;
2167 y_point = centre_gravite(ib,1) + k_gamma*1.0*dy;
2168 z_point = centre_gravite(ib,2) + k_alpha*1.0*dz;
2173 while ( (z_point >= Lz) || (z_point < 0) || (y_point >= Ly) || (y_point < 0) || (x_point >= Lx) || (x_point < 0) )
2175 if ( z_point >= Lz )
2197 i_point =
static_cast<int>( x_point/dx );
2198 j_point =
static_cast<int>( y_point/dy );
2199 k_point =
static_cast<int>( z_point/dz );
2214 S(ib,0) += rho_(i_local,j_local,k_local)*vx(i_local,j_local,k_local)*indica_(i_local,j_local,k_local)*dx*dy*dz;
2215 S(ib,1) += rho_(i_local,j_local,k_local)*vy(i_local,j_local,k_local)*indica_(i_local,j_local,k_local)*dx*dy*dz;
2216 S(ib,2) += rho_(i_local,j_local,k_local)*vz(i_local,j_local,k_local)*indica_(i_local,j_local,k_local)*dx*dy*dz;
2232 const int ni = vx.
ni();
2233 const int nj = vx.
nj();
2234 const int nk = vx.
nk();
2242 double alpha_l_moy = 0.;
2244 if (z_index == z_index_max)
2246 for (
int i = 0; i < ni; i++)
2248 for (
int j = 0; j < nj; j++)
2250 vx_moy += vx(i, j, nk - 1) * interfaces_->I(i, j, nk - 1);
2251 vy_moy += vy(i, j, nk - 1) * interfaces_->I(i, j, nk - 1);
2252 vz_moy += vz(i, j, nk - 1) * interfaces_->I(i, j, nk - 1);
2253 alpha_l_moy += interfaces_->I(i, j, nk - 1);
2262 vx_moy = vx_moy / alpha_l_moy;
2263 vy_moy = vy_moy / alpha_l_moy;
2264 vz_moy = vz_moy / alpha_l_moy;
2274 const int ni = vx.
ni();
2275 const int nj = vx.
nj();
2279 int z_index_min = 0;
2283 double alpha_l_moy = 0.;
2285 if (z_index == z_index_min)
2287 for (
int i = 0; i < ni; i++)
2289 for (
int j = 0; j < nj; j++)
2291 vx_moy += vx(i, j, 0) * interfaces_->I(i, j, 0);
2292 vy_moy += vy(i, j, 0) * interfaces_->I(i, j, 0);
2293 vz_moy += vz(i, j, 0) * interfaces_->I(i, j, 0);
2294 alpha_l_moy += interfaces_->I(i, j, 0);
2304 vx_moy = vx_moy / alpha_l_moy;
2305 vy_moy = vy_moy / alpha_l_moy;
2306 vz_moy = vz_moy / alpha_l_moy;
2310static double calculer_tau_wall(
const IJK_Field_double& vx,
const double mu_liquide)
2312 const int nj = vx.
nj();
2313 const int ni = vx.
ni();
2326 const ArrOfDouble& tab_dz=geom.
get_delta(DIRECTION_K);
2335 for (
int j = 0; j < nj; j++)
2336 for (
int i = 0; i < ni; i++)
2337 tauw += vx(i, j, 0);
2339 if (kmin + vx.
nk() == nktot)
2341 const int k = vx.
nk() - 1;
2342 for (
int j = 0; j < nj; j++)
2343 for (
int i = 0; i < ni; i++)
2344 tauw += vx(i, j, k);
2355 tauw /= (dz * n_mailles_plan_xy);
2361static void runge_kutta3_update_for_float(
const double dx,
double& store,
double& v,
const int step,
double dt_tot)
2363 const double coeff_a[3] = { 0., -5. / 9., -153. / 128. };
2365 const double coeff_Fk[3] = { 1., 4. / 9., 15. / 32. };
2367 const double facteurF = coeff_a[step];
2368 const double intermediate_dt = compute_fractionnal_timestep_rk3(dt_tot, step);
2369 const double delta_t_divided_by_Fk = intermediate_dt / coeff_Fk[step];
2376 v += x * delta_t_divided_by_Fk;
2380 x = store * facteurF + dx;
2382 v += x * delta_t_divided_by_Fk;
2386 x = store * facteurF + dx;
2387 v += x * delta_t_divided_by_Fk;
2390 Cerr <<
"Error in runge_kutta_update_for_float: wrong step" << finl;
2402 for (
int dir = 0; dir < 3; dir++)
2411 for (
int dir = 0; dir < 3; dir++)
2422 const int nb_reelles = interfaces_->get_nb_bulles_reelles();
2423 for (
int ib = 0; ib < nb_reelles; ib++)
2430 if (dir == 0 || dir == 1)
2449 double new_time = time;
2455 statistics().begin_count(STD_COUNTERS::source_terms,statistics().get_last_opened_counter_level()+1);
2457 double v_moy = calculer_v_moyen(vx);
2463 double rhov_moy = calculer_v_moyen(
rho_v_[direction_gravite]);
2465 double moy_rappel = 0.;
2473 moy_rappel = calculer_v_moyen(
force_rappel_[direction_gravite]) * vol_dom;
2477 double tauw = calculer_tau_wall(vx, mu_l);
2478 double derivee_acceleration = 0.;
2479 double derivee_facteur_sv = 0.;
2487 alv = 1. - calculer_v_moyen(interfaces_->I());
2492 double drho = rho_l - rho_v;
2493 double facv = 0., facl = 1.;
2494 if (std::fabs(alv * drho) > DMINFLOAT)
2496 facv = 1. / (alv * drho);
2497 facl = 1. / ((1. - alv) * drho);
2499 double ul = facl * (rhov_moy - rho_v * v_moy);
2500 double uv = facv * (rho_l * v_moy - rhov_moy);
2540 new_time += timestep;
2544 const double intermediate_dt = compute_fractionnal_timestep_rk3(timestep, rk_step);
2552 new_time += intermediate_dt;
2557 const double intermediate_dt = compute_fractionnal_timestep_rk3(timestep, rk_step);
2562 new_time += intermediate_dt;
2570 double fs0(0), fs1(0), fs2(0), psn(0);
2586 double ft0(0), ft1(0), ft2(0), atat(0), ftft(0), ptn(0);
2587 if (
forcage_.get_type_forcage() > 0)
2592 ft0 = calculer_v_moyen(scalar_fields_product(pb_ijk,
rho_field_,
forcage_.get_force_ph2()[0], 0));
2593 ft1 = calculer_v_moyen(scalar_fields_product(pb_ijk,
rho_field_,
forcage_.get_force_ph2()[1], 1));
2594 ft2 = calculer_v_moyen(scalar_fields_product(pb_ijk,
rho_field_,
forcage_.get_force_ph2()[2], 2));
2595 atat = calculer_v_moyen(scalar_product(pb_ijk,
forcage_.get_force_ph2(),
forcage_.get_force_ph2()));
2596 ftft = calculer_v_moyen(scalar_product(pb_ijk, scalar_times_vector(pb_ijk,
rho_field_,
forcage_.get_force_ph2()), scalar_times_vector(pb_ijk,
rho_field_,
forcage_.get_force_ph2())));
2609 Ouvrir_fichier(
"_acceleration.out",
2610 "1.tstep\t2.time\t3.Vx\t4.rhoVx\t5.tauw\t6.da/dt\t7.NewT\t8.acceleration\t9.fac_var_source\t10.qdm_source\t11.vap_velocity_tmoy_\t12.liq_velocity_tmoy_\t13.qdm_patch_correction_[0]\t14.qdm_patch_correction_[1]\t15.qdm_patch_correction_[2]\t16.F_sigma_moyen[0]\t17.F_sigma_moyen[1]\t18.F_sigma_moyen[2]\t19.y.F_sigma\t20.u.u\t21.F_THI[0]\t22.F_THI[1]\t23.F_THI[2]\t24.A_THI.A_THI\t25.F_THI.F_THI\t26.u.F_THI\t27.u.rho.u",
2621 fic <<
" " << moy_rappel;
2623 for (
int dir = 0; dir < 3; dir++)
2654 statistics().end_count(STD_COUNTERS::source_terms);
2657#ifdef COMPLEMENT_ANTI_DEVIATION_RESIDU
2659static double calculer_wall_difference(
const IJK_Field_double& vx)
2661 const int nj = vx.
nj();
2662 const int ni = vx.
ni();
2674 for (
int j = 0; j < nj; j++)
2675 for (
int i = 0; i < ni; i++)
2678 if (kmin + vx.
nk() == nktot)
2680 const int k = vx.
nk() - 1;
2681 for (
int j = 0; j < nj; j++)
2682 for (
int i = 0; i < ni; i++)
2689 x /= n_mailles_plan_xy;
2708 double new_time = time;
2714 statistics().begin_count(STD_COUNTERS::source_terms,statistics().get_last_opened_counter_level()+1);
2716 double v_moy = calculer_v_moyen(vz);
2721 double rhov_moy = calculer_v_moyen(
rho_v_[2]);
2723 double moy_rappel = 0.;
2735 double tauw = calculer_tau_wall(vz, mu_l);
2736 double derivee_acceleration = 0.;
2737 double derivee_facteur_sv = 0.;
2745 alv = 1. - calculer_v_moyen(interfaces_->I());
2750 double drho = rho_l - rho_v;
2751 double facv = 0., facl = 1.;
2752 if (std::fabs(alv * drho) > DMINFLOAT)
2754 facv = 1. / (alv * drho);
2755 facl = 1. / ((1. - alv) * drho);
2757 double ul = facl * (rhov_moy - rho_v * v_moy);
2758 double uv = facv * (rho_l * v_moy - rhov_moy);
2798 new_time += timestep;
2802 const double intermediate_dt = compute_fractionnal_timestep_rk3(timestep, rk_step);
2810 new_time += intermediate_dt;
2815 const double intermediate_dt = compute_fractionnal_timestep_rk3(timestep, rk_step);
2820 new_time += intermediate_dt;
2828 double fs0(0), fs1(0), fs2(0), psn(0);
2844 double ft0(0), ft1(0), ft2(0), atat(0), ftft(0), ptn(0);
2845 if (
forcage_.get_type_forcage() > 0)
2850 ft0 = calculer_v_moyen(scalar_fields_product(pb_ijk,
rho_field_,
forcage_.get_force_ph2()[0], 0));
2851 ft1 = calculer_v_moyen(scalar_fields_product(pb_ijk,
rho_field_,
forcage_.get_force_ph2()[1], 1));
2852 ft2 = calculer_v_moyen(scalar_fields_product(pb_ijk,
rho_field_,
forcage_.get_force_ph2()[2], 2));
2853 atat = calculer_v_moyen(scalar_product(pb_ijk,
forcage_.get_force_ph2(),
forcage_.get_force_ph2()));
2854 ftft = calculer_v_moyen(scalar_product(pb_ijk, scalar_times_vector(pb_ijk,
rho_field_,
forcage_.get_force_ph2()), scalar_times_vector(pb_ijk,
rho_field_,
forcage_.get_force_ph2())));
2867 Ouvrir_fichier(
"_acceleration.out",
2868 "1.tstep\t2.time\t3.Vx\t4.rhoVx\t5.tauw\t6.da/dt\t7.NewT\t8.acceleration\t9.fac_var_source\t10.qdm_source\t11.vap_velocity_tmoy_\t12.liq_velocity_tmoy_\t13.qdm_patch_correction_[0]\t14.qdm_patch_correction_[1]\t15.qdm_patch_correction_[2]\t16.F_sigma_moyen[0]\t17.F_sigma_moyen[1]\t18.F_sigma_moyen[2]\t19.y.F_sigma\t20.u.u\t21.F_THI[0]\t22.F_THI[1]\t23.F_THI[2]\t24.A_THI.A_THI\t25.F_THI.F_THI\t26.u.F_THI\t27.u.rho.u",
2879 fic <<
" " << moy_rappel;
2881 for (
int dir = 0; dir < 3; dir++)
2912 statistics().end_count(STD_COUNTERS::source_terms);
2922 double vol_cell = 1., vol_NS = 1., vol_gaz = 0.;
2924 for (
int direction = 0; direction < 3; direction++)
2932 const int nbulles = interfaces_->get_nb_bulles_reelles();
2935 interfaces_->calculer_volume_bulles(volume, position);
2937 position.
resize(nbulles, 3);
2938 for (
int ib = 0; ib < nbulles; ib++)
2939 vol_gaz += volume[ib];
2942 Vecteur3 force_tot, force_theo, rhov_moy, tauw;
2944#ifdef COMPLEMENT_ANTI_DEVIATION_RESIDU
2945 double moins_delta_Pwall_sur_h = 0.;
2951 const double drho_alpha = -(rho_l - rho_v) * vol_gaz / vol_NS;
2953 double fractional_dt;
2957 fractional_dt = compute_fractionnal_timestep_rk3(timestep , rk_step);
2960 fractional_dt = timestep;
2963 for (
int direction = 0; direction < 3; direction++)
2965 if (direction != DIRECTION_K)
2968 tauw[direction] = calculer_tau_wall(
velocity_[direction], mu_l);
2969#ifdef COMPLEMENT_ANTI_DEVIATION_RESIDU
2975 tauw[direction] = calculer_tau_wall(
velocity_[direction], mu_l);
2978 tauw[direction] *= 2.;
2982 moins_delta_Pwall_sur_h = -calculer_wall_difference(
pressure_) * un_sur_h;
2986 if (interfaces_->is_terme_gravite_rhog())
2987 force_theo[direction] = 0.;
2991 rhov_moy[direction] = calculer_v_moyen(
rho_v_[direction]);
2992 acc[direction] = (rhov_moy[direction] -
store_rhov_moy_[direction]) / fractional_dt;
2999 tauw[direction] *= -un_sur_h;
3014 for (
int dir = 0; dir < 3; dir++)
3024 if (interfaces_->is_terme_gravite_rhog())
3034 int reset = (!pb_ijk.
get_reprise()) && (tstep == 0);
3035 SFichier fic = Ouvrir_fichier(
"_bilan_qdm.out",
"tstep\ttime\tFs_theo\tFtot\trhov\ttauw\tS\tacceleration\tres\tcumul_res\tCorrFs\nConvection\tDiffusion\tPression\n# Forces have 3 components.",
3039 fic << force_tot[0] <<
" " << force_tot[1] <<
" ";
3040 fic << force_tot[2] <<
" " << rhov_moy[0] <<
" " << rhov_moy[1] <<
" " << rhov_moy[2] <<
" " << tauw[0] <<
" ";
3041 fic << tauw[1] <<
" " << tauw[2] <<
" ";
3043 fic << acc[0] <<
" " << acc[1] <<
" " << acc[2] <<
" " << residu[0] <<
" " << residu[1] <<
" ";
3054#ifdef COMPLEMENT_ANTI_DEVIATION_RESIDU
3055 fic << moins_delta_Pwall_sur_h <<
" ";
3085 double volume_cell_uniforme = 1.;
3086 for (
int i = 0; i < 3; i++)
3089 for (
int dir = 0; dir < 3; dir++)
3119 rho_v_[0].echange_espace_virtuel(2);
3120 rho_v_[1].echange_espace_virtuel(2);
3121 rho_v_[2].echange_espace_virtuel(2);
3138 rho_v_[0].echange_espace_virtuel(2);
3139 rho_v_[1].echange_espace_virtuel(2);
3140 rho_v_[2].echange_espace_virtuel(2);
3146 Cerr <<
"Unknown velocity convection type! " << finl;
3156 for (
int dir = 0; dir < 3; dir++)
3198 for (
int dir = 0; dir < 3; dir++)
3237 for (
int i = 0; i < 3; i++)
3247 for (
int i = 0; i < 3; i++)
3250 Cerr <<
"This methods does not support variable DZ yet... Contact trust support. ";
3252 const double volume = get_channel_control_volume(dv, k, delta_z_local_);
3255 Cout <<
"BF add_gradient_times_constant" << finl;
3261 for (
int dir_press = 0; dir_press < 3; dir_press++)
3263 Cout <<
"AF add_gradient_times_constant" << finl;
3275 for (
int dir = 0; dir < 3; dir++)
3286 for (
int dir = 0; dir < 3; dir++)
3300 for (
int dir = 0; dir < 3; dir++)
3314 for (
int dir = 0; dir < 3; dir++)
3324 for (
int k = 0; k < kmax; k++)
3329 Cerr <<
"Je ne sais pas si inv_rho_field_ est a jour ici. A Verifier avant de l'activer." << finl;
3368 const double delta_t = compute_fractionnal_timestep_rk3(sch_timestep , rk_step);
3371 for (
int j = 0; j < jmax; j++)
3372 for (
int i = 0; i < imax; i++)
3394 ArrOfDouble acc_mrf;
3398 if (
Kp_ != 0. ||
Kd_ != 0.)
3406 acc_mrf[0] = ax_PID;
3407 acc_mrf[1] = ay_PID;
3408 acc_mrf[2] = az_PID;
3411 for (
int dir = 0; dir < 3; dir++)
3418 const int ni = dv.
ni();
3419 const int nj = dv.
nj();
3436 for (
int i = 0; i < 3; i++)
3446 for (
int k = 0; k < kmax; k++)
3453 const double f = force_volumique * volume;
3456 for (
int j = 0; j < nj; j++)
3457 for (
int i = 0; i < ni; i++)
3462 for (
int j = 0; j < nj; j++)
3463 for (
int i = 0; i < ni; i++)
3472 if (
Kp_ != 0. ||
Kd_ != 0.)
3474 for (
int j = 0; j < nj; j++)
3475 for (
int i = 0; i < ni; i++)
3476 dv(i, j, k) += acc_mrf[dir];
3487 if (pb_ijk.
has_interface() && interfaces_->is_terme_gravite_rhog())
3490 for (
int j = 0; j < nj; j++)
3491 for (
int i = 0; i < ni; i++)
3499 for (
int dir2 = 0; dir2 < 3; dir2++)
3504 for (
int k2 = 0; k2 < kmax2; k2++)
3505 for (
int j = 0; j < jmax; j++)
3506 for (
int i = 0; i < imax; i++)
3540 if (
forcage_.get_type_forcage() > 0)
3546 const double intermediate_dt = compute_fractionnal_timestep_rk3(sch_timestep, rk_step);
3552 Cout <<
"G bilan qdm " << finl;
3568 double integration_time = max_ijk(
probleme_ijk().get_post().integrated_timescale());
3569 integration_time=std::max(1.,integration_time);
3576 if (interfaces_->get_forcing_method())
3582 for (
int k = 0; k < kmax; k++)
3583 for (
int j = 0; j < nj; j++)
3584 for (
int i = 0; i < ni; i++)
3606 for (
int dir = 0; dir < 3; dir++)
3640 double accurate_current_time = 0.0;
3646 SFichier fic_test=Ouvrir_fichier(
"_check_etapes_et_termes.out",
3647 "tstep\tcurrent_time\trk_step"
3648 "\trho_u_euler_av_prediction\trho_du_euler_ap_prediction"
3649 "\trho_u_euler_ap_projection\trho_du_euler_ap_projection"
3650 "\trho_u_euler_av_rho_mu_ind\trho_u_euler_ap_rho_mu_ind"
3651 "\tu_euler_ap_rho_mu_ind"
3652 "\ttemre_interfaces\tterme_convection\tterme_diffusion"
3653 "\tterme_pression_bis\tterme_pression_ter"
3654 "\tterme_interfaces_bf_mass_solver_bis\tterme_interfaces_bf_mass_solver\tterme_interfaces_bf_mass_solver"
3655 "\tpression_ap_proj"
3657 "\tterme_moyen_convection_mass_solver"
3658 "\tterme_moyen_diffusion_mass_solver"
3659 "\n# Forces have 3 components.",
3664 Cout <<
"check etapes et termes" << finl;
3666 fic_test << rk_step <<
" ";
3730 Cout <<
"check etapes et termes fini" << finl;
3738 const double current_time,
const Domaine_IJK& my_splitting)
3741 statistics().create_custom_counter(
"m2",2,
"TrioCFD");
3742 statistics().create_custom_counter(
"m3",2,
"TrioCFD");
3743 statistics().begin_count(
"m2",statistics().get_last_opened_counter_level()+1);
3744 if (
forcage_.get_forced_advection() == -1)
3746 ArrOfDouble mean_u_liq;
3748 for (
int dir = 0; dir < 3; dir++)
3750 forcage_.update_advection_velocity(mean_u_liq);
3752 if (
forcage_.get_forced_advection() != 0)
3754 Cout <<
"forced_advection" <<
forcage_.get_forced_advection() << finl;
3755 Cout <<
"BF : update_advection_length" << finl;
3756 forcage_.update_advection_length(dt);
3757 Cout <<
"AF : update_advection_length" << finl;
3761 statistics().end_count(
"m2");
3762 statistics().begin_count(
"m3",statistics().get_last_opened_counter_level()+1);
3764 const IJK_Field_vector3_double& force =
forcage_.get_force_ph2();
3765 for (
int dir = 0; dir < 3; dir++)
3772 for (
int k = 0; k < kmax + 1; k++)
3773 for (
int j = 0; j < nj + 1; j++)
3774 for (
int i = 0; i < ni + 1; i++)
3779 const double inv_cell_mass = 1.;
3781 velocity_[dir](i, j, k) += force[dir](i, j, k) * inv_cell_mass * dt;
3784 statistics().end_count(
"m3");
3788 const double current_time,
const Domaine_IJK& my_splitting,
const int facteur)
3791 if (
forcage_.get_forced_advection() == -1)
3794 ArrOfDouble mean_u_liq;
3796 for (
int dir = 0; dir < 3; dir++)
3803 forcage_.update_advection_velocity(mean_u_liq);
3806 if (
forcage_.get_forced_advection() != 0)
3807 forcage_.update_advection_length(dt);
3814 const IJK_Field_vector3_double& force =
forcage_.get_force_ph2();
3816 for (
int dir = 0; dir < 3; dir++)
3826 for (
int k = 0; k < kmax; k++)
3827 for (
int j = 0; j < nj; j++)
3828 for (
int i = 0; i < ni; i++)
3837 else if (facteur == 1)
3839 for (
int k = 0; k < kmax; k++)
3840 for (
int j = 0; j < nj; j++)
3841 for (
int i = 0; i < ni; i++)
3846 d_velocity_[dir](i, j, k) += force[dir](i, j, k) * interfaces_->I(i, j, k);
3850 else if (facteur == 2)
3853 for (
int k = 0; k < kmax; k++)
3854 for (
int j = 0; j < nj; j++)
3855 for (
int i = 0; i < ni; i++)
3865 Cout <<
"end of from_spect_to_phys_opti2_advection" << finl;
3874 const int ni = vx.
ni();
3875 const int nj = vx.
nj();
3876 const int nk = vx.
nk();
3880 for (
int k = 0; k < nk; k++)
3881 for (
int j = 0; j < nj; j++)
3882 for (
int i = 0; i < ni; i++)
3883 v_moy += vx(i, j, k) * interfaces_->I(i, j, k);
3890 v_moy /= n_mailles_tot;
3892 const int offset = splitting.get_offset_local(DIRECTION_K);
3893 const ArrOfDouble& tab_dz=geom.
get_delta(DIRECTION_K);
3894 for (
int k = 0; k < nk; k++)
3896 const double dz = tab_dz[k+offset];
3897 for (
int j = 0; j < nj; j++)
3898 for (
int i = 0; i < ni; i++)
3899 v_moy += vx(i,j,k)*dz;
3918 double alpha_l = calculer_v_moyen(interfaces_->I());
3919 double rho_moyen = calculer_v_moyen(
rho_field_);
3922 for (
int dir = 0; dir < 3; dir++)
3925 double rho_vel_moyen = calculer_v_moyen(
rho_v_[dir]);
3927 Cout <<
"qdm_corrections_.get_need_for_vitesse_relative(" << dir <<
")" <<
qdm_corrections_.get_need_for_vitesse_relative(dir) << finl;
3938 if (
qdm_corrections_.get_need_to_compute_correction_value_one_direction(dir))
3940 for (
int k = 0; k < vel.
nk(); ++k)
3941 for (
int j = 0; j < vel.
nj(); ++j)
3942 for (
int i = 0; i < vel.
ni(); ++i)
3944 qdm_corrections_.compute_correct_velocity_one_direction(dir, vel(i, j, k));
3949 Cout <<
"AF : compute_and_add_qdm_corrections" << finl;
3958 double alpha_liq = calculer_v_moyen(interfaces_->I());
3959 return alpha_liq_vx_liq / alpha_liq;
3966 double alpha_vap = 1 - calculer_v_moyen(interfaces_->I());
3967 return alpha_vap_vx_vap / alpha_vap;
3975 const int ni = vx.
ni();
3976 const int nj = vx.
nj();
3977 const int nk = vx.
nk();
3981 for (
int k = 0; k < nk; k++)
3982 for (
int j = 0; j < nj; j++)
3983 for (
int i = 0; i < ni; i++)
3984 v_moy += vx(i, j, k) * (1 - interfaces_->I(i, j, k));
3991 v_moy /= n_mailles_tot;
3993 const int offset = splitting.get_offset_local(DIRECTION_K);
3994 const ArrOfDouble& tab_dz=geom.
get_delta(DIRECTION_K);
3995 for (
int k = 0; k < nk; k++)
3997 const double dz = tab_dz[k+offset];
3998 for (
int j = 0; j < nj; j++)
3999 for (
int i = 0; i < ni; i++)
4000 v_moy += vx(i,j,k)*dz;
4016 const int imax = dv.
ni();
4017 const int jmax = dv.
nj();
4018 for (
int j = 0; j < jmax; j++)
4019 for (
int i = 0; i < imax; i++)
4020 dv(i, j, k_index) += constant;
4036 double alpha_l = 1.;
4040 for (
int dir=0; dir<3; dir++)
4043 double rho_vel_moyen = calculer_v_moyen(
rho_v_[dir]);
4045 Cout <<
"qdm_corrections_.get_need_for_vitesse_relative("<<dir<<
")" <<
qdm_corrections_.get_need_for_vitesse_relative(dir)<< finl;
4056 if (
qdm_corrections_.get_need_to_compute_correction_value_one_direction(dir))
4058 for (
int k=0; k<vel.
nk(); k++)
4059 for (
int j=0; j<vel.
nj(); j++)
4060 for (
int i=0; i<vel.
ni(); i++)
4066 Cout <<
"AF : compute_and_add_qdm_corrections_monophasic" << finl;
4069static int decoder_numero_bulle(
const int code)
4071 const int num_bulle = code >>6;
4079 ArrOfDouble volume_reel;
4081 interfaces_->calculer_volume_bulles(volume_reel, position);
4082 const int nb_reelles = interfaces_->get_nb_bulles_reelles();
4083 for (
int ib = 0; ib < nb_reelles; ib++)
4084 var_volume_par_bulle[ib] = volume_reel[ib] -
vol_bulles_[ib];
4086 for (
int i = 0; i < interfaces_->get_nb_bulles_ghost(0 ); i++)
4088 const int ighost = interfaces_->ghost_compo_converter(i);
4089 const int ibulle_reelle = decoder_numero_bulle(-ighost);
4091 var_volume_par_bulle[nb_reelles + i] = volume_reel[nb_reelles+ i] -
vol_bulles_[ibulle_reelle];
4100 ArrOfDouble volume_reel;
4102 interfaces_->calculer_volume_bulles(volume_reel, position);
4103 const int nb_reelles = interfaces_->get_nb_bulles_reelles();
4105 for (
int ib = 0; ib < nb_reelles; ib++)
4107 var_volume_par_bulle[ib] = 0.;
4111 for (
int i = 0; i < interfaces_->get_nb_bulles_ghost(0 ); i++)
4113 const int ighost = interfaces_->ghost_compo_converter(i);
4114 const int ibulle_reelle = decoder_numero_bulle(-ighost);
4116 var_volume_par_bulle[nb_reelles + i] = 0.;
4117 vol_bulles_[ibulle_reelle] = volume_reel[nb_reelles+ i];
4137 SFichier fic=Ouvrir_fichier(
"_qdm_correction.out",
4138 "1.iteration\t2.time\t3.qdm_cible[0]\t4.qdm_cible[1]\t5.qdm_cible[2]\t6.velocity_correction[0]\t7.velocity_correction[1]\t8.velocity_correction[2]\t9.qdm[0]\t10.qdm[1]\t11.qdm[2]",
4144 fic << qdm_cible[0] <<
" ";
4145 fic << qdm_cible[1] <<
" ";
4146 fic << qdm_cible[2] <<
" ";
4148 fic << velocity_correction[0] <<
" ";
4149 fic << velocity_correction[1] <<
" ";
4150 fic << velocity_correction[2] <<
" ";
4152 fic << rho_vel[0] <<
" ";
4153 fic << rho_vel[1] <<
" ";
4154 fic << rho_vel[2] <<
" ";
4167 IJK_Field_vector3_double champ;
4168 allocate_velocity(champ,
probleme_ijk().domaine_ijk(), 1);
4172 for (
int dir = 0; dir < 3; dir++)
4174 champ[dir].data() = 0.;
4176 champ[dir].echange_espace_virtuel(1);
4178 add_gradient_times_constant_over_rho(pression, rho, 1. , champ[0], champ[1], champ[2]);
4179 for (
int dir = 0; dir < 3; dir++)
4182 champ[dir].echange_espace_virtuel(1);
4185 for (
int dir = 0; dir < 3; dir++)
4186 resu[dir] = calculer_v_moyen(champ[dir]);
4193 IJK_Field_vector3_double champ;
4194 allocate_velocity(champ,
probleme_ijk().domaine_ijk(), 1);
4198 for (
int dir = 0; dir < 3; dir++)
4200 champ[dir].data() = 0.;
4202 champ[dir].echange_espace_virtuel(1);
4204 add_gradient_times_constant(pression, 1. , champ[0], champ[1], champ[2]);
4205 for (
int dir = 0; dir < 3; dir++)
4208 champ[dir].echange_espace_virtuel(1);
4210 for (
int dir = 0; dir < 3; dir++)
4211 resu[dir] = calculer_v_moyen(champ[dir]);
4221 IJK_Field_vector3_double champ;
4222 allocate_velocity(champ,
probleme_ijk().domaine_ijk(), 1);
4226 for (
int dir = 0; dir < 3; dir++)
4228 champ[dir].data() = 0.;
4230 champ[dir].echange_espace_virtuel(1);
4232 add_gradient_times_constant_over_rho(pression,
rho_field_, 1. , champ[0], champ[1], champ[2]);
4233 for (
int dir = 0; dir < 3; dir++)
4236 champ[dir].echange_espace_virtuel(1);
4238 for (
int dir = 0; dir < 3; dir++)
4239 resu[dir] = calculer_v_moyen(champ[dir]);
4247 const int imax = v.
ni();
4248 const int jmax = v.
nj();
4249 for (
int j = 0; j < jmax; j++)
4250 for (
int i = 0; i < imax; i++)
4252 double x = dv(i, j, k_layer);
4253 v(i, j, k_layer) += x * delta_t;
4286 Cout <<
"rk3ss: rk_step " << rk_step << finl;
4289#ifdef PROJECTION_DE_LINCREMENT_DV
4304 for (
int dir = 0; dir < 3; dir++)
4307 for (
int k = 0; k < kmax; k++)
4311#ifdef PROJECTION_DE_LINCREMENT_DV
4316 for (
int k = 0; k < kmax; k++)
4319 pressure_ , rk_step, k, total_timestep);
4340 force_upstream_velocity_shear_perio(
velocity_[0],
velocity_[1],
velocity_[2],
vitesse_upstream_, interfaces_,
nb_diam_upstream_,
boundary_conditions_,
nb_diam_ortho_shear_perio_, vx, vy,
4349#ifdef PROJECTION_DE_LINCREMENT_DV
4358 Cerr <<
"L'option include_pressure_gradient_in_ustar n'est pas encore implementee en RK3." << finl;
4364 Cerr <<
"Methode incremental pour le grad(P)" << finl;
4365 Cerr <<
" Option codee uniquement pour le sch_euler... Tester et implementer si besoiN. " << finl;
4373#ifdef PROJECTION_DE_LINCREMENT_DV
4411 for (
int dir = 0; dir < 3; dir++)
4422 for (
int dir = 0; dir < 3; dir++)
4425#ifdef PROJECTION_DE_LINCREMENT_DV
4442 for (
int k = 0; k < kmax; k++)
4448 for (
int dir = 0; dir < 3; dir++)
4451 for (
int k = 0; k < kmax; k++)
4463 for (
int dir = 0; dir < 3; dir++)
4470 for (
int dir = 0; dir < 3; dir++)
4504 const DoubleTab& rising_vector = interfaces_->get_ijk_compo_connex().get_rising_vectors();
4505 const double velocity_magnitude = interfaces_->get_ijk_compo_connex().get_rising_velocities()[0];
4506 const Vecteur3& velocity_vector = interfaces_->get_ijk_compo_connex().get_rising_velocity_overall();
4532 Cerr <<
"Velocity magnitude: " << velocity_magnitude << finl;
4533 Cerr <<
"Velocity dir upstream: " << rising_vector(0, dir) << finl;
4536 Cerr <<
"Force upstream velocity" << finl;
4556#ifdef PROJECTION_DE_LINCREMENT_DV
4565 Cerr <<
"Methode incrementale pour le grad(P)" << finl;
4566 Cerr <<
"Initialisation du d_pressure_ conservee depuis le pas de temps precedent... " << finl;
4567 Cerr <<
"Ce n'est probablement pas optimal. QQ idees dans les sources si divergence . " << finl;
4585#ifdef PROJECTION_DE_LINCREMENT_DV
4593 for (
int dir = 0; dir < 3; dir++)
4596 for (
int k = 0; k < kmax; k++)
4600 Cerr <<
" Un exit pour voir avec gdb... " << finl;
4601 Cerr <<
" Si ca fonctionne, faire le meme en RK3... " << finl;
4610#ifdef PROJECTION_DE_LINCREMENT_DV
4628 Cerr <<
"Copy pressure on extended field for probes" << finl;
4648 Cout <<
"qdm_corrections_.is_type_none() : " <<
qdm_corrections_.is_type_none() << finl;
4663 for (
int dir = 0; dir < 3; dir++)
4665 VECT(IntTab) map(3);
4669 for (
int dir2 = 0; dir2 < 3; dir2++)
4674 map[dir2].resize(1,3);
4681 map[dir2].resize(3,3);
4684 map[dir2](0,1) = n_ext;
4687 map[dir2](1,0) = n - n_ext;
4689 map[dir2](1,2) = n_ext;
4692 map[dir2](2,1) = n + n_ext;
4693 map[dir2](2,2) = n_ext;
4698 for (
int dir2 = 0; dir2 < 3; dir2++)
4703 map[dir2].resize(1,3);
4710 map[dir2].resize(1,3);
4712 map[dir2](0,0) = n_ext;
4722 VECT(IntTab) map(3);
4726 for (
int dir2 = 0; dir2 < 3; dir2++)
4731 map[dir2].resize(1,3);
4738 map[dir2].resize(3,3);
4741 map[dir2](0,1) = n_ext;
4744 map[dir2](1,0) = n - n_ext;
4746 map[dir2](1,2) = n_ext;
4749 map[dir2](2,1) = n + n_ext;
4750 map[dir2](2,2) = n_ext;
4756 for (
int dir2 = 0; dir2 < 3; dir2++)
4761 map[dir2].resize(1,3);
4768 map[dir2].resize(1,3);
4770 map[dir2](0,0) = n_ext;
4777 for (
int dir2 = 0; dir2 < 3; dir2++)
4779 const int ghost_a_redistribute = 2 ;
4784 map[dir2].resize(1,3);
4786 map[dir2](0,0) = n_ext-ghost_a_redistribute;
4788 map[dir2](0,2) = ghost_a_redistribute*2;
4792 map[dir2].resize(1,3);
4793 map[dir2](0,0) = n_ext;
4801 for (
int dir2 = 0; dir2 < 3; dir2++)
4803 const int ghost_a_redistribute = 2 ;
4809 map[dir2].resize(1,3);
4811 map[dir2](0,0) = n_ft - n_ext - ghost_a_redistribute;
4812 map[dir2](0,1) = n - 2*ghost_a_redistribute;
4813 map[dir2](0,2) = ghost_a_redistribute*2;
4817 map[dir2].resize(1,3);
4818 map[dir2](0,0) = n_ext;
4834 for (
int dir = 0; dir < 3; dir++)
4845 for (
int dir = 0; dir < 3; dir++)
4867 timestep, var_volume_par_bulle, rk_step);
4883 timestep, var_volume_par_bulle, rk_step);
4907 rho_field_.get_shear_BC_helpler().set_indicatrice_ghost_zmin_(
I_ns_, 0);
4918 interfaces_->calculer_kappa_ft(
kappa_ft_);
4939 timestep, var_volume_par_bulle, rk_step, first_step_interface_smoothing);
4958 interfaces_->supprimer_duplicata_bulles();
4963 timestep, var_volume_par_bulle, rk_step, first_step_interface_smoothing);
4968 interfaces_->transferer_bulle_perio();
4969 interfaces_->creer_duplicata_bulles();
4983 <<
" fichier_reprise_vitesse " << basename(lataname) <<
"\n";
4984 fichier <<
" timestep_reprise_vitesse 1" <<
"\n";
4986 fichier <<
" interfaces " << interfaces_.valeur() <<
"\n";
4987 fichier <<
" forcage " <<
forcage_ <<
"\n"
DoubleTab & valeurs() override
Surcharge Champ_base::valeurs() Renvoie le tableau des valeurs.
This class encapsulates all the information related to the eulerian mesh for TrioIJK.
void set_extension_from_bulle_param(double vol_bulle, double diam_bulle)
int get_offset_local(int direction) const
Returns the local offset in requested direction.
int get_nb_elem_local(int direction) const
Returns the number of elements owned by this processor in the given direction.
bool get_periodic_flag(int direction) const
Method returns true if periodic in this direction.
double get_domain_length(int direction) const
Returns the length of the entire domain in requested direction.
int get_nprocessor_per_direction(int direction) const
Returns the number of slices in the given direction.
double get_constant_delta(int direction) const
Returns the size of cells in a direction.
const ArrOfDouble & get_delta(int direction) const
Returns the array of mesh cell sizes in requested direction.
int get_nb_items_global(Localisation loc, int direction) const
Returns the number of local items (on this processor) for the given localisation in the requested dir...
int get_nb_elem_tot(int direction) const
Returns the total (global) number of mesh cells in requested direction.
int get_local_slice_index(int direction) const
Returns the position of the local subdomain in the requested direction.
Localisation
Localisation sub class.
Class defining operators and methods for all reading operation in an input flow (file,...
classe Equation_base Le role d'une equation est le calcul d'un ou plusieurs champs....
const Nom & le_nom() const override
Renvoie le nom de l'equation.
Probleme_base & probleme()
Renvoie le probleme associe a l'equation.
double get_mu_vapour() const
double get_delta_rho() const
int get_direction_gravite() const
double get_rho_vapour() const
double get_mu_liquid() const
double get_rho_liquid() const
Domaine_IJK::Localisation get_localisation() const
const Domaine_IJK & get_domaine() const
static double rho_vap_ref_for_poisson_
static double rho_liq_ref_for_poisson_
static double shear_x_time_
classe Milieu_base Cette classe est la base de la hierarchie des milieux (physiques)
virtual const Champ_Don_base & gravite() const
Renvoie la gravite du milieu si elle a ete associe provoque une erreur sinon.
Une chaine de caractere (Nom) en majuscules.
int contient_(const char *const ch) const
double velocity_bubble_integral_err_
FixedVector< Redistribute_Field, 3 > redistribute_to_splitting_ft_faces_
Parser parser_derivee_acceleration_
Vecteur3 terme_pression_ter_
Vecteur3 calculer_grad_p_moyen(const IJK_Field_double &pression)
Vecteur3 terme_interfaces_bf_mass_solver_bis_
void set_time_for_corrections()
bool has_champ(const Motcle &nom) const override
IJK_Field_vector3_double force_rappel_ft_
Vecteur3 rho_du_euler_ap_prediction_
IJK_Field_vector3_double rho_u_euler_av_rho_mu_ind_champ_
double vap_velocity_tmoy_
Fluide_Diphasique_IJK & milieu_ijk()
void calculer_vitesse_ft()
IJK_Field_double inv_rho_field_
double calculer_true_moyenne_de_phase_vap(const IJK_Field_double &vx)
void initialise_velocity_from_file(const Nom &fichier_reprise_vitesse)
void calculer_terme_source_acceleration(IJK_Field_double &vx, const double time, const double timestep, const int rk_step)
void create_forced_dilation()
IJK_Field_vector3_double rho_u_euler_ap_projection_champ_
Vecteur3 rho_u_euler_av_rho_mu_ind_
bool harmonic_nu_in_diff_operator_
Redistribute_Field redistribute_from_splitting_ft_elem_ghostz_min_
IJK_Field_double pressure_rhs_
@ non_conservative_simple
IJK_Field_vector3_double terme_repulsion_interfaces_ft_
void maj_indicatrice_rho_mu(const bool parcourir=true)
bool use_inv_rho_in_poisson_solver_
bool include_pressure_gradient_in_ustar_
IJK_Field_vector3_double velocity_
Vecteur3 rho_u_euler_ap_projection_
void compute_and_add_qdm_corrections()
Probleme_FTD_IJK_base & probleme_ijk()
IJK_Field_vector3_double terme_pression_in_ustar_local_
bool use_harmonic_viscosity_
double facteur_variable_source_
Vecteur3 terme_interfaces_bf_mass_solver_
IJK_Field_double pressure_
IJK_Field_vector3_double variable_source_
IJK_Field_double potential_phi_
double nb_diam_ortho_shear_perio_
IJK_Field_double kappa_ns_
double velocity_bubble_new_
Vecteur3 rho_u_euler_av_prediction_
Noms expression_vitesse_initiale_
IJK_Field_vector3_double terme_diffusion_mass_solver_
bool test_etapes_et_bilan_
const IJK_Field_double & get_IJK_field(const Motcle &nom) override
Boundary_Conditions boundary_conditions_
int stencil_vitesse_entree_
FixedVector< Redistribute_Field, 3 > redistribute_from_splitting_ft_faces_
IJK_Field_double RK3_F_pressure_
IJK_Field_vector3_double rho_u_euler_av_prediction_champ_
IJK_Field_vector3_double terme_repulsion_interfaces_ns_
double vol_bulle_monodisperse_
DoubleTab centre_gravite_bulles_
Multigrille_Adrien poisson_solver_
IJK_Field_double kappa_ft_
bool correction_semi_locale_volume_bulle_
void initialise_ns_fields()
IJK_Field_double rho_field_
int vitesse_entree_compo_to_force_
IJK_Field_vector3_double terme_source_interfaces_ns_
Vecteur3 terme_moyen_convection_mass_solver_
bool disable_convection_qdm_
void rk3_sub_step(const int rk_step, const double total_timestep, const double fractionnal_timestep, const double time)
Vecteur3 integrated_residu_
bool diffusion_alternative_
bool harmonic_nu_in_calc_with_indicatrice_
void calculer_terme_volumique(const IJK_Field_double &vx, const IJK_Field_double &vy, const IJK_Field_double &vz, const IJK_Field_double &rho_, const IJK_Field_double &indica_, DoubleTab &S)
Vecteur3 terme_interfaces_conv_diff_mass_solver_
IJK_Field_vector3_double rho_v_
bool refuse_patch_conservation_QdM_RK3_source_interf_
IJK_Field_vector3_double RK3_F_velocity_
double coef_rayon_force_rappel_
bool disable_diffusion_qdm_
void update_v_ghost_from_rho_v()
double coef_force_time_n_
Vecteur3 terme_moyen_diffusion_mass_solver_
bool has_champ_vectoriel(const Motcle &nom) const override
void get_noms_champs_postraitables(Noms &noms, Option opt=NONE) const override
void sauvegarder_equation(const Nom &, SFichier &) const
IJK_Field_vector3_double terme_pression_local_
void compute_add_external_forces(const int dir)
bool disable_solveur_poisson_
Vecteur3 u_euler_ap_rho_mu_ind_
Vecteur3 terme_convection_
IJK_Field_double pressure_ghost_cells_
double upstream_velocity_bubble_factor_deriv_
Redistribute_Field redistribute_from_splitting_ft_elem_ghostz_max_
bool suppression_rejetons_
IJK_Field_vector3_double velocity_ft_
void set_param_reprise_pb(Param &)
bool improved_initial_pressure_guess_
Vecteur3 rho_u_euler_ap_rho_mu_ind_
void initialise_ijk_fields()
double L_boite_vol_controle_
const Milieu_base & milieu() const override
double coef_immobilisation_
IJK_Field_vector3_double force_rappel_
Vecteur3 terme_interfaces_
ArrOfInt correction_force_
IJK_Field_vector3_double terme_abs_repulsion_interfaces_ns_
double calculer_true_moyenne_de_phase_liq(const IJK_Field_double &vx)
void deplacer_interfaces(const double timestep, const int rk_step, ArrOfDouble &var_volume_par_bulle, const int first_step_interface_smoothing)
void euler_explicit_update(const IJK_Field_double &dv, IJK_Field_double &v, const int k_layer) const
void build_redistribute_extended_splitting_ft()
Nom expression_potential_phi_
void calculer_vitesse_gauche(const IJK_Field_double &vx, const IJK_Field_double &vy, const IJK_Field_double &vz, double &vx_moy, double &vy_moy, double &vz_moy)
void forcage_control_ecoulement()
Vecteur3 calculer_grad_p_over_rho_moyen(const IJK_Field_double &pression)
init_forcage_THI forcage_
int timestep_reprise_vitesse_
Vecteur3 rho_du_euler_ap_projection_
void calculer_terme_asservissement(double &ax, double &ay, double &az)
void completer() override
Complete la construction (initialisation) des objets associes a l'equation.
void calculer_v_amont_bulle(const IJK_Field_double &vx, const IJK_Field_double &vy, const IJK_Field_double &vz, const IJK_Field_double &wx, const IJK_Field_double &wy, const IJK_Field_double &wz, DoubleTab &v_amont_, DoubleTab &w_amont_, const DoubleTab &d1_amont_, const DoubleTab &d2_amont_, const DoubleTab &d3_amont_, DoubleTab &compteur_)
IJK_Field_double molecular_mu_
IJK_Field_vector3_double terme_abs_repulsion_interfaces_ft_
IJK_Field_vector3_double rho_du_euler_ap_prediction_champ_
double calculer_moyenne_de_phase_liq(const IJK_Field_double &vx)
ArrOfDouble terme_source_correction_
Schema_Temps_IJK_base & schema_temps_ijk()
Operateur_IJK_faces_diff velocity_diffusion_op_
IJK_Field_vector3_double terme_source_interfaces_ft_
void initialise_velocity_using_expression(const Noms &expression_vitesse_initiale)
Vecteur3 calculer_inv_rho_grad_p_moyen(const IJK_Field_double &inv_rho, const IJK_Field_double &pression)
void compute_add_THI_force_sur_d_velocity(const IJK_Field_vector3_double &vitesse, const int time_iteration, const double dt, const double current_time, const Domaine_IJK &my_splitting, const int facteur)
void complete_initialise_ijk_fields()
double liq_velocity_tmoy_
Redistribute_Field redistribute_to_splitting_ft_elem_
void calculer_terme_S_z(const IJK_Field_double &vx, const IJK_Field_double &vy, const IJK_Field_double &vz, const IJK_Field_double &p, DoubleTab &S, const int nz)
const IJK_Field_vector3_double & get_IJK_field_vector(const Motcle &nom) override
bool use_inv_rho_for_mass_solver_and_calculer_rho_v_
double upstream_velocity_bubble_factor_
double velocity_bubble_scope_
corrections_qdm qdm_corrections_
void update_indicatrice_variables_monofluides()
Noms expression_variable_source_
IJK_Field_vector3_double backup_terme_source_interfaces_ns_
bool projection_initiale_demandee_
Redistribute_Field redistribute_from_splitting_ft_elem_
Nom expression_pression_initiale_
DoubleTab vitesses_translation_bulles_
void compute_and_add_qdm_corrections_monophasic()
void deplacer_interfaces_rk3(const double timestep, const int rk_step, ArrOfDouble &var_volume_par_bulle)
IJK_Field_double d_pressure_
void compute_var_volume_par_bulle(ArrOfDouble &var_volume_par_bulle)
void compute_add_THI_force(const IJK_Field_vector3_double &vitesse, const int time_iteration, const double dt, const double current_time, const Domaine_IJK &my_splitting)
double terme_source_acceleration_z_
IJK_Field_vector3_double rho_du_euler_ap_projection_champ_
void euler_time_step(ArrOfDouble &var_volume_par_bulle)
Nom expression_derivee_acceleration_
bool upstream_velocity_measured_
IJK_Field_double div_rhou_
double velocity_bubble_old_
Vecteur3 terme_interfaces_af_mass_solver_
IJK_Field_vector3_double terme_diffusion_local_
double upstream_velocity_bubble_factor_integral_
void calculer_terme_source_acceleration_z(IJK_Field_double &vz, const double time, const double timestep, const int rk_step)
Nom fichier_reprise_vitesse_
void compute_correction_for_momentum_balance(const int rk_step)
IJK_Field_vector3_double d_velocity_
void calculer_dv(const double timestep, const double time, const int rk_step)
void associer_pb_base(const Probleme_base &) override
S'associe au Probleme passe en parametre.
double calculer_moyenne_de_phase_vap(const IJK_Field_double &vx)
void update_v_or_rhov(bool with_p=false)
DoubleTab mean_bubble_rotation_vector_
void terme_source_gravite(IJK_Field_double &dv, int k_index, int dir) const
void calculer_terme_S_y(const IJK_Field_double &vx, const IJK_Field_double &vy, const IJK_Field_double &vz, const IJK_Field_double &p, DoubleTab &S, const int ny)
void associer_milieu_base(const Milieu_base &) override
Nom expression_derivee_facteur_variable_source_
double coeff_evol_volume_
bool resolution_fluctuations_
IJK_Field_vector3_double terme_convection_mass_solver_
void write_check_etapes_et_termes(const int rk_step)
IJK_Field_vector3_double zero_field_ft_
Parser parser_derivee_facteur_variable_source_
void write_qdm_corrections_information()
Champs_compris_IJK champs_compris_
Vecteur3 terme_pression_bis_
void redistribute_from_splitting_ft_elem(const IJK_Field_double &input_field, IJK_Field_double &output_field)
void fill_variable_source_and_potential_phi(const double time)
IJK_Field_vector3_double rho_u_euler_ap_rho_mu_ind_champ_
double coef_ammortissement_
IJK_Field_vector3_double psi_velocity_
double vitesse_upstream_reprise_
void redistribute_to_splitting_ft_elem(const IJK_Field_double &input_field, IJK_Field_double &output_field)
Nom expression_vitesse_upstream_
void calculer_vitesse_droite(const IJK_Field_double &vx, const IJK_Field_double &vy, const IJK_Field_double &vz, double &vx_moy, double &vy_moy, double &vz_moy)
int preparer_calcul() override
Tout ce qui ne depend pas des autres problemes eventuels.
IJK_Field_vector3_double d_v_diff_et_conv_
IJK_Field_vector3_double laplacien_velocity_
bool flag_variable_source_
double terme_source_acceleration_
Operateur_IJK_faces_conv velocity_convection_op_
void calculer_terme_S_x(const IJK_Field_double &vx, const IJK_Field_double &vy, const IJK_Field_double &vz, const IJK_Field_double &p, DoubleTab &S, const int nx)
void calculer_vitesses_bulle(const IJK_Field_double &vx, const IJK_Field_double &vy, const IJK_Field_double &vz, DoubleTab &u_bulles_, DoubleTab &compteur_vBulles_)
IJK_Field_vector3_double backup_terme_source_interfaces_ft_
bool disable_source_interf_
void test_etapes_et_bilan_rho_u_euler(bool apres)
static void Fill_postprocessable_fields(std::vector< FieldInfo_t > &chps)
void set_param(Param &titi) const override
Vecteur3 terme_diffusion_
double diam_bulle_monodisperse_
Vecteur3 terme_pression_in_ustar_
void calculer_base_amont_bulle(const IJK_Field_double &vx, const IJK_Field_double &vy, const IJK_Field_double &vz, const DoubleTab &ubulles, DoubleTab &d1_amont_, DoubleTab &d2_amont_, DoubleTab &d3_amont_, DoubleTab &compteur_base_)
class Nom Une chaine de caractere pour nommer les objets de TRUST
Un tableau de chaine de caracteres (VECT(Nom)).
const Nom & que_suis_je() const
renvoie la chaine identifiant la classe.
virtual Entree & readOn(Entree &)
Lecture d'un Objet_U sur un flot d'entree Methode a surcharger.
virtual Sortie & printOn(Sortie &) const
Ecriture de l'objet sur un flot de sortie Methode a surcharger.
static bool DISABLE_DIPHASIQUE
Helper class to factorize the readOn method of Objet_U classes.
void ajouter_flag(const char *keyword, const bool *value)
Register a boolean flag whose mere presence switches it to true.
void ajouter(const char *keyword, const int *value, Param::Nature nat=Param::OPTIONAL)
Register an integer parameter.
Representation des donnees de la classe Parser.
void addVar(const char *)
virtual void setNbVar(int nvar)
void setVar(const char *sv, double val)
void setString(const std::string &s)
virtual void parseString()
IJK_Field_vector3_double & coords()
Motcles get_liste_post_instantanes() const
void fill_surface_force(IJK_Field_vector3_double &the_field_you_know)
IJK_Field_vector3_double & get_grad_I_ns()
void initialise_stats(Domaine_IJK &splitting, ArrOfDouble &vol_bulles, const double vol_bulle_monodisperse)
const Domaine_IJK & domaine_ijk() const
void update_pre_remeshing_indicator_field()
int get_thermal_probes_ghost_cells() const
void parcourir_maillage()
const Nom & nom_sauvegarde() const
bool has_interface() const
void update_thermal_properties()
const Postprocessing_IJK & get_post() const
virtual void update_indicator_field()
void update_post_remeshing_indicator_field()
ArrOfDouble_with_ghost & get_delta_z_local()
const Domaine_IJK & get_domaine_ft() const
const Domaine_IJK & get_domaine() const
const Nom & le_nom() const override
Donne le nom de l'Objet_U Methode a surcharger : renvoie "neant" dans cette implementation.
classe Probleme_base C'est un Probleme_U qui n'est pas un couplage.
static double mp_max(double)
static void mp_sum_for_each_item(TRUSTArray< _TYPE_ > &x, int n=-1)
static int nproc()
renvoie le nombre de processeurs dans le groupe courant Voir Comm_Group::nproc() et PE_Groups::curren...
static double mp_sum(double)
Calcule la somme de x sur tous les processeurs du groupe courant.
static int me()
renvoie mon rang dans le groupe de communication courant.
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
static int je_suis_maitre()
renvoie 1 si on est sur le processeur maitre du groupe courant (c'est a dire me() == 0),...
Cette classe est a la classe C++ ofstream ce que la classe Sortie est a la classe C++ ostream Elle re...
Explicit Euler scheme for IJK setups.
double & get_store_RK3_fac_sv()
double & get_store_RK3_source_acc()
double get_timestep() const
double get_current_time() const
Classe de base des flux de sortie.
void resize_array(_SIZE_ new_size, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
void resize(_SIZE_ n, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)