TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Champ_front_contact_fictif_VEF.cpp
1/****************************************************************************
2* Copyright (c) 2026, CEA
3* All rights reserved.
4*
5* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
9*
10* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
11* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
12* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
13*
14*****************************************************************************/
15
16#include <Champ_front_contact_fictif_VEF.h>
17#include <Probleme_base.h>
18#include <Champ_Uniforme.h>
19#include <Fluide_Incompressible.h>
20#include <Interprete.h>
21#include <Domaine.h>
22#include <Champ_Fonc_P0_VEF.h>
23
24Implemente_instanciable(Champ_front_contact_fictif_VEF,"Champ_front_contact_fictif_VEF",Champ_front_contact_VEF);
25
26
28{
29 return os;
30}
31
32
34{
36 is >> conduct_fictif >> ep_fictif ;
37 Cerr << "Champ_front_contact_fictif_VEF::readOn : " << nom_pb1 << nom_bord1 << finl;
38 Cerr << " connecte a : " << nom_pb2 << nom_bord2 << finl;
39 //connect_est_remplit=0;
40 return is;
41}
42
44{
45
46
47 const Frontiere& la_front=la_frontiere_dis->frontiere();
48 int nb_faces=la_front.nb_faces();
49 DoubleTab& tab=valeurs();
50
51 // Retrieve the coefficients gradient_num_transf and gradient_fro_transf from the other problem
52 DoubleVect gradient_num_transf_autre_pb(nb_faces);
53 DoubleVect gradient_fro_transf_autre_pb(nb_faces);
54 if (!ch_fr_autre_pb)
55 {
56 Cerr << "Warning: You are using a Champ_front_contact_fictif_VEF contact condition on boundary " << nom_bord1 << " of problem "<< nom_pb1 <<" " << finl;
57 Cerr << "You must have an equivalent Champ_front_contact_fictif_VEF on boundary " << nom_bord2 << " of problem "<<nom_pb2<<" " << finl;
59 }
60 trace_face_raccord(fr_vf_autre_pb.valeur(),ch_fr_autre_pb->get_gradient_num_transf(),gradient_num_transf_autre_pb);
61 trace_face_raccord(fr_vf_autre_pb.valeur(),ch_fr_autre_pb->get_gradient_fro_transf(),gradient_fro_transf_autre_pb);
62
63
64 // PQ : 10/09/07 : for readability, we rename the arrays used
65 // in the wall temperature computation, so that we have :
66 //
67 // h1.Tf1 + (h2.hs/(h2+hs)). Tf2
68 // Tw_1 = ------------------------------
69 // (h1+hs) - (hs*hs/(h2+hs))
70 //
71 // with:
72
73 double hs = conduct_fictif / ep_fictif; // heat transfer coefficient of the fictitious solid
74 DoubleVect& h1Tf1=(gradient_num_local); // temperature of fluid 1
75 DoubleVect& h1=(gradient_fro_local); // heat transfer coefficient of fluid 1
76 DoubleVect& h2Tf2=(gradient_num_transf_autre_pb); // temperature of fluid 2
77 DoubleVect& h2=(gradient_fro_transf_autre_pb); // heat transfer coefficient of fluid 2
78
79
80 // Computation of the imposed temperature
81 int fac_front;
82 for (fac_front=0; fac_front<nb_faces; fac_front++)
83 {
84 tab(fac_front,0)= -( h1Tf1(fac_front) + (hs*h2Tf2(fac_front)/(hs+h2(fac_front))) )
85 / ( hs+h1(fac_front) - (hs*hs/(hs+h2(fac_front))) );
86
87 // Cerr << " H1 " << h1(fac_front) << finl;
88 // Cerr << " T1 " << Tf1(fac_front) << finl;
89 // Cerr << " H2 " << h2(fac_front) << finl;
90 // Cerr << " T2 " << Tf2(fac_front) << finl;
91 // Cerr << " Hs " << hs << finl;
92 // Cerr << " TW " << tab(fac_front,0) << finl;
93 // Cerr << " " << finl;
94
95 }
97 // Verification of the consistency of the computed boundary temperatures
98 //verifier_temperature_bord();
99}
100
virtual DoubleTab & valeurs() override
Returns the array of field values.
class Champ_front_contact_VEF Enables scalar coupling (temperature or concentration) between problems...
DoubleVect & trace_face_raccord(const Front_VF &fr_vf, const DoubleVect &y, DoubleVect &x)
class Champ_front_contact_fictif_VEF Derived class from Champ_front_contact_VEF, which itself derives...
void mettre_a_jour(double temps) override
DOES NOTHING, to override.
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
int_t nb_faces() const
Returns the number of faces of the boundary.
Definition Frontiere.h:59
virtual Entree & readOn(Entree &)
Reads an Objet_U from an input stream. Virtual method to override.
Definition Objet_U.cpp:289
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
Definition Objet_U.cpp:278
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Definition Process.cpp:466
Base class for output streams.
Definition Sortie.h:52
virtual void echange_espace_virtuel(IsExchangeBlocking exchange_type=IsExchangeBlocking::DefaultBlocking, const std::string kernel_name="noname")