TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Terme_Source_Acceleration.h
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#ifndef Terme_Source_Acceleration_included
17#define Terme_Source_Acceleration_included
18
19#include <Champ_Fonc_base.h>
20#include <Source_base.h>
21
22#include <TRUST_Ref.h>
23#include <Motcle.h>
24
26class Probleme_base;
27class Domaine_VF;
28class Champ_Don_base;
29
31{
32 // This is a base class: see Terme_Source_Acceleration_VDF_Faces
33 Declare_base_sans_constructeur(Terme_Source_Acceleration);
34public:
35
37 void associer_pb(const Probleme_base&) override;
38 DoubleTab& calculer(DoubleTab&) const override;
39 int a_pour_Champ_Fonc(const Motcle& mot, OBS_PTR(Champ_base) &ch_ref) const override;
40 inline const Champ_Don_base& champ_vitesse() const { return champ_vitesse_; }
41 bool has_champ_vitesse() const { return bool(champ_vitesse_); }
42 inline const Champ_Don_base& omega() const { return omega_; }
43 bool has_omega() const { return bool(omega_); }
44
45protected:
46 virtual void lire_data(Entree& s);
47 virtual const Champ_Fonc_base& get_terme_source_post() const;
49 virtual const DoubleTab& calculer_vitesse_faces(DoubleTab& stockage) const = 0;
50 const DoubleTab& calculer_la_source(DoubleTab& src_faces) const;
51 virtual const Navier_Stokes_std& get_eq_hydraulique() const;
52 void mettre_a_jour(double temps) override;
53
54
55private:
56// The source term, homogeneous to d/dt(rho*v) and discretized like velocity,
57// stored for post-processing purposes.
58// It is computed by ajouter() (see comments in a_pour_champ_fonc)
59 mutable OWN_PTR(Champ_Fonc_base) terme_source_post_;
60
61 // **********************************************************************
62 // velocity field imposed in the moving frame (optionally read
63 // from the data file, not used by the source term but potentially
64 // by the code to compute the velocity in the fixed frame)
65 OWN_PTR(Champ_Don_base) champ_vitesse_;
66
67 // imposed acceleration field (read from the data file)
68 // OWN_PTR(Champ_Don_base) read from the data file, homogeneous to d/dt(v) in m/(s^2).
69 // Must be a uniform vector field with "dimension" components.
70 OWN_PTR(Champ_Don_base) champ_acceleration_;
71
72 // unsteady rotation field:
73
74 // Rotation velocity: uniform field with three components
75 // (note: in 2D, vector oriented along Z)
76 OWN_PTR(Champ_Don_base) omega_;
77 // Time derivative of the rotation velocity:
78 // uniform field with three components
79 OWN_PTR(Champ_Don_base) domegadt_;
80 // Position of the rotation center:
81 // uniform field with "dimension" components
82 OWN_PTR(Champ_Don_base) centre_rotation_;
83
84
85 enum Option_TSA { TERME_COMPLET, CORIOLIS_SEUL, ENTRAINEMENT_SEUL };
86 Option_TSA option_ = TERME_COMPLET;
87 // *****************************************************************
88};
89
90#endif
class Champ_Don_base base class of Given Fields (not calculated)
class Champ_Fonc_base Base class of fields that are functions of a calculated quantity
class Champ_base This class is the base of the fields hierarchy.
Definition Champ_base.h:43
class Domaine_VF
Definition Domaine_VF.h:44
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
OBS_PTR(Equation_base) mon_equation
A character string (Nom) in uppercase.
Definition Motcle.h:26
Navier_Stokes_std This class carries the terms of the momentum equation.
class Probleme_base It is a Probleme_U that is not a coupling.
Source_base A Source_base object is a term appearing on the right-hand side of an.
Definition Source_base.h:42
const Champ_Don_base & omega() const
const Champ_Don_base & champ_vitesse() const
virtual const Navier_Stokes_std & get_eq_hydraulique() const
Returns eq_hydraulique_ !
DoubleTab & calculer(DoubleTab &) const override
resu=0; ajouter(resu); (calls ajouter() of the derived class)
const DoubleTab & calculer_la_source(DoubleTab &src_faces) const
Computes the value of the la_source field at faces based on - calculer_vitesse_faces().
int a_pour_Champ_Fonc(const Motcle &mot, OBS_PTR(Champ_base) &ch_ref) const override
Overridden method from Source_base.
virtual const DoubleTab & calculer_vitesse_faces(DoubleTab &stockage) const =0
void mettre_a_jour(double temps) override
Evaluates the acceleration and rotation fields at time t.
void associer_pb(const Probleme_base &) override
virtual Champ_Fonc_base & get_set_terme_source_post() const
virtual const Champ_Fonc_base & get_terme_source_post() const
virtual void lire_data(Entree &s)
Method called by readOn of derived classes Terme_Source_Acceleration_VDF_Face, .