TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Terme_Source_Force_Capillaire_VDF_Face.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
17#include <Terme_Source_Force_Capillaire_VDF_Face.h>
18#include <Probleme_base.h>
19#include <Domaine_Cl_VDF.h>
20#include <Domaine_VDF.h>
21#include <Cahn_Hilliard_Convection.h>
22#include <Navier_Stokes_std.h>
23#include <Milieu_Incompressible_Phase_Field.h>
24
25Implemente_instanciable_sans_constructeur( Terme_Source_Force_Capillaire_VDF_Face, "Source_Force_Capillaire_VDF_Face", Terme_Source_VDF_base ) ;
26
28{
30 return os;
31}
32
34{
36 return is;
37}
38
40{
41 const Domaine_VDF& zvdf = ref_cast(Domaine_VDF,domaine_dis);
42 const Domaine_Cl_VDF& zclvdf = ref_cast(Domaine_Cl_VDF,domaine_cl_dis);
43 iter_->associer_domaines(zvdf, zclvdf);
44 eval().associer_domaines(zvdf,zclvdf);
45}
46
48{
49 const Cahn_Hilliard_Convection& eqCH = ref_cast(Cahn_Hilliard_Convection, pb.equation("Cahn_Hilliard_Convection"));
50 const Champ_Inc_base& c = eqCH.inconnue();
51 const Champ_Inc_base& mutilde = eqCH.mutilde();
53 const bool isBeta = !sub_type(Navier_Stokes_Variable_Density, pb.equation(0));
54
55 const Champ_base& rho0 = le_milieu.masse_volumique();
56 if (!sub_type(Champ_Uniforme, rho0))
57 {
58 Cerr << "[Terme_Source_Force_Capillaire_VDF_Face] the density defined in the 'Milieu' should be uniform as it is the reference density for the Boussinesq approximation."<< finl;
59 exit();
60 }
61
62 const Champ_Don_base& rho = (isBeta) ? ref_cast(Champ_Don_base, rho0) : le_milieu.masse_volumique_variable();
63 Navier_Stokes_std& eqNS = ref_cast_non_const(Navier_Stokes_std, pb.equation(0));
64 Operateur_Grad& opgrad = eqNS.operateur_gradient();
65 opgrad.completer(); // needs to be called explicitly here because in Navier_Stokes_std::completer(), gradient.completer() is called after les_sources.completer()
66 eval().associer(c, mutilde, rho, const_cast<const Operateur_Grad&>(opgrad));
67}
68
classe Cahn_Hilliard_Convection
const Champ_Inc_base & mutilde() const
const Champ_Inc_base & inconnue() const override
Renvoie la concentration (champ inconnue de l'equation) (version const).
class Champ_Don_base base class of Given Fields (not calculated)
Class Champ_Inc_base.
Champ_Uniforme Represents a field that is constant in space and time.
class Champ_base This class is the base of the fields hierarchy.
Definition Champ_base.h:43
class Domaine_Cl_VDF
class Domaine_Cl_dis_base Domaine_Cl_dis_base objects represent discretized boundary conditions
class Domaine_VDF
Definition Domaine_VDF.h:61
class Domaine_dis_base This class is the base of the hierarchy of discretized domains.
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
void associer(const Champ_Inc_base &c, const Champ_Inc_base &mutilde, const Champ_Don_base &rho, const Operateur_Grad &opgrad)
void associer_domaines(const Domaine_dis_base &domaine, const Domaine_Cl_dis_base &domaine_cl)
const Champ_Don_base & masse_volumique_variable() const override
virtual const Champ_base & masse_volumique() const
Returns the mass density of the medium (const version).
: class Navier_Stokes_Variable_Density
Navier_Stokes_std This class carries the terms of the momentum equation.
Operateur_Grad & operateur_gradient()
Returns the gradient operator associated with the equation.
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
Classe Operateur_Grad Generic class of the hierarchy of operators computing the gradient.
virtual void completer()
Updates the references of the objects associated with the operator.
class Probleme_base It is a Probleme_U that is not a coupling.
virtual const Milieu_base & milieu() const
Returns the physical medium associated with the problem (const version).
virtual const Equation_base & equation(int) const =0
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
: class Terme_Source_Force_Capillaire_VDF_Face
void associer_domaines(const Domaine_dis_base &, const Domaine_Cl_dis_base &) override
void mettre_a_jour(double temps) override
DOES NOTHING - to override in derived classes.
Evaluateur_Source_Force_Capillaire_VDF_Face & eval()