15#include <Couplage_Tubes_IBC.h>
17#include <Interprete_bloc.h>
18#include <Linear_algebra_tools.h>
19#include <communications.h>
22#include <IJK_Navier_Stokes_tools.h>
28 os <<
"[ " << v[0] <<
" " << v[1] <<
" " << v[2] <<
" ]";
44 param.dictionnaire(
"etalement", ETALEMENT);
45 param.dictionnaire(
"pas_etalement", PAS_ETALEMENT);
47 Nom nomobjet_faisceau_tubes;
48 param.ajouter(
"faisceau_tubes", &nomobjet_faisceau_tubes);
50 param.dictionnaire(
"miroir", MIROIR);
51 param.dictionnaire(
"symetrie_plane", SYMETRIE_PLANE);
52 param.dictionnaire(
"pas_miroir", PAS_MIROIR);
54 param.dictionnaire(
"ibc0", IBC0);
55 param.dictionnaire(
"ibc_diffuse", IBC_DIFFUSE);
56 param.dictionnaire(
"ibc_localisee", IBC_LOCALISEE);
57 param.dictionnaire(
"ibc_localisee_qdm", IBC_LOCALISEE_QDM);
59 param.dictionnaire(
"cylindre", CYLINDRE);
60 param.dictionnaire(
"cube", CUBE);
63 param.lire_avec_accolades(is);
66 if (nomobjet_faisceau_tubes !=
"??")
69 Cout <<
"On a lu les donnees dans le fichier " << nomobjet_faisceau_tubes <<
":" << finl;
79 const int n_tubes_total =
faisceau_.size();
91 for (
int i = 0; i < n_tubes_total; i++)
100 <<
" faisceau_tubes " <<
faisceau_ <<
"\n"
109 const int n_tubes_total =
faisceau_.size();
110 const double teta = 360./
n_P_;
113 P_teta_Adim *= Adim_P;
118 f.
setf(std::ios_base::scientific);
120 for (
int itube = 0; itube < n_tubes_total; itube++)
121 for (
int l = 0; l <
n_P_; l++)
122 f << P_teta_Adim(itube, l) <<
" " << 180 - teta * l <<
"\n" ;
136 const IJK_Field_double& rho_fluide_field,
137 const double timestep,
const IJK_Field_double& pressure,
double current_time)
181 Cerr <<
"Erreur dans Couplage_Tubes_IBC::force_ibc: methode_IBC " <<
methode_IBC_ <<
" non code" << finl;
224 case IBC_LOCALISEE_QDM:
236 Cerr <<
"Erreur dans Couplage_Tubes_IBC::force_ibc: methode_IBC " <<
methode_IBC_ <<
" non code" << finl;
241 Cerr <<
"Erreur dans Couplage_Tubes_IBC::force_ibc: solide " <<
solide_ <<
" non code" << finl;
263 Cerr <<
"Erreur dans Couplage_Tubes_IBC::force_ibc: champ_miroir " <<
champ_miroir_ <<
" non code" << finl;
272 double inv_timestep = (1./timestep);
289 const IJK_Field_double& rho_fluide_field,
290 const double timestep,
double current_time)
337 case IBC_LOCALISEE_QDM:
350 Cerr <<
"Erreur dans Couplage_Tubes_IBC::force_ibc_post_proj: methode_IBC " <<
methode_IBC_ <<
" non code" << finl;
354 double inv_timestep = (1./timestep);
373 const IJK_Field_double& rho_fluide_field,
374 const double timestep,
const IJK_Field_double& pressure)
396 const IJK_Field_double& rho_fluide_field,
397 DoubleTab& masse_fluide_cylindres,
398 DoubleTab& volume_cylindres,
399 DoubleTab& integrale_force,
403 ArrOfDouble nodes_pos[3];
404 ArrOfDouble elem_pos[3];
406 for (
int dir = 0; dir < 3; dir++)
411 for (
int i = 0; i < n; i++)
412 elem_pos[dir][i] = (nodes_pos[dir][i] + nodes_pos[dir][i+1]) * 0.5;
418 const int ntubes = faisceau.size();
422 for (
int itube = 0; itube < ntubes; itube++)
424 const Tube_base& tube = faisceau[itube].valeur();
427 const double r_tube_min = tube_r - epsilon;
428 const double r_tube_max = tube_r + epsilon;
429 const double r_tube_min_carre = r_tube_min * r_tube_min;
430 const double r_tube_max_carre = r_tube_max * r_tube_max;
436 for (
int direction = 0; direction < 3; direction++)
439 const int ivoisin = (direction == 0) ? -1 : 0;
440 const int jvoisin = (direction == 1) ? -1 : 0;
441 const int kvoisin = (direction == 2) ? -1 : 0;
444 IJK_Field_double& velocity = select_dir(direction, vx, vy, vz);
448 int imax = velocity.
ni();
449 int jmax = velocity.
nj();
450 int kmax = velocity.
nk();
453 const ArrOfDouble& x_coord = (direction==DIRECTION_I) ? nodes_pos[DIRECTION_I] : elem_pos[DIRECTION_I];
454 const double xmin = position_cylindre[0] - (tube_r + epsilon);
455 const double xmax = position_cylindre[0] + (tube_r + epsilon);
456 while (imin < velocity.
ni() && x_coord[imin + offset_i] < xmin)
458 while (imax > 0 && x_coord[imax + offset_i - 1] > xmax)
462 const ArrOfDouble& z_coord = (direction==DIRECTION_K) ? nodes_pos[DIRECTION_K] : elem_pos[DIRECTION_K];
463 const double zmin = position_cylindre[2] - (tube_r + epsilon);
464 const double zmax = position_cylindre[2] + (tube_r + epsilon);
465 while (kmin < velocity.
nk() && z_coord[kmin + offset_k] < zmin)
467 while (kmax > 0 && z_coord[kmax + offset_k - 1] > zmax)
471 double delta_qdm_cylindre = 0.;
472 double masse_fluide = 0.;
475 for (
int k = kmin; k < kmax; k++)
480 const double z_coord = (direction==DIRECTION_K) ? nodes_pos[DIRECTION_K][k+offset_k] : elem_pos[DIRECTION_K][k+offset_k];
481 for (
int j = jmin; j < jmax; j++)
484 for (
int i = imin; i < imax; i++)
486 const double x_coord = (direction==DIRECTION_I) ? nodes_pos[DIRECTION_I][i+offset_i] : elem_pos[DIRECTION_I][i+offset_i];
487 const double delta_x = x_coord - position_cylindre[0];
488 const double delta_z = z_coord - position_cylindre[2];
489 const double d2 = delta_x * delta_x + delta_z * delta_z;
490 const double d = sqrt(d2);
491 const double rayon_tube_carre = tube_r * tube_r;
494 double critere_max_carre, critere_min_carre;
498 critere_max_carre = rayon_tube_carre;
499 critere_min_carre = rayon_tube_carre;
502 critere_max_carre = r_tube_max_carre;
503 critere_min_carre = r_tube_min_carre;
506 critere_max_carre = rayon_tube_carre;
507 critere_min_carre = rayon_tube_carre;
508 Cerr <<
"Erreur dans Couplage_Tubes_IBC::update: lissage " <<
lissage_ <<
" non code" << finl;
512 if (d2 < critere_max_carre)
515 rotation[0] = omega * (- delta_z);
517 rotation[2] = omega * delta_x;
518 double extrapolated_v = vitesse_cylindre[direction] + rotation[direction];
520 if (d2 < critere_min_carre)
527 f_etalement = 0.5 * ( 1 - tanh(4* (d - tube_r)/ epsilon) ) ;
530 double delta_v = f_etalement * (extrapolated_v - velocity(i,j,k));
533 double rho_fluide = (rho_fluide_field(i,j,k) + rho_fluide_field(i+ivoisin, j+jvoisin, k+kvoisin)) * 0.5;
534 delta_qdm_cylindre += delta_v * volume_maille * rho_fluide;
535 velocity(i, j, k) = f_etalement * extrapolated_v + (1-f_etalement) * velocity(i, j, k);
536 masse_fluide += volume_maille * rho_fluide;
537 volume += volume_maille;
543 integrale_force(itube, direction) = delta_qdm_cylindre;
544 masse_fluide_cylindres(itube, direction) = masse_fluide;
545 volume_cylindres(itube, direction) = volume;
562 const IJK_Field_double& rho_fluide_field,
563 DoubleTab& masse_fluide_cylindres,
564 DoubleTab& volume_cylindres,
565 DoubleTab& integrale_force,
569 ArrOfDouble nodes_pos[3];
570 ArrOfDouble elem_pos[3];
572 for (
int dir = 0; dir < 3; dir++)
577 for (
int i = 0; i < n; i++)
578 elem_pos[dir][i] = (nodes_pos[dir][i] + nodes_pos[dir][i+1]) * 0.5;
584 const int ntubes = faisceau.size();
588 for (
int itube = 0; itube < ntubes; itube++)
590 const Tube_base& tube = faisceau[itube].valeur();
599 for (
int direction = 0; direction < 3; direction++)
602 const int ivoisin = (direction == 0) ? -1 : 0;
603 const int jvoisin = (direction == 1) ? -1 : 0;
604 const int kvoisin = (direction == 2) ? -1 : 0;
607 IJK_Field_double& velocity = select_dir(direction, vx, vy, vz);
611 int imax = velocity.
ni();
612 int jmax = velocity.
nj();
613 int kmax = velocity.
nk();
618 const ArrOfDouble& x_coord = (direction==DIRECTION_I) ? nodes_pos[DIRECTION_I] : elem_pos[DIRECTION_I];
619 const double xmin = position_cylindre[0] - (tube_r + d_z);
620 const double xmax = position_cylindre[0] + (tube_r + d_z);
622 while (imin < velocity.
ni() && x_coord[imin + offset_i] < xmin)
624 while (imax > 0 && x_coord[imax + offset_i - 1] > xmax)
628 const ArrOfDouble& z_coord = (direction==DIRECTION_K) ? nodes_pos[DIRECTION_K] : elem_pos[DIRECTION_K];
629 const double zmin = position_cylindre[2] - (tube_r + d_z);
630 const double zmax = position_cylindre[2] + (tube_r + d_z);
632 while (kmin < velocity.
nk() && z_coord[kmin + offset_k] < zmin)
634 while (kmax > 0 && z_coord[kmax + offset_k - 1] > zmax)
638 double delta_qdm_cylindre = 0.;
639 double masse_fluide = 0.;
643 for (
int k = kmin; k <= kmax; k++)
648 const double z_coord = (direction==DIRECTION_K) ? nodes_pos[DIRECTION_K][k+offset_k] : elem_pos[DIRECTION_K][k+offset_k];
649 for (
int j = jmin; j < jmax; j++)
652 for (
int i = imin; i <= imax; i++)
654 const double x_coord = (direction==DIRECTION_I) ? nodes_pos[DIRECTION_I][i+offset_i] : elem_pos[DIRECTION_I][i+offset_i];
655 const double delta_x = x_coord - position_cylindre[0];
656 const double delta_z = z_coord - position_cylindre[2];
657 const double d2 = delta_x * delta_x + delta_z * delta_z;
658 const double d = sqrt(d2);
662 const double Borne_min = tube_r - d_z /2;
663 const double Borne_max = tube_r + d_z /2;
672 rotation[0] = omega * (- delta_z);
674 rotation[2] = omega * delta_x;
675 double extrapolated_v = vitesse_cylindre[direction] + rotation[direction];
677 const double d_occupe = Borne_max - d;
682 double delta_v_non_etale = extrapolated_v - velocity(i,j,k);
683 double delta_v = f * delta_v_non_etale;
687 double rho_fluide = (rho_fluide_field(i,j,k) + rho_fluide_field(i+ivoisin, j+jvoisin, k+kvoisin)) * 0.5;
688 delta_qdm_cylindre += delta_v * volume_maille * rho_fluide;
689 velocity(i, j, k) = f * extrapolated_v + (1-f) * velocity(i, j, k);
691 masse_fluide += volume_maille * rho_fluide;
692 volume += volume_maille;
698 integrale_force(itube, direction) = delta_qdm_cylindre;
699 masse_fluide_cylindres(itube, direction) = masse_fluide;
700 volume_cylindres(itube, direction) = volume;
719 const IJK_Field_double& rho_fluide_field,
720 const double timestep,
const IJK_Field_double& pressure)
728 tmp_masse_fluide_cylindres,
729 tmp_volume_cylindres,
741 const IJK_Field_double& rho_fluide_field,
742 DoubleTab& masse_fluide_cylindres,
743 DoubleTab& volume_cylindres,
744 DoubleTab& integrale_force,
746 const double timestep)
const
748 Cout <<
"Fonction_anticipe" << finl;
750 ArrOfDouble nodes_pos[3];
751 ArrOfDouble elem_pos[3];
753 for (
int dir = 0; dir < 3; dir++)
758 for (
int i = 0; i < n; i++)
759 elem_pos[dir][i] = (nodes_pos[dir][i] + nodes_pos[dir][i+1]) * 0.5;
765 const int ntubes = faisceau.size();
768 for (
int itube = 0; itube < ntubes; itube++)
770 const Tube_base& tube = faisceau[itube].valeur();
778 for (
int direction = 0; direction < 3; direction++)
781 const int ivoisin = (direction == 0) ? -1 : 0;
782 const int jvoisin = (direction == 1) ? -1 : 0;
783 const int kvoisin = (direction == 2) ? -1 : 0;
786 IJK_Field_double& velocity = select_dir(direction, vx, vy, vz);
790 int imax = velocity.
ni();
791 int jmax = velocity.
nj();
792 int kmax = velocity.
nk();
798 const ArrOfDouble& x_coord = (direction==DIRECTION_I) ? nodes_pos[DIRECTION_I] : elem_pos[DIRECTION_I];
799 const double xmin = position_cylindre[0] - (
L_cube_ + delta_x);
800 const double xmax = position_cylindre[0] + (
L_cube_ + delta_x);
801 Cout <<
"xmin : " << xmin <<
" xmax : " << xmax << finl;
802 while (imin < velocity.
ni() && x_coord[imin + offset_i] < xmin)
804 while (imax > 0 && x_coord[imax + offset_i - 1] > xmax)
808 const ArrOfDouble& z_coord = (direction==DIRECTION_K) ? nodes_pos[DIRECTION_K] : elem_pos[DIRECTION_K];
809 const double zmin = position_cylindre[2] - (
L_cube_ + delta_x);
810 const double zmax = position_cylindre[2] + (
L_cube_ + delta_x);
811 Cout <<
"zmin : " << zmin <<
" zmax : " << zmax <<finl;
812 while (kmin < velocity.
nk() && z_coord[kmin + offset_k] < zmin)
814 while (kmax > 0 && z_coord[kmax + offset_k - 1] > zmax)
821 double delta_qdm_cylindre = 0.;
822 double masse_fluide = 0.;
824 Cout <<
"imin : " << imin <<
" imax : " << imax <<
" kmin : " << kmin <<
" kmax : " << kmax <<
" x_O : " << position_cylindre[0] <<
" z_O : " << position_cylindre[2] << finl;
825 for (
int k = kmin; k <= kmax; k++)
830 const double z_coord = (direction==DIRECTION_K) ? nodes_pos[DIRECTION_K][k+offset_k] : elem_pos[DIRECTION_K][k+offset_k];
831 for (
int j = jmin; j < jmax; j++)
834 for (
int i = imin; i <= imax; i++)
836 const double x_coord = (direction==DIRECTION_I) ? nodes_pos[DIRECTION_I][i+offset_i] : elem_pos[DIRECTION_I][i+offset_i];
837 const double d_OM_x = x_coord - position_cylindre[0];
838 const double d_OM_z = z_coord - position_cylindre[2];
839 const double ABS_dOM_x = std::fabs(d_OM_x);
840 const double ABS_dOM_z = std::fabs(d_OM_z);
841 Cout <<
"i : " << i <<
" j : " << j <<
" k : " << k <<
" dir : " << direction <<
" x_coord : " << x_coord <<
" z_coord : ";
842 Cout << z_coord <<
" ABS_d_OM_x : " << ABS_dOM_x <<
" ABS_d_OM_z : " << ABS_dOM_z <<
" velocity(i,j,k) : " << velocity(i,j,k) << finl;
843 const double Borne_max =
L_cube_;
845 rotation[0] = omega * (- delta_z);
847 rotation[2] = omega * delta_x;
848 const double vs_z = vitesse_cylindre[2] + rotation[2];
852 if ((d_OM_z > Borne_max) && (ABS_dOM_x <= Borne_max+1e-10))
854 Cout <<
"vs_z > 0" <<
" i : " << i <<
" j : " << j <<
" k : " << k <<
" dir : " << direction <<
" x_coord : " << x_coord <<
" z_coord : " ;
855 Cout << z_coord <<
" ABS_d_OM_x : " << ABS_dOM_x <<
" d_OM_z : " << d_OM_z <<
" velocity(i,j,k) : " << velocity(i,j,k)<< finl;
857 const double d_OM_L = d_OM_z -
L_cube_;
858 const double dz = vs_z * timestep;
859 const double ABS_dz = std::fabs(dz);
860 Cout <<
"d_OM_L : " << d_OM_L <<
" dz : " << dz <<
" vs_z : " << vs_z << finl;
861 if ( d_OM_L <= ABS_dz )
863 double extrapolated_v = vitesse_cylindre[direction] + rotation[direction];
865 double delta_v = (extrapolated_v - velocity(i,j,k));
866 Cout <<
"On force la vitesse en prevision " <<
" delta_v : " << delta_v <<
" extrapolated_v : " << extrapolated_v <<
" velocity(i,j,k) : " << velocity(i,j,k) << finl;
869 double rho_fluide = (rho_fluide_field(i,j,k) + rho_fluide_field(i+ivoisin, j+jvoisin, k+kvoisin)) * 0.5;
870 delta_qdm_cylindre += delta_v * volume_maille * rho_fluide;
871 Cout <<
" delta_qdm_cylindre : " << delta_qdm_cylindre <<
" volume_maille : " << volume_maille << finl;
872 velocity(i, j, k) = extrapolated_v;
873 masse_fluide += volume_maille * rho_fluide;
874 volume += volume_maille;
883 if ((-d_OM_z > Borne_max) && (ABS_dOM_x <= Borne_max+1e-10))
885 Cout <<
"vs_z < 0" <<
" i : " << i <<
" j : " << j <<
" k : " << k <<
" dir : " << direction <<
" x_coord : " << x_coord <<
" z_coord : ";
886 Cout<< z_coord <<
" ABS_d_OM_x : " << ABS_dOM_x <<
" d_OM_z : " << d_OM_z <<
" velocity(i,j,k) : " << velocity(i,j,k) << finl;
888 const double d_OM_L = d_OM_z -
L_cube_;
889 const double dz = vs_z * timestep;
890 const double ABS_dz = std::fabs(dz);
891 Cout <<
"d_OM_L : " << d_OM_L <<
" dz : " << dz <<
" vs_z : " << vs_z << finl;
892 if ( d_OM_L <= ABS_dz )
894 double extrapolated_v = vitesse_cylindre[direction] + rotation[direction];
896 double delta_v = (extrapolated_v - velocity(i,j,k));
897 Cout <<
"On force la vitesse en prevision " <<
" delta_v : " << delta_v <<
" extrapolated_v : " << extrapolated_v <<
" velocity(i,j,k) : " << velocity(i,j,k) << finl;
900 double rho_fluide = (rho_fluide_field(i,j,k) + rho_fluide_field(i+ivoisin, j+jvoisin, k+kvoisin)) * 0.5;
901 delta_qdm_cylindre += delta_v * volume_maille * rho_fluide;
902 Cout <<
" delta_qdm_cylindre : " << delta_qdm_cylindre <<
" volume_maille : " << volume_maille << finl;
903 velocity(i, j, k) = extrapolated_v;
904 masse_fluide += volume_maille * rho_fluide;
905 volume += volume_maille;
917 integrale_force(itube, direction) = delta_qdm_cylindre;
918 masse_fluide_cylindres(itube, direction) = masse_fluide;
919 volume_cylindres(itube, direction) = volume;
920 Cout <<
" integrale_force(itube, direction) " << integrale_force(itube, direction) <<
" volume_cylindres(itube, direction) : " << volume_cylindres(itube, direction) << finl;
945 const IJK_Field_double& rho_fluide_field,
946 DoubleTab& masse_fluide_cylindres,
947 DoubleTab& volume_cylindres,
948 DoubleTab& integrale_force,
952 ArrOfDouble nodes_pos[3];
953 ArrOfDouble elem_pos[3];
955 for (
int dir = 0; dir < 3; dir++)
960 for (
int i = 0; i < n; i++)
961 elem_pos[dir][i] = (nodes_pos[dir][i] + nodes_pos[dir][i+1]) * 0.5;
967 const int ntubes = faisceau.size();
970 for (
int itube = 0; itube < ntubes; itube++)
972 const Tube_base& tube = faisceau[itube].valeur();
982 Cout <<
"v_predite : " << vx(64, 0, 73) <<
" " << vx(64, 0, 74) <<
" " <<vx(64, 0, 75) <<
" " <<vx(64, 0, 76) <<
" z_interface : " << position_cylindre[2] +
L_cube_ << finl;
987 for (
int direction = 0; direction < 3; direction++)
990 const int ivoisin = (direction == 0) ? -1 : 0;
991 const int jvoisin = (direction == 1) ? -1 : 0;
992 const int kvoisin = (direction == 2) ? -1 : 0;
995 IJK_Field_double& velocity = select_dir(direction, vx, vy, vz);
999 int imax = velocity.
ni();
1000 int jmax = velocity.
nj();
1001 int kmax = velocity.
nk();
1006 const ArrOfDouble& x_coord = (direction==DIRECTION_I) ? nodes_pos[DIRECTION_I] : elem_pos[DIRECTION_I];
1007 const double xmin = position_cylindre[0] - (
L_cube_ + delta_x);
1008 const double xmax = position_cylindre[0] + (
L_cube_ + delta_x);
1010 while (imin < velocity.
ni() && x_coord[imin + offset_i] < xmin)
1012 while (imax > 0 && x_coord[imax + offset_i - 1] > xmax)
1016 const ArrOfDouble& z_coord = (direction==DIRECTION_K) ? nodes_pos[DIRECTION_K] : elem_pos[DIRECTION_K];
1017 const double zmin = position_cylindre[2] - (
L_cube_ + delta_z);
1018 const double zmax = position_cylindre[2] + (
L_cube_ + delta_z);
1020 while (kmin < velocity.
nk() && z_coord[kmin + offset_k] < zmin)
1022 while (kmax > 0 && z_coord[kmax + offset_k - 1] > zmax)
1027 double delta_qdm_cylindre = 0.;
1028 double masse_fluide = 0.;
1032 Cout <<
" " << finl;
1033 Cout <<
"dir : "<< direction <<
" x_O : " << position_cylindre[0] <<
" z_O : " << position_cylindre[2] <<
" V_maille : " << volume_maille << finl;
1034 Cout <<
" " << finl;
1036 for (
int k = kmin; k <= kmax; k++)
1041 const double z_coord = (direction==DIRECTION_K) ? nodes_pos[DIRECTION_K][k+offset_k] : elem_pos[DIRECTION_K][k+offset_k];
1042 for (
int j = jmin; j < jmax; j++)
1045 for (
int i = imin; i <= imax; i++)
1047 const double x_coord = (direction==DIRECTION_I) ? nodes_pos[DIRECTION_I][i+offset_i] : elem_pos[DIRECTION_I][i+offset_i];
1048 const double dOMx = x_coord - position_cylindre[0];
1049 const double dOMz = z_coord - position_cylindre[2];
1050 const double ABS_dOMx = std::fabs(dOMx);
1051 const double ABS_dOMz = std::fabs(dOMz);
1052 const double Borne_z =
L_cube_;
1053 const double Borne_x =
L_cube_;
1056 if ( (ABS_dOMx <= Borne_x) && (ABS_dOMz <= Borne_z))
1059 rotation[0] = omega * (- dOMz);
1061 rotation[2] = omega * dOMx;
1062 double extrapolated_v = vitesse_cylindre[direction] + rotation[direction];
1064 double delta_v = (extrapolated_v - velocity(i,j,k));
1067 Cout <<
"Forcage_interieur "<<
"i : " << i <<
" j : " << j <<
" k : " << k <<
" x_M : " << x_coord <<
" z_M : " << z_coord <<
" v(i,j,k) : " << velocity(i,j,k) << finl;
1070 double rho_fluide = (rho_fluide_field(i,j,k) + rho_fluide_field(i+ivoisin, j+jvoisin, k+kvoisin)) * 0.5;
1071 delta_qdm_cylindre += delta_v * volume_maille * rho_fluide;
1074 Cout <<
"delta_v : "<< delta_v <<
" v_S : " << extrapolated_v <<
" qdm : " << delta_v * volume_maille * rho_fluide <<
" qdm_cube : " << delta_qdm_cylindre << finl;
1080 if ( (direction==0) && ((j==0) && (i==64)) && ((k==54)|(k==55)|(k==76)|(k==77)) )
1082 Cout <<
" " << finl;
1083 Cout <<
"qdm_ijk" << i << j << k <<
" : " << delta_v * volume_maille * rho_fluide <<
" x_M : " << x_coord <<
" z_M : " << z_coord <<
" z_interface : " << position_cylindre[2] +
L_cube_ << finl;
1084 Cout <<
"v_ijk" << i << j << k <<
" : " << velocity(i,j,k) <<
" x_M : " << x_coord <<
" z_M : " << z_coord <<
" z_interface : " << position_cylindre[2] +
L_cube_ << finl;
1085 Cout <<
" " << finl;
1089 velocity(i, j, k) = extrapolated_v;
1090 masse_fluide += volume_maille * rho_fluide;
1091 volume += volume_maille;
1097 integrale_force(itube, direction) = delta_qdm_cylindre;
1098 masse_fluide_cylindres(itube, direction) = masse_fluide;
1099 volume_cylindres(itube, direction) = volume;
1101 Cout <<
"integrale_force(itube, direction) " << integrale_force(itube, direction) <<
" V_S : " << volume_cylindres(itube, direction) << finl;
1107 Cout <<
"v_imposee : " << vx(64, 0, 73) <<
" " << vx(64, 0, 74) <<
" " <<vx(64, 0, 75) <<
" " << vx(64, 0, 76) <<
" z_interface : " << position_cylindre[2] +
L_cube_ << finl;
1123 const IJK_Field_double& rho_fluide_field,
1124 DoubleTab& masse_fluide_cylindres,
1125 DoubleTab& volume_cylindres,
1126 DoubleTab& integrale_force,
1130 ArrOfDouble nodes_pos[3];
1131 ArrOfDouble elem_pos[3];
1133 for (
int dir = 0; dir < 3; dir++)
1138 for (
int i = 0; i < n; i++)
1139 elem_pos[dir][i] = (nodes_pos[dir][i] + nodes_pos[dir][i+1]) * 0.5;
1145 const int ntubes = faisceau.size();
1148 for (
int itube = 0; itube < ntubes; itube++)
1150 const Tube_base& tube = faisceau[itube].valeur();
1158 for (
int direction = 0; direction < 3; direction++)
1161 const int ivoisin = (direction == 0) ? -1 : 0;
1162 const int jvoisin = (direction == 1) ? -1 : 0;
1163 const int kvoisin = (direction == 2) ? -1 : 0;
1166 IJK_Field_double& velocity = select_dir(direction, vx, vy, vz);
1170 int imax = velocity.
ni();
1171 int jmax = velocity.
nj();
1172 int kmax = velocity.
nk();
1177 const ArrOfDouble& x_coord = (direction==DIRECTION_I) ? nodes_pos[DIRECTION_I] : elem_pos[DIRECTION_I];
1178 const double xmin = position_cylindre[0] - (
L_cube_ + delta_x);
1179 const double xmax = position_cylindre[0] + (
L_cube_ + delta_x);
1181 while (imin < velocity.
ni() && x_coord[imin + offset_i] < xmin)
1183 while (imax > 0 && x_coord[imax + offset_i - 1] > xmax)
1187 const ArrOfDouble& z_coord = (direction==DIRECTION_K) ? nodes_pos[DIRECTION_K] : elem_pos[DIRECTION_K];
1188 const double zmin = position_cylindre[2] - (
L_cube_ + delta_z);
1189 const double zmax = position_cylindre[2] + (
L_cube_ + delta_z);
1191 while (kmin < velocity.
nk() && z_coord[kmin + offset_k] < zmin)
1193 while (kmax > 0 && z_coord[kmax + offset_k - 1] > zmax)
1198 double delta_qdm_cylindre = 0.;
1199 double masse_fluide = 0.;
1202 for (
int k = kmin; k <= kmax; k++)
1207 const double z_coord = (direction==DIRECTION_K) ? nodes_pos[DIRECTION_K][k+offset_k] : elem_pos[DIRECTION_K][k+offset_k];
1208 for (
int j = jmin; j < jmax; j++)
1211 for (
int i = imin; i <= imax; i++)
1213 const double x_coord = (direction==DIRECTION_I) ? nodes_pos[DIRECTION_I][i+offset_i] : elem_pos[DIRECTION_I][i+offset_i];
1214 const double dOMx = x_coord - position_cylindre[0];
1215 const double dOMz = z_coord - position_cylindre[2];
1216 const double ABS_dOMx = std::fabs(dOMx);
1217 const double ABS_dOMz = std::fabs(dOMz);
1218 const double Borne_z =
L_cube_;
1219 const double Borne_x =
L_cube_;
1222 if ( (ABS_dOMx <= Borne_x) && (ABS_dOMz <= Borne_z))
1225 rotation[0] = omega * (- dOMz);
1227 rotation[2] = omega * dOMx;
1228 double extrapolated_v = vitesse_cylindre[direction] + rotation[direction];
1230 double delta_v = (extrapolated_v - velocity(i,j,k));
1233 double rho_fluide = (rho_fluide_field(i,j,k) + rho_fluide_field(i+ivoisin, j+jvoisin, k+kvoisin)) * 0.5;
1234 delta_qdm_cylindre += delta_v * volume_maille * rho_fluide;
1239 if ( (direction==0) && ((j==0) && (i==64)) && ((k==55)|(k==76)) )
1241 Cout <<
" " << finl;
1242 Cout <<
"qdm_ijk_post_proj" << i << j << k <<
" : " << delta_v * volume_maille * rho_fluide <<
" x_M : " << x_coord <<
" z_M : " << z_coord <<
" z_interface : " << position_cylindre[2] +
L_cube_ << finl;
1243 Cout <<
" " << finl;
1247 masse_fluide += volume_maille * rho_fluide;
1248 volume += volume_maille;
1254 integrale_force(itube, direction) = delta_qdm_cylindre;
1255 masse_fluide_cylindres(itube, direction) = masse_fluide;
1256 volume_cylindres(itube, direction) = volume;
1269 const IJK_Field_double& rho_fluide_field,
1270 DoubleTab& masse_fluide_cylindres,
1271 DoubleTab& volume_cylindres,
1272 DoubleTab& integrale_force,
1276 ArrOfDouble nodes_pos[3];
1277 ArrOfDouble elem_pos[3];
1279 for (
int dir = 0; dir < 3; dir++)
1284 for (
int i = 0; i < n; i++)
1285 elem_pos[dir][i] = (nodes_pos[dir][i] + nodes_pos[dir][i+1]) * 0.5;
1291 const int ntubes = faisceau.size();
1294 for (
int itube = 0; itube < ntubes; itube++)
1296 const Tube_base& tube = faisceau[itube].valeur();
1305 Cout <<
"v_predite : " << vx(64, 0, 76) <<
" z_interface : " << position_cylindre[2] +
L_cube_ << finl;
1309 for (
int direction = 0; direction < 3; direction++)
1312 const int ivoisin = (direction == 0) ? -1 : 0;
1313 const int jvoisin = (direction == 1) ? -1 : 0;
1314 const int kvoisin = (direction == 2) ? -1 : 0;
1317 IJK_Field_double& velocity = select_dir(direction, vx, vy, vz);
1321 int imax = velocity.
ni();
1322 int jmax = velocity.
nj();
1323 int kmax = velocity.
nk();
1328 const ArrOfDouble& x_coord = (direction==DIRECTION_I) ? nodes_pos[DIRECTION_I] : elem_pos[DIRECTION_I];
1329 const double xmin = position_cylindre[0] - (
L_cube_ + delta_x);
1330 const double xmax = position_cylindre[0] + (
L_cube_ + delta_x);
1332 while (imin < velocity.
ni() && x_coord[imin + offset_i] < xmin)
1334 while (imax > 0 && x_coord[imax + offset_i - 1] > xmax)
1338 const ArrOfDouble& z_coord = (direction==DIRECTION_K) ? nodes_pos[DIRECTION_K] : elem_pos[DIRECTION_K];
1339 const double zmin = position_cylindre[2] - (
L_cube_ + delta_z);
1340 const double zmax = position_cylindre[2] + (
L_cube_ + delta_z);
1342 while (kmin < velocity.
nk() && z_coord[kmin + offset_k] < zmin)
1344 while (kmax > 0 && z_coord[kmax + offset_k - 1] > zmax)
1349 double delta_qdm_cylindre = 0.;
1350 double masse_fluide = 0.;
1353 Cout <<
" " << finl;
1354 Cout <<
"dir : "<< direction <<
" x_O : " << position_cylindre[0] <<
" z_O : " << position_cylindre[2] <<
" V_maille : " << volume_maille << finl;
1355 Cout <<
" " << finl;
1357 for (
int k = kmin; k <= kmax; k++)
1362 const double z_coord = (direction==DIRECTION_K) ? nodes_pos[DIRECTION_K][k+offset_k] : elem_pos[DIRECTION_K][k+offset_k];
1363 for (
int j = jmin; j < jmax; j++)
1366 for (
int i = imin; i <= imax; i++)
1368 const double x_coord = (direction==DIRECTION_I) ? nodes_pos[DIRECTION_I][i+offset_i] : elem_pos[DIRECTION_I][i+offset_i];
1369 const double dOMx = x_coord - position_cylindre[0];
1370 const double dOMz = z_coord - position_cylindre[2];
1371 const double ABS_dOMx = std::fabs(dOMx);
1372 const double ABS_dOMz = std::fabs(dOMz);
1373 const double Borne_min_z =
L_cube_ - delta_z/2;
1374 const double Borne_max_z =
L_cube_ + delta_z/2;
1375 const double Borne_min_x =
L_cube_ - delta_x/2;
1376 const double Borne_max_x =
L_cube_ + delta_x/2;
1378 if ( (ABS_dOMx <= Borne_max_x) && (ABS_dOMz <= Borne_max_z))
1381 rotation[0] = omega * (- dOMz);
1383 rotation[2] = omega * dOMx;
1384 double extrapolated_v = vitesse_cylindre[direction] + rotation[direction];
1388 const double d_k = Borne_max_z - ABS_dOMz;
1389 const double d_i = Borne_max_x - ABS_dOMx;
1390 if (( ABS_dOMx <= Borne_min_x) && ( ABS_dOMz <= Borne_min_z))
1395 else if ( ABS_dOMx <= Borne_min_x)
1398 f_k = d_k / delta_z;
1400 else if( ABS_dOMz <= Borne_min_z)
1402 f_i = d_i / delta_x;
1407 f_i = d_i / delta_x;
1408 f_k = d_k / delta_z;
1413 Cout <<
"Forcage "<<
"i : " << i <<
" j : " << j <<
" k : " << k <<
" x_M : " << x_coord <<
" z_M : " << z_coord <<
" v* : " ;
1414 Cout << velocity(i,j,k) <<
" f_k : " << f_k <<
" f_i : " << f_i <<
" f_ik : " << f_ik << finl;
1416 double delta_v = f_ik * (extrapolated_v - velocity(i,j,k));
1418 double rho_fluide = (rho_fluide_field(i,j,k) + rho_fluide_field(i+ivoisin, j+jvoisin, k+kvoisin)) * 0.5;
1419 delta_qdm_cylindre += delta_v * volume_maille * rho_fluide;
1423 if ( (direction==0) && ((j==0) && (i==64)) && ((k==54)|(k==55)|(k==76)|(k==77)) )
1425 Cout <<
" " << finl;
1426 Cout <<
"qdm_ijk" << i << j << k <<
" : " << delta_v * volume_maille * rho_fluide <<
" x_M : " << x_coord <<
" z_M : " << z_coord <<
" z_interface : " << position_cylindre[2] +
L_cube_<<
" frac_vol : " << f_ik * volume_maille << finl;
1427 Cout <<
"v_ijk" << i << j << k <<
" : " << velocity(i,j,k) <<
" x_M : " << x_coord <<
" z_M : " << z_coord <<
" z_interface : " << position_cylindre[2] +
L_cube_<< finl;
1428 Cout <<
" " << finl;
1432 Cout <<
"delta_v : "<< delta_v <<
" v_S : " << extrapolated_v <<
" qdm : " << delta_v * volume_maille * rho_fluide <<
" qdm_cube : " << delta_qdm_cylindre <<
" v_force : " << velocity(i, j, k) << finl;
1434 velocity(i, j, k) = f_ik * extrapolated_v + (1-f_ik) * velocity(i, j, k);
1435 masse_fluide += volume_maille * rho_fluide;
1436 volume += volume_maille;
1442 integrale_force(itube, direction) = delta_qdm_cylindre;
1443 masse_fluide_cylindres(itube, direction) = masse_fluide;
1444 volume_cylindres(itube, direction) = volume;
1446 Cout <<
"integrale_force(itube, direction) " << integrale_force(itube, direction) <<
" V_S : " << volume_cylindres(itube, direction) << finl;
1452 Cout <<
"v_imposee : " << vx(64, 0, 76) <<
" z_interface : " << position_cylindre[2] +
L_cube_ << finl;
1467 const IJK_Field_double& rho_fluide_field,
1468 DoubleTab& masse_fluide_cylindres,
1469 DoubleTab& volume_cylindres,
1470 DoubleTab& integrale_force,
1474 ArrOfDouble nodes_pos[3];
1475 ArrOfDouble elem_pos[3];
1477 for (
int dir = 0; dir < 3; dir++)
1482 for (
int i = 0; i < n; i++)
1483 elem_pos[dir][i] = (nodes_pos[dir][i] + nodes_pos[dir][i+1]) * 0.5;
1489 const int ntubes = faisceau.size();
1492 for (
int itube = 0; itube < ntubes; itube++)
1494 const Tube_base& tube = faisceau[itube].valeur();
1502 for (
int direction = 0; direction < 3; direction++)
1505 const int ivoisin = (direction == 0) ? -1 : 0;
1506 const int jvoisin = (direction == 1) ? -1 : 0;
1507 const int kvoisin = (direction == 2) ? -1 : 0;
1510 IJK_Field_double& velocity = select_dir(direction, vx, vy, vz);
1514 int imax = velocity.
ni();
1515 int jmax = velocity.
nj();
1516 int kmax = velocity.
nk();
1521 const ArrOfDouble& x_coord = (direction==DIRECTION_I) ? nodes_pos[DIRECTION_I] : elem_pos[DIRECTION_I];
1522 const double xmin = position_cylindre[0] - (
L_cube_ + delta_x);
1523 const double xmax = position_cylindre[0] + (
L_cube_ + delta_x);
1525 while (imin < velocity.
ni() && x_coord[imin + offset_i] < xmin)
1527 while (imax > 0 && x_coord[imax + offset_i - 1] > xmax)
1531 const ArrOfDouble& z_coord = (direction==DIRECTION_K) ? nodes_pos[DIRECTION_K] : elem_pos[DIRECTION_K];
1532 const double zmin = position_cylindre[2] - (
L_cube_ + delta_z);
1533 const double zmax = position_cylindre[2] + (
L_cube_ + delta_z);
1535 while (kmin < velocity.
nk() && z_coord[kmin + offset_k] < zmin)
1537 while (kmax > 0 && z_coord[kmax + offset_k - 1] > zmax)
1542 double delta_qdm_cylindre = 0.;
1543 double masse_fluide = 0.;
1546 for (
int k = kmin; k <= kmax; k++)
1551 const double z_coord = (direction==DIRECTION_K) ? nodes_pos[DIRECTION_K][k+offset_k] : elem_pos[DIRECTION_K][k+offset_k];
1552 for (
int j = jmin; j < jmax; j++)
1555 for (
int i = imin; i <= imax; i++)
1557 const double x_coord = (direction==DIRECTION_I) ? nodes_pos[DIRECTION_I][i+offset_i] : elem_pos[DIRECTION_I][i+offset_i];
1558 const double dOMx = x_coord - position_cylindre[0];
1559 const double dOMz = z_coord - position_cylindre[2];
1560 const double ABS_dOMx = std::fabs(dOMx);
1561 const double ABS_dOMz = std::fabs(dOMz);
1562 const double Borne_min_z =
L_cube_ - delta_z/2;
1563 const double Borne_max_z =
L_cube_ + delta_z/2;
1564 const double Borne_min_x =
L_cube_ - delta_x/2;
1565 const double Borne_max_x =
L_cube_ + delta_x/2;
1567 if ( (ABS_dOMx <= Borne_max_x) && (ABS_dOMz <= Borne_max_z))
1570 rotation[0] = omega * (- dOMz);
1572 rotation[2] = omega * dOMx;
1573 double extrapolated_v = vitesse_cylindre[direction] + rotation[direction];
1577 const double d_k = Borne_max_z - ABS_dOMz;
1578 const double d_i = Borne_max_x - ABS_dOMx;
1579 if (( ABS_dOMx <= Borne_min_x) && ( ABS_dOMz <= Borne_min_z))
1584 else if ( ABS_dOMx <= Borne_min_x)
1587 f_k = d_k / delta_z;
1589 else if( ABS_dOMz <= Borne_min_z)
1591 f_i = d_i / delta_x;
1596 f_i = d_i / delta_x;
1597 f_k = d_k / delta_z;
1600 double delta_v = f_ik * (extrapolated_v - velocity(i,j,k));
1602 double rho_fluide = (rho_fluide_field(i,j,k) + rho_fluide_field(i+ivoisin, j+jvoisin, k+kvoisin)) * 0.5;
1603 delta_qdm_cylindre += delta_v * volume_maille * rho_fluide;
1607 if ( (direction==0) && ((j==0) && (i==64)) && ((k==55)|(k==76)) )
1609 Cout <<
" " << finl;
1610 Cout <<
"qdm_ijk_post_proj" << i << j << k <<
" : " << delta_v * volume_maille * rho_fluide <<
" x_M : " << x_coord <<
" z_M : " << z_coord <<
" z_interface : " << position_cylindre[2] +
L_cube_<<
" frac_vol : " << f_ik * volume_maille << finl;
1611 Cout <<
" " << finl;
1614 masse_fluide += volume_maille * rho_fluide;
1615 volume += volume_maille;
1621 integrale_force(itube, direction) = delta_qdm_cylindre;
1622 masse_fluide_cylindres(itube, direction) = masse_fluide;
1623 volume_cylindres(itube, direction) = volume;
1638 const IJK_Field_double& rho_fluide_field,
1639 DoubleTab& masse_fluide_cylindres,
1640 DoubleTab& volume_cylindres,
1641 DoubleTab& integrale_force,
1645 ArrOfDouble nodes_pos[3];
1646 ArrOfDouble elem_pos[3];
1648 for (
int dir = 0; dir < 3; dir++)
1653 for (
int i = 0; i < n; i++)
1654 elem_pos[dir][i] = (nodes_pos[dir][i] + nodes_pos[dir][i+1]) * 0.5;
1660 const int ntubes = faisceau.size();
1663 for (
int itube = 0; itube < ntubes; itube++)
1665 const Tube_base& tube = faisceau[itube].valeur();
1674 Cout <<
"v_predite : " << vx(64, 0, 76) <<
" z_interface : " << position_cylindre[2] +
L_cube_ << finl;
1677 DoubleTab v_predite;
1680 for (
int direction = 0; direction < 3; direction++)
1683 const int ivoisin = (direction == 0) ? -1 : 0;
1684 const int jvoisin = (direction == 1) ? -1 : 0;
1685 const int kvoisin = (direction == 2) ? -1 : 0;
1688 IJK_Field_double& velocity = select_dir(direction, vx, vy, vz);
1692 int imax = velocity.
ni();
1693 int jmax = velocity.
nj();
1694 int kmax = velocity.
nk();
1703 const ArrOfDouble& x_coord = (direction==DIRECTION_I) ? nodes_pos[DIRECTION_I] : elem_pos[DIRECTION_I];
1704 const double xmin = position_cylindre[0] - (
L_cube_ + 2 * delta_x);
1705 const double xmax = position_cylindre[0] + (
L_cube_ + 2 * delta_x);
1707 while (imin < velocity.
ni() && x_coord[imin + offset_i] < xmin)
1709 while (imax > 0 && x_coord[imax + offset_i - 1] > xmax)
1713 const ArrOfDouble& z_coord = (direction==DIRECTION_K) ? nodes_pos[DIRECTION_K] : elem_pos[DIRECTION_K];
1714 const double zmin = position_cylindre[2] - (
L_cube_ + 2 * delta_z);
1715 const double zmax = position_cylindre[2] + (
L_cube_ + 2 * delta_z);
1717 while (kmin < velocity.
nk() && z_coord[kmin + offset_k] < zmin)
1719 while (kmax > 0 && z_coord[kmax + offset_k - 1] > zmax)
1724 double delta_qdm_cylindre = 0.;
1725 double masse_fluide = 0.;
1728 Cout <<
" " << finl;
1729 Cout <<
"dir : "<< direction <<
" x_O : " << position_cylindre[0] <<
" z_O : " << position_cylindre[2] <<
" V_maille : " << volume_maille << finl;
1730 Cout <<
" " << finl;
1734 const int N_i = imax - imin + 1;
1735 const int N_j = jmax;
1736 const int N_k = kmax - kmin + 1;
1737 v_predite.
resize(3, N_i, N_j, N_k);
1739 for (
int k = kmin; k <= kmax; k++)
1744 const double z_coord = (direction==DIRECTION_K) ? nodes_pos[DIRECTION_K][k+offset_k] : elem_pos[DIRECTION_K][k+offset_k];
1745 for (
int j = jmin; j < jmax; j++)
1748 for (
int i = imin; i <= imax; i++)
1750 const double x_coord = (direction==DIRECTION_I) ? nodes_pos[DIRECTION_I][i+offset_i] : elem_pos[DIRECTION_I][i+offset_i];
1751 const double dOMx = x_coord - position_cylindre[0];
1752 const double dOMz = z_coord - position_cylindre[2];
1753 const double ABS_dOMx = std::fabs(dOMx);
1754 const double ABS_dOMz = std::fabs(dOMz);
1755 const double Borne_min_z =
L_cube_ - delta_z / 2;
1756 const double Borne_intermediaire1_z =
L_cube_ ;
1757 const double Borne_intermediaire2_z =
L_cube_ + delta_z / 2;
1758 const double Borne_max_z =
L_cube_ + delta_z ;
1759 const double Borne_max_x =
L_cube_;
1761 v_predite(direction, i-imin, j, k-kmin) = velocity(i, j, k);
1763 if ( (ABS_dOMx <= Borne_max_x) && (ABS_dOMz <= Borne_max_z))
1766 rotation[0] = omega * (- dOMz);
1768 rotation[2] = omega * dOMx;
1769 double extrapolated_v = vitesse_cylindre[direction] + rotation[direction];
1770 double delta_v = 0.;
1771 double rho_fluide =0.;
1774 double v_k_exterieure;
1775 double v_couche_limite;
1778 if ( ABS_dOMz <= Borne_min_z)
1780 delta_v = extrapolated_v - velocity(i,j,k);
1781 rho_fluide = (rho_fluide_field(i,j,k) + rho_fluide_field(i+ivoisin, j+jvoisin, k+kvoisin)) * 0.5;
1782 delta_qdm_cylindre += delta_v * volume_maille * rho_fluide;
1785 Cout <<
"Forcage_complet "<<
"i : " << i <<
" j : " << j <<
" k : " << k <<
" x_M : " << x_coord <<
" z_M : " << z_coord <<
" v*(i,j,k) : " << velocity(i,j,k) << finl;
1790 if ( (direction==0) && ((j==0) && (i==64)) && ((k==55)|(k==76)) )
1792 Cout <<
" " << finl;
1793 Cout <<
"qdm_ijk" << i << j << k <<
" : " << delta_v * volume_maille * rho_fluide <<
" x_M : " << x_coord <<
" z_M : " << z_coord <<
" z_interface : " << position_cylindre[2]+
L_cube_ <<
" forcage_complet " << finl;
1794 Cout <<
"v_ijk" << i << j << k <<
" : " << velocity(i,j,k) <<
" x_M : " << x_coord <<
" z_M : " << z_coord <<
" z_interface : " << position_cylindre[2]+
L_cube_ <<
" forcage_complet " << finl;
1795 Cout <<
" " << finl;
1799 velocity(i, j, k) = extrapolated_v;
1800 masse_fluide += volume_maille * rho_fluide;
1801 volume += volume_maille;
1804 Cout <<
" delta_v : "<< delta_v <<
" v_S : " << extrapolated_v <<
" qdm : " << delta_v * volume_maille * rho_fluide <<
" qdm_cube : " << delta_qdm_cylindre <<
" v~*(i,j,k) : " << velocity(i, j, k) << finl;
1807 else if ( ABS_dOMz <= Borne_intermediaire1_z)
1809 d_k =
L_cube_ + delta_z / 2 - ABS_dOMz;
1810 f_k = d_k / delta_z;
1811 delta_v = f_k * (extrapolated_v - velocity(i,j,k));
1812 rho_fluide = (rho_fluide_field(i,j,k) + rho_fluide_field(i+ivoisin, j+jvoisin, k+kvoisin)) * 0.5;
1813 delta_qdm_cylindre += delta_v * volume_maille * rho_fluide;
1816 Cout <<
"Forcage_complet_qdm_partielle "<<
"i : " << i <<
" j : " << j <<
" k : " << k;
1817 Cout <<
" x_M : " << x_coord <<
" z_M : " << z_coord <<
" v*(i,j,k) : " << velocity(i,j,k) <<
" f_k : " << f_k << finl;
1822 if ( (direction==0) && ((j==0) && (i==64)) && ((k==55)|(k==76)) )
1824 Cout <<
" " << finl;
1825 Cout <<
"Forcage_complet_qdm_partielle "<<
" v*(i,j,k) : " << velocity(i,j,k) <<
" f_k : " << f_k <<
" v_S : " << extrapolated_v << finl;
1826 Cout <<
"qdm_ijk" << i << j << k <<
" : " << delta_v * volume_maille * rho_fluide <<
" x_M : " << x_coord <<
" z_M : " << z_coord <<
" z_interface : " << position_cylindre[2]+
L_cube_ << finl;
1827 Cout <<
"v_ijk" << i << j << k <<
" : " << velocity(i,j,k) <<
" x_M : " << x_coord <<
" z_M : " << z_coord <<
" z_interface : " << position_cylindre[2]+
L_cube_ << finl;
1828 Cout <<
" " << finl;
1832 velocity(i, j, k) = extrapolated_v;
1833 masse_fluide += volume_maille * rho_fluide;
1834 volume += volume_maille;
1837 Cout <<
" delta_v : "<< delta_v <<
" v_S : " << extrapolated_v <<
" qdm : " << delta_v * volume_maille * rho_fluide <<
" qdm_cube : " << delta_qdm_cylindre <<
" v~*(i,j,k) : " << velocity(i, j, k) << finl;
1840 else if ( ABS_dOMz <= Borne_intermediaire2_z)
1842 d_k =
L_cube_ + delta_z / 2 - ABS_dOMz;
1843 f_k = d_k / delta_z;
1844 double v_k_interieure;
1847 v_k_exterieure = velocity(i, j, k+1);
1848 v_k_interieure = v_predite(direction, i-imin, j, k- kmin - 1);
1853 v_k_exterieure = velocity(i, j, k-1);
1854 v_k_interieure = v_predite(direction, i-imin, j, k- kmin + 1);
1856 double v_predite_interpollee_sur_la_frontiere = ((d_k + delta_z / 2) / delta_z) * ( velocity(i,j,k) - v_k_interieure ) + v_k_interieure;
1857 delta_v = f_k * (extrapolated_v - v_predite_interpollee_sur_la_frontiere);
1858 rho_fluide = (rho_fluide_field(i,j,k) + rho_fluide_field(i+ivoisin, j+jvoisin, k+kvoisin)) * 0.5;
1859 delta_qdm_cylindre += delta_v * volume_maille * rho_fluide;
1862 Cout <<
"Forcage_couche_limite_qdm_partielle "<<
"i : " << i <<
" j : " << j <<
" k : " << k <<
" x_M : " << x_coord <<
" z_M : " << z_coord <<
" v*_int :" << v_k_interieure <<
" v*_S : ";
1863 Cout<< v_predite_interpollee_sur_la_frontiere <<
" v*(i,j,k) : " << velocity(i,j,k) <<
" v*_ext :" << v_k_exterieure <<
" f_k : " << f_k <<
" d_Cube_M : " << d_Cube_M << finl;
1865 d_Cube_M = ABS_dOMz -
L_cube_;
1866 v_couche_limite = (d_Cube_M / (d_Cube_M + delta_z )) * ( v_k_exterieure - extrapolated_v ) + extrapolated_v;
1871 if ( (direction==0) && ((j==0) && (i==64)) && ((k==55)|(k==76)) )
1873 Cout <<
" " << finl;
1874 Cout <<
"Forcage_couche_limite_qdm_partielle "<<
" v*_int :" << v_k_interieure <<
" v*_S : " << v_predite_interpollee_sur_la_frontiere <<
" v*(i,j,k) : " << velocity(i,j,k) <<
" v*_ext :" << v_k_exterieure;
1875 Cout <<
" f_k : " << f_k <<
" v_couche_limite : " << v_couche_limite <<
" v_S : " << extrapolated_v <<
" d_Cube_M : " << d_Cube_M << finl;
1876 Cout <<
"qdm_ijk" << i << j << k <<
" : " << delta_v * volume_maille * rho_fluide <<
" x_M : " << x_coord <<
" z_M : " << z_coord <<
" z_interface : " << position_cylindre[2]+
L_cube_ << finl;
1877 Cout <<
"v_ijk" << i << j << k <<
" : " << velocity(i, j, k) <<
" x_M : " << x_coord <<
" z_M : " << z_coord <<
" z_interface : " << position_cylindre[2]+
L_cube_ << finl;
1878 Cout <<
" " << finl;
1882 velocity(i, j, k) = v_couche_limite;
1883 masse_fluide += volume_maille * rho_fluide;
1884 volume += volume_maille;
1887 Cout <<
" delta_v : "<< delta_v <<
" v_S : " << extrapolated_v <<
" v_couche_limite : " << v_couche_limite <<
" qdm : " << delta_v * volume_maille * rho_fluide <<
" qdm_cube : " << delta_qdm_cylindre <<
" v~*(i,j,k) : " << velocity(i, j, k) << finl;
1893 d_Cube_M = ABS_dOMz -
L_cube_;
1896 v_k_exterieure = velocity(i, j, k+1);
1900 v_k_exterieure = velocity(i, j, k-1);
1904 Cout <<
"Forcage_couche_limite_qdm_0 "<<
"i : " << i <<
" j : " << j <<
" k : " << k <<
" x_M : " << x_coord <<
" z_M : " << z_coord;
1905 Cout <<
" v*(i,j,k) : " << velocity(i,j,k) <<
" v*_ext :" << v_k_exterieure <<
" d_Cube_M: " << d_Cube_M << finl;
1907 v_couche_limite = (d_Cube_M / (d_Cube_M + delta_z )) * ( v_k_exterieure - extrapolated_v ) + extrapolated_v;
1912 if ( (direction==0) && ((j==0) && (i==64)) && ((k==55)|(k==76)) )
1914 Cout <<
" " << finl;
1915 Cout <<
"Forcage_couche_limite_qdm0 "<<
" v*(i,j,k) : " << velocity(i,j,k) <<
" v*_ext :" << v_k_exterieure <<
" v_couche_limite : " << v_couche_limite <<
" v_S : " << extrapolated_v <<
" d_Cube_M : " << d_Cube_M << finl;
1916 Cout <<
"qdm_ijk" << i << j << k <<
" : " << delta_v * volume_maille * rho_fluide <<
" x_M : " << x_coord <<
" z_M : " << z_coord <<
" z_O : " << position_cylindre[2] << finl;
1917 Cout <<
"v_ijk" << i << j << k <<
" : " << velocity(i, j, k) <<
" x_M : " << x_coord <<
" z_M : " << z_coord <<
" z_interface : " << position_cylindre[2]+
L_cube_ << finl;
1918 Cout <<
" " << finl;
1922 velocity(i, j, k) = v_couche_limite;
1923 masse_fluide += volume_maille * rho_fluide;
1924 volume += volume_maille;
1926 Cout <<
" v_S : " << extrapolated_v <<
" v_couche_limite : " << v_couche_limite <<
" qdm_cube : " << delta_qdm_cylindre <<
" v~*(i,j,k) : " << velocity(i, j, k) << finl;
1934 integrale_force(itube, direction) = delta_qdm_cylindre;
1935 masse_fluide_cylindres(itube, direction) = masse_fluide;
1936 volume_cylindres(itube, direction) = volume;
1938 Cout <<
"integrale_force(itube, direction) " << integrale_force(itube, direction) <<
" V_S : " << volume_cylindres(itube, direction) << finl;
1943 Cout <<
"v_imposee : " << vx(64, 0, 76) <<
" z_interface : " << position_cylindre[2] +
L_cube_ << finl;
1961 const IJK_Field_double& rho_fluide_field,
1962 DoubleTab& masse_fluide_cylindres,
1963 DoubleTab& volume_cylindres,
1964 DoubleTab& integrale_force,
1968 ArrOfDouble nodes_pos[3];
1969 ArrOfDouble elem_pos[3];
1971 for (
int dir = 0; dir < 3; dir++)
1976 for (
int i = 0; i < n; i++)
1977 elem_pos[dir][i] = (nodes_pos[dir][i] + nodes_pos[dir][i+1]) * 0.5;
1983 const int ntubes = faisceau.size();
1986 for (
int itube = 0; itube < ntubes; itube++)
1988 const Tube_base& tube = faisceau[itube].valeur();
1997 Cout <<
"v_predite : " << vx(64, 0, 76) <<
" z_interface : " << position_cylindre[2] +
L_cube_ << finl;
2000 DoubleTab v_predite;
2003 for (
int direction = 0; direction < 3; direction++)
2006 const int ivoisin = (direction == 0) ? -1 : 0;
2007 const int jvoisin = (direction == 1) ? -1 : 0;
2008 const int kvoisin = (direction == 2) ? -1 : 0;
2011 IJK_Field_double& velocity = select_dir(direction, vx, vy, vz);
2015 int imax = velocity.
ni();
2016 int jmax = velocity.
nj();
2017 int kmax = velocity.
nk();
2026 const ArrOfDouble& x_coord = (direction==DIRECTION_I) ? nodes_pos[DIRECTION_I] : elem_pos[DIRECTION_I];
2027 const double xmin = position_cylindre[0] - (
L_cube_ + 2 * delta_x);
2028 const double xmax = position_cylindre[0] + (
L_cube_ + 2 * delta_x);
2030 while (imin < velocity.
ni() && x_coord[imin + offset_i] < xmin)
2032 while (imax > 0 && x_coord[imax + offset_i - 1] > xmax)
2036 const ArrOfDouble& z_coord = (direction==DIRECTION_K) ? nodes_pos[DIRECTION_K] : elem_pos[DIRECTION_K];
2037 const double zmin = position_cylindre[2] - (
L_cube_ + 2 * delta_z);
2038 const double zmax = position_cylindre[2] + (
L_cube_ + 2 * delta_z);
2040 while (kmin < velocity.
nk() && z_coord[kmin + offset_k] < zmin)
2042 while (kmax > 0 && z_coord[kmax + offset_k - 1] > zmax)
2047 double delta_qdm_cylindre = 0.;
2048 double masse_fluide = 0.;
2051 Cout <<
" " << finl;
2052 Cout <<
"dir : "<< direction <<
" x_O : " << position_cylindre[0] <<
" z_O : " << position_cylindre[2] <<
" V_maille : " << volume_maille << finl;
2053 Cout <<
" " << finl;
2057 const int N_i = imax - imin + 1;
2058 const int N_j = jmax;
2059 const int N_k = kmax - kmin + 1;
2060 v_predite.
resize(3, N_i, N_j, N_k);
2067 for (
int k = kmin; k <= kmax; k++)
2072 const double z_coord = (direction==DIRECTION_K) ? nodes_pos[DIRECTION_K][k+offset_k] : elem_pos[DIRECTION_K][k+offset_k];
2073 for (
int j = jmin; j < jmax; j++)
2076 for (
int i = imin; i <= imax; i++)
2078 const double x_coord = (direction==DIRECTION_I) ? nodes_pos[DIRECTION_I][i+offset_i] : elem_pos[DIRECTION_I][i+offset_i];
2079 const double dOMx = x_coord - position_cylindre[0];
2080 const double dOMz = z_coord - position_cylindre[2];
2081 const double ABS_dOMx = std::fabs(dOMx);
2082 const double ABS_dOMz = std::fabs(dOMz);
2083 const double Borne_min_z =
L_cube_ - delta_z / 2;
2084 const double Borne_intermediaire1_z =
L_cube_ ;
2085 const double Borne_intermediaire2_z =
L_cube_ + delta_z / 2;
2086 const double Borne_max_z =
L_cube_ + delta_z ;
2087 const double Borne_max_x =
L_cube_;
2089 v_predite(direction, i-imin, j, k-kmin) = velocity(i, j, k);
2091 if ( (ABS_dOMx <= Borne_max_x) && (ABS_dOMz <= Borne_max_z))
2094 rotation[0] = omega * (- dOMz);
2096 rotation[2] = omega * dOMx;
2097 double extrapolated_v = vitesse_cylindre[direction] + rotation[direction];
2098 double delta_v = 0.;
2099 double rho_fluide =0.;
2102 double v_k_exterieure;
2103 double v_couche_limite;
2106 if ( ABS_dOMz <= Borne_min_z)
2108 delta_v = extrapolated_v - velocity(i,j,k);
2109 rho_fluide = (rho_fluide_field(i,j,k) + rho_fluide_field(i+ivoisin, j+jvoisin, k+kvoisin)) * 0.5;
2110 delta_qdm_cylindre += delta_v * volume_maille * rho_fluide;
2113 Cout <<
"Forcage_complet "<<
"i : " << i <<
" j : " << j <<
" k : " << k <<
" x_M : " << x_coord <<
" z_M : " << z_coord <<
" v*(i,j,k) : " << velocity(i,j,k) << finl;
2118 if ( (direction==0) && ((j==0) && (i==64)) && ((k==55)|(k==76)|(k==77)|(k==78)) )
2120 Cout <<
" " << finl;
2123 qdm_76 = delta_v* volume_maille * rho_fluide;
2127 qdm_77 = delta_v* volume_maille * rho_fluide;
2131 qdm_78 = delta_v* volume_maille * rho_fluide;
2133 Cout <<
"qdm_ijk" << i << j << k <<
" : " << delta_v * volume_maille * rho_fluide <<
" x_M : " << x_coord <<
" z_M : " << z_coord <<
" z_interface : " << position_cylindre[2]+
L_cube_ <<
" forcage_complet " << finl;
2134 Cout <<
"v_ijk" << i << j << k <<
" : " << velocity(i,j,k) <<
" x_M : " << x_coord <<
" z_M : " << z_coord <<
" z_interface : " << position_cylindre[2]+
L_cube_ <<
" forcage_complet " << finl;
2135 Cout <<
" " << finl;
2139 velocity(i, j, k) = extrapolated_v;
2140 masse_fluide += volume_maille * rho_fluide;
2141 volume += volume_maille;
2144 Cout <<
" delta_v : "<< delta_v <<
" v_S : " << extrapolated_v <<
" qdm : " << delta_v * volume_maille * rho_fluide <<
" qdm_cube : " << delta_qdm_cylindre <<
" v~*(i,j,k) : " << velocity(i, j, k) << finl;
2147 else if ( ABS_dOMz <= Borne_intermediaire1_z)
2149 d_k =
L_cube_ + delta_z / 2 - ABS_dOMz;
2150 f_k = d_k / delta_z;
2151 delta_v = (extrapolated_v - velocity(i,j,k));
2152 rho_fluide = (rho_fluide_field(i,j,k) + rho_fluide_field(i+ivoisin, j+jvoisin, k+kvoisin)) * 0.5;
2153 delta_qdm_cylindre += delta_v * volume_maille * rho_fluide;
2156 Cout <<
"Forcage_complet_qdm_partielle "<<
"i : " << i <<
" j : " << j <<
" k : " << k;
2157 Cout <<
" x_M : " << x_coord <<
" z_M : " << z_coord <<
" v*(i,j,k) : " << velocity(i,j,k) <<
" f_k : " << f_k << finl;
2162 if ( (direction==0) && ((j==0) && (i==64)) && ((k==55)|(k==76)|(k==77)|(k==78)) )
2164 Cout <<
" " << finl;
2167 qdm_76 = delta_v* volume_maille * rho_fluide;
2171 qdm_77 = delta_v* volume_maille * rho_fluide;
2175 qdm_78 = delta_v* volume_maille * rho_fluide;
2177 Cout <<
"Forcage_complet_qdm_partielle "<<
" v*(i,j,k) : " << velocity(i,j,k) <<
" f_k : " << f_k <<
" v_S : " << extrapolated_v << finl;
2178 Cout <<
"qdm_ijk" << i << j << k <<
" : " << delta_v * volume_maille * rho_fluide <<
" x_M : " << x_coord <<
" z_M : " << z_coord <<
" z_interface : " << position_cylindre[2]+
L_cube_ << finl;
2179 Cout <<
"v_ijk" << i << j << k <<
" : " << velocity(i,j,k) <<
" x_M : " << x_coord <<
" z_M : " << z_coord <<
" z_interface : " << position_cylindre[2]+
L_cube_ << finl;
2180 Cout <<
" " << finl;
2184 velocity(i, j, k) = extrapolated_v;
2185 masse_fluide += volume_maille * rho_fluide;
2186 volume += volume_maille;
2189 Cout <<
" delta_v : "<< delta_v <<
" v_S : " << extrapolated_v <<
" qdm : " << delta_v * volume_maille * rho_fluide <<
" qdm_cube : " << delta_qdm_cylindre <<
" v~*(i,j,k) : " << velocity(i, j, k) << finl;
2192 else if ( ABS_dOMz <= Borne_intermediaire2_z)
2194 d_k =
L_cube_ + delta_z / 2 - ABS_dOMz;
2195 f_k = d_k / delta_z;
2199 v_k_exterieure = velocity(i, j, k+1);
2203 v_k_exterieure = velocity(i, j, k-1);
2206 Cout <<
"Forcage_couche_limite_qdm_partielle "<<
"i : " << i <<
" j : " << j <<
" k : " << k <<
" x_M : " << x_coord <<
" z_M : " << z_coord <<
" v*_int :" << v_k_interieure <<
" v*_S : ";
2207 Cout << v_predite_interpollee_sur_la_frontiere <<
" v*(i,j,k) : " << velocity(i,j,k) <<
" v*_ext :" << v_k_exterieure <<
" f_k : " << f_k <<
" d_Cube_M : " << d_Cube_M << finl;
2209 d_Cube_M = ABS_dOMz -
L_cube_;
2210 v_couche_limite = (d_Cube_M / (d_Cube_M + delta_z )) * ( v_k_exterieure - extrapolated_v ) + extrapolated_v;
2211 delta_v = (v_couche_limite -velocity(i, j, k) );
2212 rho_fluide = (rho_fluide_field(i,j,k) + rho_fluide_field(i+ivoisin, j+jvoisin, k+kvoisin)) * 0.5;
2213 delta_qdm_cylindre += delta_v * volume_maille * rho_fluide;
2218 if ( (direction==0) && ((j==0) && (i==64)) && ((k==55)|(k==76)|(k==77)|(k==78)) )
2220 Cout <<
" " << finl;
2223 qdm_76 = delta_v* volume_maille * rho_fluide;
2227 qdm_77 = delta_v* volume_maille * rho_fluide;
2231 qdm_78 = delta_v* volume_maille * rho_fluide;
2233 Cout <<
"Forcage_couche_limite_qdm_partielle "<<
" v*(i,j,k) : " << velocity(i,j,k) <<
" v*_ext :" << v_k_exterieure <<
" f_k : " << f_k <<
" v_couche_limite : " << v_couche_limite <<
" v_S : " << extrapolated_v <<
" d_Cube_M : " << d_Cube_M << finl;
2234 Cout <<
"qdm_ijk" << i << j << k <<
" : " << delta_v * volume_maille * rho_fluide <<
" x_M : " << x_coord <<
" z_M : " << z_coord <<
" z_interface : " << position_cylindre[2]+
L_cube_ << finl;
2235 Cout <<
"v_ijk" << i << j << k <<
" : " << velocity(i, j, k) <<
" x_M : " << x_coord <<
" z_M : " << z_coord <<
" z_interface : " << position_cylindre[2]+
L_cube_ << finl;
2236 Cout <<
" " << finl;
2240 velocity(i, j, k) = v_couche_limite;
2241 masse_fluide += volume_maille * rho_fluide;
2242 volume += volume_maille;
2245 Cout <<
" delta_v : "<< delta_v <<
" v_S : " << extrapolated_v <<
" v_couche_limite : " << v_couche_limite <<
" qdm : " << delta_v * volume_maille * rho_fluide <<
" qdm_cube : " << delta_qdm_cylindre <<
" v~*(i,j,k) : " << velocity(i, j, k) << finl;
2251 d_Cube_M = ABS_dOMz -
L_cube_;
2254 v_k_exterieure = velocity(i, j, k+1);
2258 v_k_exterieure = velocity(i, j, k-1);
2262 Cout <<
"Forcage_couche_limite_qdm_0 "<<
"i : " << i <<
" j : " << j <<
" k : " << k;
2263 Cout <<
" x_M : " << x_coord <<
" z_M : " << z_coord <<
" v*(i,j,k) : " << velocity(i,j,k) <<
" v*_ext :" << v_k_exterieure <<
" d_Cube_M: " << d_Cube_M << finl;
2265 v_couche_limite = (d_Cube_M / (d_Cube_M + delta_z )) * ( v_k_exterieure - extrapolated_v ) + extrapolated_v;
2266 delta_v = (v_couche_limite - velocity(i, j, k));
2267 rho_fluide = (rho_fluide_field(i,j,k) + rho_fluide_field(i+ivoisin, j+jvoisin, k+kvoisin)) * 0.5;
2268 delta_qdm_cylindre += delta_v * volume_maille * rho_fluide;
2273 if ( (direction==0) && ((j==0) && (i==64)) && ((k==55)|(k==76)|(k==77)|(k==78)) )
2275 Cout <<
" " << finl;
2278 qdm_76 = delta_v* volume_maille * rho_fluide;
2282 qdm_77 = delta_v* volume_maille * rho_fluide;
2286 qdm_78 = delta_v* volume_maille * rho_fluide;
2288 Cout <<
"Forcage_couche_limite_qdm0 "<<
" v*(i,j,k) : " << velocity(i,j,k) <<
" v*_ext :" << v_k_exterieure <<
" v_couche_limite : " << v_couche_limite <<
" v_S : " << extrapolated_v <<
" d_Cube_M : " << d_Cube_M << finl;
2289 Cout <<
"qdm_ijk" << i << j << k <<
" : " << delta_v * volume_maille * rho_fluide <<
" x_M : " << x_coord <<
" z_M : " << z_coord <<
" z_O : " << position_cylindre[2]+
L_cube_ << finl;
2290 Cout <<
"v_ijk" << i << j << k <<
" : " << velocity(i, j, k) <<
" x_M : " << x_coord <<
" z_M : " << z_coord <<
" z_interface : " << position_cylindre[2]+
L_cube_ << finl;
2291 Cout <<
" " << finl;
2295 velocity(i, j, k) = v_couche_limite;
2296 masse_fluide += volume_maille * rho_fluide;
2297 volume += volume_maille;
2299 Cout <<
" v_S : " << extrapolated_v <<
" v_couche_limite : " << v_couche_limite <<
" qdm_cube : " << delta_qdm_cylindre <<
" v~*(i,j,k) : " << velocity(i, j, k) << finl;
2308 qdm_tot = qdm_76 + qdm_77 + qdm_78;
2309 Cout <<
"qdm_tot : " << qdm_tot <<
" z_interface : " << position_cylindre[2]+
L_cube_ << finl;
2311 integrale_force(itube, direction) = delta_qdm_cylindre;
2312 masse_fluide_cylindres(itube, direction) = masse_fluide;
2313 volume_cylindres(itube, direction) = volume;
2315 Cout <<
"integrale_force(itube, direction) " << integrale_force(itube, direction) <<
" V_S : " << volume_cylindres(itube, direction) << finl;
2320 Cout <<
"v_imposee : " << vx(64, 0, 76) <<
" z_interface : " << position_cylindre[2] +
L_cube_ << finl;
2330void interpoler_vitesses_xz(
const DoubleTab& coords, DoubleTab& vitesses_interpolees,
2331 const IJK_Field_double& vx,
2332 const IJK_Field_double& vz,
2333 ArrOfDouble& result)
2337 vitesses_interpolees.
resize(n,3);
2338 ijk_interpolate(vx, coords, result);
2339 for (i = 0; i < n; i++)
2340 vitesses_interpolees(i,0)=result[i];
2341 for (i = 0; i < n; i++)
2342 vitesses_interpolees(i,1)=0.;
2343 ijk_interpolate(vz, coords, result);
2344 for (i = 0; i < n; i++)
2345 vitesses_interpolees(i,2)=result[i];
2353 const IJK_Field_double& rho_fluide_field,
2354 DoubleTab& masse_fluide_cylindres,
2355 DoubleTab& volume_cylindres,
2356 DoubleTab& integrale_force,
2360 ArrOfDouble nodes_pos[3];
2361 ArrOfDouble elem_pos[3];
2363 for (
int dir = 0; dir < 3; dir++)
2368 for (
int i = 0; i < n; i++)
2369 elem_pos[dir][i] = (nodes_pos[dir][i] + nodes_pos[dir][i+1]) * 0.5;
2376 const int ntubes = faisceau.size();
2381 DoubleTab coords(1,3);
2382 DoubleTab vitesses_interpolees(1,3);
2383 ArrOfDouble result(1);
2385 for (
int itube = 0; itube < ntubes; itube++)
2387 const Tube_base& tube = faisceau[itube].valeur();
2389 const double r_tube_min = tube_r - epsilon;
2396 for (
int direction = 0; direction < 3; direction++)
2399 const int ivoisin = (direction == 0) ? -1 : 0;
2400 const int jvoisin = (direction == 1) ? -1 : 0;
2401 const int kvoisin = (direction == 2) ? -1 : 0;
2403 IJK_Field_double& velocity = select_dir(direction, vx, vy, vz);
2407 int imax = velocity.
ni();
2408 int jmax = velocity.
nj();
2409 int kmax = velocity.
nk();
2412 const ArrOfDouble& x_coord = (direction==DIRECTION_I) ? nodes_pos[DIRECTION_I] : elem_pos[DIRECTION_I];
2413 const double xmin = position_cylindre[0] - (tube_r + epsilon);
2414 const double xmax = position_cylindre[0] + (tube_r + epsilon);
2415 while (imin < velocity.
ni() && x_coord[imin + offset_i] < xmin)
2417 while (imax > 0 && x_coord[imax + offset_i - 1] > xmax)
2421 const ArrOfDouble& z_coord = (direction==DIRECTION_K) ? nodes_pos[DIRECTION_K] : elem_pos[DIRECTION_K];
2422 const double zmin = position_cylindre[2] - (tube_r + epsilon);
2423 const double zmax = position_cylindre[2] + (tube_r + epsilon);
2424 while (kmin < velocity.
nk() && z_coord[kmin + offset_k] < zmin)
2426 while (kmax > 0 && z_coord[kmax + offset_k - 1] > zmax)
2430 double delta_qdm_cylindre = 0.;
2431 double masse_fluide = 0.;
2434 for (
int k = kmin; k < kmax; k++)
2439 const double z_coord = (direction==DIRECTION_K) ? nodes_pos[DIRECTION_K][k+offset_k] : elem_pos[DIRECTION_K][k+offset_k];
2440 for (
int j = jmin; j < jmax; j++)
2442 const double y_coord = (direction==DIRECTION_J) ? nodes_pos[DIRECTION_J][j+offset_j] : elem_pos[DIRECTION_J][j+offset_j];
2443 for (
int i = imin; i < imax; i++)
2445 const double x_coord = (direction==DIRECTION_I) ? nodes_pos[DIRECTION_I][i+offset_i] : elem_pos[DIRECTION_I][i+offset_i];
2446 const double delta_x = x_coord - position_cylindre[0];
2447 const double delta_z = z_coord - position_cylindre[2];
2448 const double d2 = delta_x * delta_x + delta_z * delta_z;
2449 const double d = sqrt(d2);
2452 if (d < tube_r && d > r_tube_min)
2458 if (direction == DIRECTION_J)
2468 normale[0] = delta_x / d;
2470 normale[2] = delta_z / d;
2472 tangente[0] = - normale[2];
2474 tangente[2] = normale[0];
2477 const double rr = tube_r * tube_r / d;
2478 coords(0,0) = position_cylindre[0] + normale[0] * rr;
2479 coords(0,1) = y_coord;
2480 coords(0,2) = position_cylindre[2] + normale[2] * rr;
2482 coords(1,0) = x_coord;
2483 coords(1,1) = y_coord;
2484 coords(1,2) = z_coord;
2486 coords(2,0) = position_cylindre[0] + normale[0] * tube_r;
2487 coords(2,1) = y_coord;
2488 coords(2,2) = position_cylindre[2] + normale[2] * tube_r;
2491 interpoler_vitesses_xz(coords, vitesses_interpolees, vx, vz, result);
2492 for (l = 0; l < 3; l++)
2493 for (m = 0; m < 3; m++)
2494 vitesses_interpolees(l,m) -= vitesse_cylindre[m];
2498 double compo_normale = 0;
2499 for (l = 0; l < 3; l++)
2500 compo_normale += (- vitesses_interpolees(0,l)*rr/d - vitesses_interpolees(1,l)) * normale[l];
2501 double compo_tan = 0;
2502 for (l = 0; l < 3; l++)
2503 compo_tan += (vitesses_interpolees(2,l) * (1 - 4*(tube_r - d) / tube_r) - vitesses_interpolees(1,l)) * tangente[l];
2506 if (tube_r - d < h_maillage)
2507 facteur = (tube_r - d) / h_maillage;
2508 if (d - r_tube_min < h_maillage)
2509 facteur = (d - r_tube_min) / h_maillage;
2511 velocity(i, j, k) += (compo_normale * normale[direction] + compo_tan * tangente[direction]) * facteur;
2521 double rho_fluide = (rho_fluide_field(i,j,k) + rho_fluide_field(i+ivoisin, j+jvoisin, k+kvoisin)) * 0.5;
2523 masse_fluide += volume_maille * rho_fluide;
2524 volume += volume_maille;
2529 integrale_force(itube, direction) = delta_qdm_cylindre;
2530 masse_fluide_cylindres(itube, direction) = masse_fluide;
2531 volume_cylindres(itube, direction) = volume;
2540 const IJK_Field_double& rho_fluide_field,
2541 DoubleTab& masse_fluide_cylindres,
2542 DoubleTab& volume_cylindres,
2543 DoubleTab& integrale_force,
2547 ArrOfDouble nodes_pos[3];
2548 ArrOfDouble elem_pos[3];
2550 for (
int dir = 0; dir < 3; dir++)
2555 for (
int i = 0; i < n; i++)
2556 elem_pos[dir][i] = (nodes_pos[dir][i] + nodes_pos[dir][i+1]) * 0.5;
2562 const int ntubes = faisceau.size();
2566 for (
int itube = 0; itube < ntubes; itube++)
2568 const Tube_base& tube = faisceau[itube].valeur();
2571 const double r_tube_min = tube_r - epsilon;
2572 const double r_tube_min_carre = r_tube_min * r_tube_min;
2578 for (
int direction = 0; direction < 3; direction++)
2581 const int ivoisin = (direction == 0) ? -1 : 0;
2582 const int jvoisin = (direction == 1) ? -1 : 0;
2583 const int kvoisin = (direction == 2) ? -1 : 0;
2588 IJK_Field_double& velocity = select_dir(direction, vx, vy, vz);
2592 int imax = velocity.
ni();
2593 int jmax = velocity.
nj();
2594 int kmax = velocity.
nk();
2597 const ArrOfDouble& x_coord = (direction==DIRECTION_I) ? nodes_pos[DIRECTION_I] : elem_pos[DIRECTION_I];
2598 const double xmin = position_cylindre[0] - (tube_r + epsilon);
2599 const double xmax = position_cylindre[0] + (tube_r + epsilon);
2600 while (imin < velocity.
ni() && x_coord[imin + offset_i] < xmin)
2602 while (imax > 0 && x_coord[imax + offset_i - 1] > xmax)
2606 const ArrOfDouble& z_coord = (direction==DIRECTION_K) ? nodes_pos[DIRECTION_K] : elem_pos[DIRECTION_K];
2607 const double zmin = position_cylindre[2] - (tube_r + epsilon);
2608 const double zmax = position_cylindre[2] + (tube_r + epsilon);
2609 while (kmin < velocity.
nk() && z_coord[kmin + offset_k] < zmin)
2611 while (kmax > 0 && z_coord[kmax + offset_k - 1] > zmax)
2615 double delta_qdm_cylindre = 0.;
2616 double masse_fluide = 0.;
2619 for (
int k = kmin; k < kmax; k++)
2624 const double z_coord = (direction==DIRECTION_K) ? nodes_pos[DIRECTION_K][k+offset_k] : elem_pos[DIRECTION_K][k+offset_k];
2625 for (
int j = jmin; j < jmax; j++)
2628 for (
int i = imin; i < imax; i++)
2630 const double x_coord = (direction==DIRECTION_I) ? nodes_pos[DIRECTION_I][i+offset_i] : elem_pos[DIRECTION_I][i+offset_i];
2631 const double delta_x = x_coord - position_cylindre[0];
2632 const double delta_z = z_coord - position_cylindre[2];
2633 const double d2 = delta_x * delta_x + delta_z * delta_z;
2634 const double d = sqrt(d2);
2635 const double rayon_tube_carre = tube_r * tube_r;
2638 if (d2 < rayon_tube_carre)
2641 rotation[0] = omega * (- delta_z);
2643 rotation[2] = omega * delta_x;
2644 double extrapolated_v = vitesse_cylindre[direction] + rotation[direction];
2647 if (d2 > r_tube_min_carre )
2649 g_etalement = 0.5 + 0.5 * (d - (tube_r - epsilon/2) ) / (epsilon * 0.5) - 0.5 / M_PI * sin( M_PI * (d - (tube_r - epsilon/2) )/ (epsilon*0.5) );
2651 const double d_interface = tube_r - d;
2652 const double beta = (tube_r + d_interface) / (tube_r - d_interface);
2653 const double delta_x_P = beta * delta_x;
2654 const double delta_z_P = beta * delta_z;
2658 const int i_min = int(floor(i + (delta_x_P - delta_x) * inv_delta_x ));
2659 const int i_max = i_min +1;
2660 const int k_min = int(floor(k + (delta_z_P - delta_z) * inv_delta_z ));
2661 const int k_max = k_min +1;
2668 const double z_12 = (direction==DIRECTION_K) ? nodes_pos[DIRECTION_K][k_max+offset_k] : elem_pos[DIRECTION_K][k_max+offset_k];
2675 const double x_21 = (direction==DIRECTION_I) ? nodes_pos[DIRECTION_I][i_max+offset_i] : elem_pos[DIRECTION_I][i_max+offset_i];
2678 const double alpha = (z_12 - ( delta_z_P + position_cylindre[2] ) ) * inv_delta_z;
2679 const double gamma = (x_21 - ( delta_x_P + position_cylindre[0] ) ) * inv_delta_x;
2687 const int gh = velocity.
ghost();
2688 const int ni = velocity.
ni();
2689 const int nk = velocity.
nk();
2690 if (i_min < -gh || k_min < -gh || i_max >= ni + gh || k_max >= nk + gh)
2692 Cerr <<
"Erreur, l'epaisseur ghost est insuffisante pour le calcul du champ mirroir ibc" << finl;
2696 const double v_11 = velocity(i_min, j, k_min);
2697 const double v_21 = velocity(i_max, j, k_min);
2698 const double v_22 = velocity(i_max, j, k_max);
2699 const double v_12 = velocity(i_min, j, k_max);
2701 const double v_P = (1-alpha) * (1-gamma) * v_11 + alpha * gamma * v_22 + alpha * (1 - gamma) * v_12 + gamma * (1 - alpha) * v_21;
2704 delta_v = (g_etalement * (-v_P + 2 * extrapolated_v) + (1-g_etalement) * extrapolated_v) - velocity(i, j, k);
2705 velocity(i, j, k) = g_etalement * (-v_P + 2 * extrapolated_v) + (1-g_etalement) * extrapolated_v;
2707 Cout <<
" direction : " << direction <<
" i : " << i <<
" j : "<< j <<
" k : " << k <<
" x_coord : " << x_coord <<
" z_coord : " << z_coord << endl;
2708 Cout <<
" i_min : " << i_min <<
" i_max : "<< i_max <<
" k_min : " << k_min <<
" k_max : " << k_max <<
" x_P " << delta_x_P + position_cylindre[0] <<
" z_P " << delta_z_P + position_cylindre[2] << endl;
2709 Cout <<
" alpha : " << alpha <<
" gamma : " << gamma <<
" x_11 " << x_11 <<
" z_11 " << z_11 <<
" x_21 " << x_21 ;
2710 Cout <<
" z_21 " << z_21 <<
" x_22 " << x_22 <<
" z_22 " << z_22 <<
" x_12 " << x_12 <<
" z_12 " << z_12 <<endl;
2711 Cout <<
" g_etalement : " << g_etalement <<
" v_P : " << v_P <<
" v(i,j,k) : " << velocity(i, j, k) <<
" v_11 " << v_11 ;
2712 Cout <<
" v_21 " << v_21 <<
" v_22 " << v_22 <<
" v_12 " << v_12 << endl;
2718 delta_v = extrapolated_v - velocity(i,j,k);
2719 velocity(i, j, k) = extrapolated_v ;
2725 double rho_fluide = (rho_fluide_field(i,j,k) + rho_fluide_field(i+ivoisin, j+jvoisin, k+kvoisin)) * 0.5;
2726 delta_qdm_cylindre += delta_v * volume_maille * rho_fluide;
2727 masse_fluide += volume_maille * rho_fluide;
2728 volume += volume_maille;
2734 integrale_force(itube, direction) = delta_qdm_cylindre;
2735 masse_fluide_cylindres(itube, direction) = masse_fluide;
2736 volume_cylindres(itube, direction) = volume;
2749 DoubleTab& integrale_force_pression, DoubleTab& pression_teta,
2753 ArrOfDouble nodes_pos[3];
2754 ArrOfDouble elem_pos[3];
2756 for (
int dir = 0; dir < 3; dir++)
2761 for (
int i = 0; i < n; i++)
2762 elem_pos[dir][i] = (nodes_pos[dir][i] + nodes_pos[dir][i+1]) * 0.5;
2766 int jmax = pressure.
nj();
2769 const int ntubes = faisceau.size();
2776 const double teta = 2 * M_PI /
n_P_;
2779 const double inv_delta_x = 1./delta_x;
2780 const double inv_delta_z = 1./delta_z;
2783 for (
int itube = 0; itube < ntubes; itube++)
2785 const Tube_base& tube = faisceau[itube].valeur();
2788 double p_surface_cylindre_x = 0.;
2789 double p_surface_cylindre_z = 0.;
2790 const double dS = tube_r * teta * delta_z;
2792 for (
int l =0; l <
n_P_; l++)
2794 P_teta(itube, l) = 0.;
2795 const double teta_l = l * teta;
2798 Pos_P(itube, l, 0) = position_cylindre[0] + tube_r * cos(teta_l);
2799 Pos_P(itube, l, 1) = position_cylindre[2] + tube_r * sin(teta_l);
2800 const double x_P_Delta_x = Pos_P(itube , l, 0) * inv_delta_x;
2801 const double z_P_Delta_z = Pos_P(itube , l, 1) * inv_delta_z;
2802 const double resu_x = x_P_Delta_x - int(floor(x_P_Delta_x));
2803 const double resu_z = z_P_Delta_z - int(floor(z_P_Delta_z));
2805 int i_min, i_max, k_min, k_max;
2808 i_min = int(floor(x_P_Delta_x))-1;
2813 i_min = int(floor(x_P_Delta_x));
2819 k_min = int(floor(z_P_Delta_z))-1;
2824 k_min = int(floor(z_P_Delta_z));
2828 const double x_21 = elem_pos[DIRECTION_I][i_max];
2829 const double z_12 = elem_pos[DIRECTION_K][k_max];
2832 const double alpha = (z_12 - ( Pos_P(itube , l, 1) ) ) * inv_delta_z;
2833 const double gamma = (x_21 - ( Pos_P(itube , l, 0) ) ) * inv_delta_x;
2838 for (
int j = jmin; j < jmax; j++)
2840 const double p_11 = pressure(i_min, j, k_min);
2841 const double p_21 = pressure(i_max, j, k_min);
2842 const double p_22 = pressure(i_max, j, k_max);
2843 const double p_12 = pressure(i_min, j, k_max);
2846 P_l_j(itube, l, j) = (1-alpha) * (1-gamma) * p_11 + alpha * gamma * p_22 + alpha * (1 - gamma) * p_12 + gamma * (1 - alpha) * p_21;
2847 p_surface_cylindre_x += P_l_j(itube, l, j) * cos(teta_l);
2848 p_surface_cylindre_z += P_l_j(itube, l, j) * sin(teta_l);
2849 P_teta(itube, l) += P_l_j(itube, l, j);
2853 pression_teta(itube, l) = P_teta(itube, l) / jmax;
2857 integrale_force_pression(itube, 0) = - dS * p_surface_cylindre_x;
2858 integrale_force_pression(itube, 1) = - dS * p_surface_cylindre_z;
2874 DoubleTab& integrale_force_pression, DoubleTab& pression_teta,
2878 ArrOfDouble nodes_pos[3];
2879 ArrOfDouble elem_pos[3];
2881 for (
int dir = 0; dir < 3; dir++)
2886 for (
int i = 0; i < n; i++)
2887 elem_pos[dir][i] = (nodes_pos[dir][i] + nodes_pos[dir][i+1]) * 0.5;
2891 int jmax = pressure.
nj();
2894 const int ntubes = faisceau.size();
2901 const double teta = 2 * M_PI /
n_P_;
2905 const double inv_delta_x = 1./delta_x;
2906 const double inv_delta_z = 1./delta_z;
2909 for (
int itube = 0; itube < ntubes; itube++)
2911 const Tube_base& tube = faisceau[itube].valeur();
2914 double p_surface_cylindre_x = 0.;
2915 double p_surface_cylindre_z = 0.;
2916 const double dS = tube_r * teta * delta_y;
2919 for (
int l =0; l <
n_P_; l++)
2921 P_teta(itube, l) = 0.;
2922 const double teta_l = l * teta;
2925 Pos_P(itube, l, 0) = position_cylindre[0] + tube_r * cos(teta_l);
2926 Pos_P(itube, l, 1) = position_cylindre[2] + tube_r * sin(teta_l);
2927 const double x_P_Delta_x = Pos_P(itube , l, 0) * inv_delta_x;
2928 const double z_P_Delta_z = Pos_P(itube , l, 1) * inv_delta_z;
2931 const int i_M = int(floor(x_P_Delta_x));
2932 const int k_M = int(floor(z_P_Delta_z));
2945 const double x_M = elem_pos[DIRECTION_I][i_M];
2946 const double z_M = elem_pos[DIRECTION_K][k_M];
2947 const double d_OM2 = (x_M - position_cylindre[0]) * (x_M - position_cylindre[0]) + (z_M - position_cylindre[2]) * (z_M - position_cylindre[2]);
2948 const double R2 = tube_r * tube_r ;
2952 const double f = (tube_r + sqrt( delta_x * delta_x + delta_z * delta_z ))/tube_r;
2954 const double x_E = position_cylindre[0] + f * ( Pos_P(itube, l, 0) - position_cylindre[0] );
2955 const double z_E = position_cylindre[2] + f * ( Pos_P(itube, l, 1) - position_cylindre[2] );
2956 const int i_E = int(floor(x_E * inv_delta_x));
2957 const int k_E = int(floor(z_E * inv_delta_z));
2970 ratio = tube_r / sqrt(d_OM2);
2977 if (i_p >= offset_i && i_p < offset_i + pressure.
ni() && k_p >= offset_k && k_p < offset_k + pressure.
nk())
2980 for (
int j = jmin; j < jmax; j++)
2983 P_l_j(itube, l, j) = pressure(i_p-offset_i, j, k_p-offset_k);
2985 p_surface_cylindre_x += P_l_j(itube, l, j) * cos(teta_l);
2986 p_surface_cylindre_z += P_l_j(itube, l, j) * sin(teta_l);
2987 P_teta(itube, l) += P_l_j(itube, l, j);
2992 pression_teta(itube, l) = P_teta(itube, l) / jmax;
2997 integrale_force_pression(itube, 0) = - dS * p_surface_cylindre_x;
2998 integrale_force_pression(itube, 1) = - dS * p_surface_cylindre_z;
3033 for (
int i = 0; i < ntubes; i++)
3039 for (
int dir = 0; dir < 3; dir++)
3045 force_appliquee[dir]= -( F_ibc_extrapole[dir] - terme_inertiel[dir]);
3050 m_a[dir] = terme_inertiel[dir];
3063 ArrOfDouble noeuds_y;
3065 const int n_element_y = noeuds_y.
size_array()-1;
3067 const double hauteur_cylindre = n_element_y * delta_y;
3079 Cout <<
"Pos : " << pos <<
" t= " << current_time << finl;
3080 Cout <<
"V : " << v <<
" t= " << current_time << finl;
3081 Cout <<
"A : " << acceleration <<
" t= " << current_time << finl;
3082 Cout <<
"C : " << C <<
" t= " << current_time << finl;
3083 Cout <<
"F : " << force_appliquee <<
" t= " << current_time << finl;
3084 Cout <<
"F_IBC : " << F_IBC <<
" t= " << current_time << finl;
3085 Cout <<
"F_IBC_post_proj : " << F_IBC_post_proj <<
" t= " << current_time << finl;
3086 Cout <<
"C_IBC : " << C_IBC <<
" t= " << current_time << finl;
3087 Cout <<
"F_P_non_adim : " << pression <<
" t= " << current_time << finl;
3089 Cout <<
"F_P : " << pression <<
" t= " << current_time << finl;
3090 Cout <<
"V_c : " << volume_cylindre <<
" t= " << current_time << finl;
3091 Cout <<
"M_F : " << masse_fluide_cylindres <<
" t= " << current_time << finl;
3092 Cout <<
"m_a : " << m_a <<
" t= " << current_time << finl;
3093 Cout <<
" " << finl;
3095 faisceau_[i]->update_vitesse_position(current_time, timestep, force_appliquee);
DoubleTab d_integrale_force_post_proj_
void force_ibc_velocity_miroir(IJK_Field_double &vx, IJK_Field_double &vy, IJK_Field_double &vz, const IJK_Field_double &rho_field, DoubleTab &masse_fluide_cylindres, DoubleTab &volume_cylindres, DoubleTab &integrale_force, const Faisceau_Tubes &) const
void ibc0_velocity_cube(IJK_Field_double &vx, IJK_Field_double &vy, IJK_Field_double &vz, const IJK_Field_double &rho_field, DoubleTab &masse_fluide_cylindres, DoubleTab &volume_cylindres, DoubleTab &integrale_force, const Faisceau_Tubes &) const
DoubleTab d_integrale_force_
void force_ibc_velocity(IJK_Field_double &vx, IJK_Field_double &vy, IJK_Field_double &vz, const IJK_Field_double &rho_field, DoubleTab &masse_fluide_cylindres, DoubleTab &volume_cylindres, DoubleTab &integrale_force, const Faisceau_Tubes &) const
DoubleTab integrale_force_pression_
void reprendre_probleme(Entree &fichier)
void update(double current_time, double timestep)
DoubleTab volume_cylindres_
void ibc_localisee_velocity_cube_qdm(IJK_Field_double &vx, IJK_Field_double &vy, IJK_Field_double &vz, const IJK_Field_double &rho_field, DoubleTab &masse_fluide_cylindres, DoubleTab &volume_cylindres, DoubleTab &integrale_force, const Faisceau_Tubes &, double current_time) const
void sauvegarder_probleme(SFichier &f)
DoubleTab integrale_force_N_moins_1_post_proj_
void calcul_F_pression2(const IJK_Field_double &pressure, const IJK_Field_double &vx, DoubleTab &integrale_force_pression, DoubleTab &pression_teta, const Faisceau_Tubes &) const
double vitesse_pour_adim_
void ibc_localisee_force_cube(IJK_Field_double &vx, IJK_Field_double &vy, IJK_Field_double &vz, const IJK_Field_double &rho_field, DoubleTab &masse_fluide_cylindres, DoubleTab &volume_cylindres, DoubleTab &integrale_force, const Faisceau_Tubes &, double current_time) const
void ibc0_force_cube(IJK_Field_double &vx, IJK_Field_double &vy, IJK_Field_double &vz, const IJK_Field_double &rho_field, DoubleTab &masse_fluide_cylindres, DoubleTab &volume_cylindres, DoubleTab &integrale_force, const Faisceau_Tubes &) const
DoubleTab integrale_force_
DoubleTab integrale_force_post_proj_
void initialize(const Domaine_IJK &)
DoubleTab masse_fluide_cylindres_
void force_ibc_velocity_symetrie_plane(IJK_Field_double &vx, IJK_Field_double &vy, IJK_Field_double &vz, const IJK_Field_double &rho_field, DoubleTab &masse_fluide_cylindres, DoubleTab &volume_cylindres, DoubleTab &integrale_force, const Faisceau_Tubes &) const
fonction_ibc pour faire le champ miroir
double epaisseur_lissage_
void force_ibc_velocity_anticipe_cube(IJK_Field_double &vx, IJK_Field_double &vy, IJK_Field_double &vz, const IJK_Field_double &rho_field, DoubleTab &masse_fluide_cylindres, DoubleTab &volume_cylindres, DoubleTab &integrale_force, const Faisceau_Tubes &, const double timestep) const
forcage anticpe dans le cas du cube
DoubleTab integrale_force_N_moins_1_
void sauvegarder_pression(SFichier &f)
void force_ibc(IJK_Field_double &vx, IJK_Field_double &vy, IJK_Field_double &vz, const IJK_Field_double &rho_field, double timestep, const IJK_Field_double &pressure, double current_time)
void ibc_localisee_velocity_cube(IJK_Field_double &vx, IJK_Field_double &vy, IJK_Field_double &vz, const IJK_Field_double &rho_field, DoubleTab &masse_fluide_cylindres, DoubleTab &volume_cylindres, DoubleTab &integrale_force, const Faisceau_Tubes &, double current_time) const
void force_ibc_velocity_frac_vol(IJK_Field_double &vx, IJK_Field_double &vy, IJK_Field_double &vz, const IJK_Field_double &rho_field, DoubleTab &masse_fluide_cylindres, DoubleTab &volume_cylindres, DoubleTab &integrale_force, const Faisceau_Tubes &) const
void ibc_diffuse_velocity_cube(IJK_Field_double &vx, IJK_Field_double &vy, IJK_Field_double &vz, const IJK_Field_double &rho_field, DoubleTab &masse_fluide_cylindres, DoubleTab &volume_cylindres, DoubleTab &integrale_force, const Faisceau_Tubes &) const
double rho_fluide_pour_adim_
void calcul_force_post_projection(IJK_Field_double &vx, IJK_Field_double &vy, IJK_Field_double &vz, const IJK_Field_double &rho_field, double timestep, double current_time)
Calcul force ibc post projection.
void champ_miroir(IJK_Field_double &vx, IJK_Field_double &vy, IJK_Field_double &vz, const IJK_Field_double &rho_field, double timestep, const IJK_Field_double &pressure)
void ibc_diffuse_force_cube(IJK_Field_double &vx, IJK_Field_double &vy, IJK_Field_double &vz, const IJK_Field_double &rho_field, DoubleTab &masse_fluide_cylindres, DoubleTab &volume_cylindres, DoubleTab &integrale_force, const Faisceau_Tubes &) const
void calcul_F_pression(const IJK_Field_double &pressure, const IJK_Field_double &vx, DoubleTab &integrale_force_pression, DoubleTab &pression_teta, const Faisceau_Tubes &) const
void forcage_anticipe(IJK_Field_double &vx, IJK_Field_double &vy, IJK_Field_double &vz, const IJK_Field_double &rho_field, double timestep, const IJK_Field_double &pressure)
This class encapsulates all the information related to the eulerian mesh for TrioIJK.
int get_offset_local(int direction) const
Returns the local offset in requested direction.
double get_constant_delta(int direction) const
Returns the size of cells in a direction.
const ArrOfDouble & get_node_coordinates(int direction) const
Returns an array with the coordinates of all nodes in the mesh in requested direction.
Class defining operators and methods for all reading operation in an input flow (file,...
const Domaine_IJK & get_domaine() const
static Objet_U & objet_global(const Nom &nom)
cherche l'objet demande dans l'Interprete_bloc courant (Interprete_bloc::interprete_courant()) et dan...
classe Objet_U Cette classe est la classe de base des Objets de TRUST
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.
Helper class to factorize the readOn method of Objet_U classes.
void ajouter(const char *keyword, const int *value, Param::Nature nat=Param::OPTIONAL)
Register an integer parameter.
int lire_avec_accolades(Entree &is)
Alias of lire_avec_accolades_depuis.
static void mp_sum_for_each_item(TRUSTArray< _TYPE_ > &x, int n=-1)
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...
void precision(int pre) override
void setf(IOS_FORMAT code) override
Classe de base des flux de sortie.
_SIZE_ size_array() const
void resize_array(_SIZE_ new_size, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
void resize(_SIZE_ n, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
_SIZE_ dimension(int d) const
const Vecteur3 & get_current_pos() const
const Vecteur3 & get_current_acceleration() const
const Nom & nom_du_tube() const
const Vecteur3 & get_current_velocity() const