TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Source_Diffusion_supplementaire_echelle_temp_turb.cpp
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#include <Source_Diffusion_supplementaire_echelle_temp_turb.h>
17
18#include <Echange_impose_base.h>
19#include <QDM_Multiphase.h>
20#include <Pb_Multiphase.h>
21#include <Matrix_tools.h>
22#include <Array_tools.h>
23
24#include <cmath>
25#include <vector>
26
27Implemente_base(Source_Diffusion_supplementaire_echelle_temp_turb,"Source_Diffusion_supplementaire_lin_echelle_temp_turb|Source_Diffusion_supplementaire_echelle_temp_turb", Sources_Multiphase_base);
28// XD Diffusion_supplementaire_lin_echelle_temp_turb source_base Diffusion_supplementaire_echelle_temp_turb NO_BRACE
29// XD_CONT not_set
30
32{
33 return os;
34}
35
37{
38 return is;
39}
40
42{
43 for (int j = 0 ; j<equation().domaine_Cl_dis().nb_cond_lim(); j++)
44 {
45 const Cond_lim& cond_lim_loc = equation().domaine_Cl_dis().les_conditions_limites(j);
46 if (sub_type(Echange_impose_base, cond_lim_loc.valeur()))
48 }
49}
50
51void Source_Diffusion_supplementaire_echelle_temp_turb::dimensionner_blocs(matrices_t matrices, const tabs_t& semi_impl) const
52{
53 const Domaine_VF& domaine = ref_cast(Domaine_VF, equation().domaine_dis());
54 const DoubleTab& tau = equation().inconnue().valeurs();
55 const int ne = domaine.nb_elem(), ne_tot = domaine.nb_elem_tot(), N = tau.line_size();
56
57 for (auto &&n_m : matrices)
58 if (n_m.first == "k")
59 {
60 Matrice_Morse& mat = *n_m.second;
61 Matrice_Morse mat2;
62 const DoubleTab& dep = equation().probleme().get_champ(n_m.first.c_str()).valeurs();
63 const int nc = dep.dimension_tot(0);
64 const int M = dep.line_size();
65 Stencil sten(0, 2);
66
67 for (int e = 0; e < ne; e++)
68 for (int n = 0; n < N; n++)
69 if (n < M)
70 sten.append_line(N * e + n, M * e + n);
71
72 Matrix_tools::allocate_morse_matrix(N * ne_tot, M * nc, sten, mat2);
73 mat.nb_colonnes() ? mat += mat2 : mat = mat2;
74 }
75}
DoubleTab & valeurs() override
Returns the array of field values at the current time.
virtual DoubleTab & valeurs()=0
class Cond_lim Generic class used to represent any class
Definition Cond_lim.h:31
int nb_cond_lim() const
Returns the number of boundary conditions.
const Cond_lim & les_conditions_limites(int) const
Returns the i-th boundary condition.
class Domaine_VF
Definition Domaine_VF.h:44
Echange_impose_base: This boundary condition is used only for the energy equation.
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
virtual const Champ_Inc_base & inconnue() const =0
virtual Domaine_Cl_dis_base & domaine_Cl_dis()
Returns the discretized boundary condition domain associated with the equation.
Probleme_base & probleme()
Returns the problem associated with the equation.
Matrice_Morse class - Represents a (sparse) matrix M, not necessarily square,.
int nb_colonnes() const override
Return local number of columns (=size on the current proc).
static void allocate_morse_matrix(const int nb_lines, const int nb_columns, const Stencil &stencil, Matrice_Morse &matrix, const bool &attach_stencil_to_matrix=false)
const Equation_base & equation() const
Returns the reference to the equation pointed to by MorEqn::mon_equation.
Definition MorEqn.h:62
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
const Champ_base & get_champ(const Motcle &nom) const override
Base class for output streams.
Definition Sortie.h:52
Classe Source_Diffusion_supplementaire_echelle_temp_turb Cette classe implemente la diffusion supplem...
void completer() override
Updates internal references of the Source_base object.
void dimensionner_blocs(matrices_t matrices, const tabs_t &semi_impl={}) const override
_SIZE_ dimension_tot(int) const override
Definition TRUSTTab.tpp:160
void append_line(_TYPE_)
Definition TRUSTTab.tpp:213
int line_size() const
Definition TRUSTVect.tpp:67