TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Dissipation_type_helpers.h
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#ifndef Dissipation_type_helpers_included
17#define Dissipation_type_helpers_included
18
19#include <Echelle_temporelle_turbulente.h>
20#include <Taux_dissipation_turbulent.h>
21#include <Probleme_base.h>
22#include <string>
23
24/*! @brief Returns "tau" or "omega" depending on whether eq is an
25 * Echelle_temporelle_turbulente or Taux_dissipation_turbulent.
26 * Exits if the equation is neither.
27 *
28 * Use this when the source lives in the tau/omega equation itself.
29 */
30inline std::string get_dissipation_type(const Equation_base& eq)
31{
32 if (sub_type(Echelle_temporelle_turbulente, eq))
33 return "tau";
34 else if (sub_type(Taux_dissipation_turbulent, eq))
35 return "omega";
36 Process::exit("get_dissipation_type: equation is neither tau nor omega.");
37 return "";
38}
39
40/*! @brief Searches all equations in the problem for a tau or omega equation.
41 * Returns "tau" or "omega" accordingly. Exits if none is found.
42 *
43 * Use this when the source lives in the k equation and needs to discover
44 * what type of dissipation equation the problem contains.
45 */
46inline std::string find_dissipation_type(const Probleme_base& pb)
47{
48 for (int i = 0; i < pb.nombre_d_equations(); i++)
49 {
50 if (sub_type(Echelle_temporelle_turbulente, pb.equation(i)))
51 return "tau";
52 else if (sub_type(Taux_dissipation_turbulent, pb.equation(i)))
53 return "omega";
54 }
55 Process::exit("find_dissipation_type: neither tau nor omega equation found.");
56 return "";
57}
58
59#endif /* Dissipation_type_helpers_included */
classe Echelle_temporelle_turbulente Equation de transport de l'echelle temporelle turbulente (modele...
classe Equation_base Le role d'une equation est le calcul d'un ou plusieurs champs....
classe Probleme_base C'est un Probleme_U qui n'est pas un couplage.
virtual int nombre_d_equations() const =0
virtual const Equation_base & equation(int) const =0
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
Definition Process.cpp:455
classe Taux_dissipation_turbulent Equation de transport du taux de dissipation turbulen (modele k-ome...