TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Paroi_Knudsen_non_negligeable.cpp
1/****************************************************************************
2* Copyright (c) 2024, 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 <Paroi_Knudsen_non_negligeable.h>
17#include <Champ_front_fonc_gradient.h>
18#include <Discretisation_base.h>
19
20Implemente_instanciable(Paroi_Knudsen_non_negligeable, "Paroi_Knudsen_non_negligeable", Dirichlet_paroi_defilante);
21// XD paroi_knudsen_non_negligeable dirichlet paroi_knudsen_non_negligeable INHERITS_BRACE Boundary condition for number
22// XD_CONT of Knudsen (Kn) above 0.001 where slip-flow condition appears: the velocity near the wall depends on the
23// XD_CONT shear stress : Kn=l/L with l is the mean-free-path of the molecules and L a characteristic length scale. NL2
24// XD_CONT U(y=0)-Uwall=k(dU/dY) NL2 Where k is a coefficient given by several laws: NL2 Mawxell : k=(2-s)*l/s NL2
25// XD_CONT Bestok\&Karniadakis :k=(2-s)/s*L*Kn/(1+Kn) NL2 Xue\&Fan :k=(2-s)/s*L*tanh(Kn) NL2 s is a value between 0 and
26// XD_CONT 2 named accomodation coefficient. s=1 seems a good value. NL2 Warning : The keyword is available for VDF
27// XD_CONT calculation only for the moment.
28// XD attr name_champ_1 chaine(into=["vitesse_paroi","k"]) name_champ_1 REQ Field name.
29// XD attr champ_1 front_field_base champ_1 REQ Boundary field type.
30// XD attr name_champ_2 chaine(into=["vitesse_paroi","k"]) name_champ_2 REQ Field name.
31// XD attr champ_2 front_field_base champ_2 REQ Boundary field type.
32
33
34Sortie& Paroi_Knudsen_non_negligeable::printOn(Sortie& s) const { return s << que_suis_je() << finl; }
35
37{
38 if (app_domains.size() == 0) app_domains = { Motcle("Hydraulique"), Motcle("indetermine") };
39
40 Cerr << "Paroi_Knudsen_non_negligeable::readOn" << finl;
41 Motcle mot;
42 Motcles les_motcles(3);
43 {
44 les_motcles[0] = "vitesse_paroi";
45 les_motcles[1] = "k";
46 }
47 int nb_champs_lus = 0;
48 while (nb_champs_lus < 2)
49 {
50 s >> mot;
51 int rang = les_motcles.search(mot);
52 if (rang == 0)
53 s >> vitesse_paroi_;
54 if (rang == 1)
55 s >> k_;
56 nb_champs_lus++;
57 }
58
59 le_champ_front.typer("Champ_front_fonc_gradient");
60 le_champ_front->fixer_nb_comp(dimension);
61 return s;
62}
63
65{
66 Cerr << "Paroi_Knudsen_non_negligeable::completer" << finl;
67 Nom type = "Champ_front_fonc_gradient_";
69 // Final type based on the discretization
70 Frontiere_dis_base& fr = le_champ_front->frontiere_dis();
71 le_champ_front.typer(type);
72 le_champ_front->associer_fr_dis_base(fr);
73 // Sliding wall: le_champ_front is the velocity with
74 // as many components as the problem dimension... Is it useful to size
75 // it now?
76 le_champ_front->fixer_nb_comp(dimension);
77 // Associate the unknown:
78 Champ_front_fonc_gradient& ch = ref_cast(Champ_front_fonc_gradient, le_champ_front.valeur());
79 ch.associer_ch_inc_base(domaine_Cl_dis().equation().inconnue());
80 Cerr << "Paroi_Knudsen_non_negligeable::completer OK" << finl;
81}
class Champ_front_fonc_gradient
void associer_ch_inc_base(const Champ_Inc_base &)
Domaine_Cl_dis_base & domaine_Cl_dis()
Returns the domain of discretized boundary conditions to which the object belongs.
std::vector< Motcle > app_domains
Dirichlet_paroi_defilante Imposes the wall velocity in an equation of type Navier_Stokes.
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
const Discretisation_base & discretisation() const
Returns the discretization associated with the equation.
class Frontiere_dis_base Class representing a discretized boundary.
const Equation_base & equation() const
Returns the reference to the equation pointed to by MorEqn::mon_equation.
Definition MorEqn.h:62
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
static int dimension
Definition Objet_U.h:94
const Nom & que_suis_je() const
Returns the string identifying the class.
Definition Objet_U.cpp:104
virtual Entree & readOn(Entree &)
Reads an Objet_U from an input stream. Virtual method to override.
Definition Objet_U.cpp:289
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
Definition Objet_U.cpp:278
Paroi_Knudsen_non_negligeable Imposes a wall velocity slip in a Navier_Stokes type equation,...
void completer() override
DOES NOTHING must be overridden in derived classes.
Base class for output streams.
Definition Sortie.h:52