TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Courant_maille_Champ_Face.cpp
1/****************************************************************************
2* Copyright (c) 2023, 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 <Courant_maille_Champ_Face.h>
17#include <Schema_Temps_base.h>
18#include <Champ_Face_VDF.h>
19#include <Domaine_VDF.h>
20
21Implemente_instanciable(Courant_maille_Champ_Face,"Courant_maille_Champ_Face",Champ_Fonc_Face_VDF);
22
23Sortie& Courant_maille_Champ_Face::printOn(Sortie& s) const { return s << que_suis_je() << " " << le_nom(); }
24
26
28{
29 vitesse_ = la_vitesse;
30 sch_ = sch;
31}
32
33// XXX : Elie Saikali : pas utilise ... commente
34// Methode de calcul de la valeur sur une face d'un champ uniforme ou non a plusieurs composantes
35//inline double valeur(const DoubleTab &champ, const int face, const int compo, const Domaine_VDF &le_dom_VDF)
36//{
37// if (champ.dimension(0) == 1) return champ(0, compo); // Champ uniforme
38// else
39// {
40// int elem0 = le_dom_VDF.face_voisins(face, 0);
41// int elem1 = le_dom_VDF.face_voisins(face, 1);
42// if (elem1 < 0) elem1 = elem0; // face frontiere
43// return 0.5 * (champ(elem0, compo) + champ(elem1, compo));
44// }
45//}
46
48{
49 const int nb_faces = domaine_vdf().nb_faces();
50 DoubleTab& co = valeurs(); // Courant de maille
51 double dt = sch_->pas_de_temps();
52 for (int face = 0; face < nb_faces; face++)
53 {
54 // Calcul de la taille de maille entourant la face
55 double taille_maille = domaine_vdf().volumes_entrelaces()(face) / domaine_vdf().face_surfaces(face);
56 // Calcul du Courant de maille
57 co(face) = std::fabs(vitesse_->valeurs()(face)) * dt / taille_maille; // Courant_maille = |Uface| * dt / taille_maille
58 }
59
60 changer_temps(tps);
62}
DoubleTab & valeurs() override
Surcharge Champ_base::valeurs() Renvoie le tableau des valeurs.
class Champ_Face_VDF Cette classe sert a representer un champ vectoriel dont on ne calcule
classe Champ_Fonc_Face_VDF
const Domaine_VDF & domaine_vdf() const override
void mettre_a_jour(double temps) override
Mise a jour en temps du champ.
virtual double changer_temps(const double t)
Fixe le temps auquel se situe le champ.
void mettre_a_jour(double) override
Mise a jour en temps du champ.
void associer_champ(const Champ_Face_VDF &, const Schema_Temps_base &)
virtual const DoubleVect & face_surfaces() const
Definition Domaine_VF.h:51
int nb_faces() const
renvoie le nombre global de faces.
Definition Domaine_VF.h:471
DoubleVect & volumes_entrelaces()
Definition Domaine_VF.h:99
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
const Nom & le_nom() const override
Renvoie le nom du champ.
const Nom & que_suis_je() const
renvoie la chaine identifiant la classe.
Definition Objet_U.cpp:104
virtual Entree & readOn(Entree &)
Lecture d'un Objet_U sur un flot d'entree Methode a surcharger.
Definition Objet_U.cpp:293
virtual Sortie & printOn(Sortie &) const
Ecriture de l'objet sur un flot de sortie Methode a surcharger.
Definition Objet_U.cpp:282
class Schema_Temps_base
Classe de base des flux de sortie.
Definition Sortie.h:52