TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Source_Con_Phase_field.h
1/****************************************************************************
2* Copyright (c) 2021, 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#ifndef Source_Con_Phase_field_included
17#define Source_Con_Phase_field_included
18
19#include <Convection_Diffusion_Concentration.h>
20#include <Source_Con_Phase_field_base.h>
21#include <Equation_base.h>
22#include <Matrice_Morse.h>
23#include <SolveurSys.h>
24#include <TRUST_Ref.h>
25#include <EChaine.h>
26#include <Table.h>
27#include <math.h>
28
29class Domaine_Cl_VDF;
30class Domaine_VDF;
31
33{
34 Declare_base(Source_Con_Phase_field);
35public:
36 int lire_motcle_non_standard(const Motcle&, Entree&) override;
37 void associer_pb(const Probleme_base&) override;
38 DoubleTab& ajouter(DoubleTab&) const override;
39 DoubleTab& calculer(DoubleTab&) const override;
40 void mettre_a_jour(double) override;
41
42 void calculer_champ_fonc_c(const double t, Champ_Don_base& champ_fonc_c, const DoubleTab& val_c) const override;
43
44 inline const DoubleVect& get_u_carre() override { return u_carre_; }
45 inline double drhodc(const int n_elem) const;
46
47protected:
50 OBS_PTR(Domaine_VDF) le_dom_VDF_;
51 OBS_PTR(Domaine_Cl_VDF) le_dom_Cl_VDF_;
52
53 DoubleVect u_carre_;
55
56 double rho0_= -123., mu1_= -123., mu2_= -123.;
57 int kappa_moy_= -123;
59 int boussi_= -123, diff_boussi_= -123;
60 int mutype_= -123, couplage_= -123;
61 int nb_equation_CH_ = -123;
62 int with_petsc_ = -123;
63 double atol_ = -123., rtol_ = -123., stol_ = -123.;
64 int maxit_newton_= -123, maxit_gmres_ = -123, nkr_= -123;
65 double erel_ = -123., umin_ = -123;
66
67 void associer_domaines(const Domaine_dis_base&, const Domaine_Cl_dis_base&) override;
68
69 void calculer_alpha_gradC_carre(DoubleTab&) const;
70 void calculer_pression_thermo(DoubleTab&) const;
71 virtual void calculer_u2_elem(DoubleVect&);
72};
73
74inline double Source_Con_Phase_field::drhodc(const int n_elem) const
75{
76 const DoubleTab& tab = drhodc_->valeurs();
77 if (tab.dimension(0) == 1)
78 {
79 int dim = tab.nb_dim();
80 double value = 0.0;
81 switch(dim)
82 {
83 case 2:
84 value = tab(0, 0);
85 break;
86 case 3:
87 value = tab(0, 0, 0);
88 break;
89 default:
90 Cerr << "Source_Con_Phase_field::drhodc : Problem with drhodc_ dimension:" << dim << finl;
92 break;
93 }
94 return value;
95 }
96 else
97 return tab(n_elem);
98}
99
100#endif /* Source_Con_Phase_field_included */
classe Champ_Don_base classe de base des Champs donnes (non calcules)
class Domaine_Cl_VDF
classe Domaine_Cl_dis_base Les objets Domaine_Cl_dis_base representent les conditions aux limites
class Domaine_VDF
Definition Domaine_VDF.h:64
classe Domaine_dis_base Cette classe est la base de la hierarchie des domaines discretisees.
Une chaine de caractere (Nom) en majuscules.
Definition Motcle.h:26
friend class Entree
Definition Objet_U.h:76
classe Probleme_base C'est un Probleme_U qui n'est pas un couplage.
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
Definition Process.cpp:455
class Source_Con_Phase_field_base
int lire_motcle_non_standard(const Motcle &, Entree &) override
Lecture des parametres de type non simple d'un objet_U a partir d'un flot d'entree.
OBS_PTR(Domaine_VDF) le_dom_VDF_
void calculer_alpha_gradC_carre(DoubleTab &) const
Calcul de alpha*(Grad(C))^2 au centre des elements.
OBS_PTR(Domaine_Cl_VDF) le_dom_Cl_VDF_
DoubleTab & ajouter(DoubleTab &) const override
void calculer_pression_thermo(DoubleTab &) const
Calcul de la pression thermodynamique aux elements.
OBS_PTR(Probleme_base) pb_
OBS_PTR(Champ_Don_base) drhodc_
virtual void calculer_u2_elem(DoubleVect &)
void mettre_a_jour(double) override
DOES NOTHING - to override in derived classes.
double drhodc(const int n_elem) const
const DoubleVect & get_u_carre() override
void associer_domaines(const Domaine_dis_base &, const Domaine_Cl_dis_base &) override
void associer_pb(const Probleme_base &) override
void calculer_champ_fonc_c(const double t, Champ_Don_base &champ_fonc_c, const DoubleTab &val_c) const override
DoubleTab & calculer(DoubleTab &) const override
int nb_dim() const
Definition TRUSTTab.h:199
_SIZE_ dimension(int d) const
Definition TRUSTTab.tpp:133