TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Champ_Ostwald_VDF.cpp
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#include <Champ_Ostwald_VDF.h>
17#include <Champ_Uniforme.h>
18#include <Fluide_Ostwald.h>
19
20Implemente_instanciable(Champ_Ostwald_VDF, "Champ_Ostwald_VDF", Champ_Ostwald);
21
22Sortie& Champ_Ostwald_VDF::printOn(Sortie& os) const { return os << valeurs()(0, 0); }
23
24Entree& Champ_Ostwald_VDF::readOn(Entree& is) { return is; }
25
32
33/*! @brief Calcul la viscosite mu en fonction de la consistance et de l'indice de structure en utilisant la loi d'Ostwald.
34 *
35 * Pour
36 * des viscsites tres faible et tres fortes on utilise une regression
37 *
38 * @param (DoubleTab&) les viscosite au temps precedent
39 */
40
41void Champ_Ostwald_VDF::calculer_mu(DoubleTab& mu_tab)
42{
43 const double d_n = mon_fluide_->indice_struct().valeurs()(0, 0);
44
45 for (int i = 0; i < nb_valeurs_nodales(); i++)
46 {
47 if (sub_type(Champ_Uniforme, mon_fluide_->consistance()))
48 {
49 const double d_k = mon_fluide_->consistance().valeurs()(0, 0);
50 if (mu_tab[i] < 1.E-4)
51 mu_tab[i] = d_k * pow(0.5 * 1.E-4, (d_n - 1.) / 2.);
52 else if (mu_tab[i] > 1.E16)
53 mu_tab[i] = d_k * pow(0.5 * 1.E16, (d_n - 1.) / 2.);
54 else
55 mu_tab[i] = d_k * pow(0.5 * mu_tab[i], (d_n - 1.) / 2.);
56 }
57 else // K varie en fonction de la temperature
58 {
59 const DoubleTab& K_tab = mon_fluide_->consistance().valeurs();
60 if (mu_tab[i] < 1.E-4)
61 mu_tab[i] = K_tab[i] * pow(0.5 * 1.E-4, (d_n - 1.) / 2.);
62 else if (mu_tab[i] > 1.E16)
63 mu_tab[i] = K_tab[i] * pow(0.5 * 1.E16, (d_n - 1.) / 2.);
64 else
65 mu_tab[i] = K_tab[i] * pow(0.5 * mu_tab[i], (d_n - 1.) / 2.);
66 }
67 }
68}
69
70/*! @brief Calcul le champ Ostwald : calcul de D::D
71 *
72 * puis calcul de mu
73 *
74 * @param (double) temps ou le calcul est effectue
75 */
76
78{
79 if (temps_ != tps)
80 {
81 // Cerr<< "Calcul de Mu Ostwald"<<finl;
82 mon_champ_->calculer_dscald_centre_element(valeurs());
84 }
85}
86
87/*! @brief Initialise le champs
88 *
89 */
90int Champ_Ostwald_VDF::initialiser(const double un_temps)
91{
92 mettre_a_jour(un_temps);
93 return 1;
94}
void mettre_a_jour(double temps) override
Mise a jour en temps.
DoubleTab & valeurs() override
Surcharge Champ_base::valeurs() Renvoie le tableau des valeurs.
int nb_valeurs_nodales() const override
Renvoie le nombre de degre de liberte par composante: le nombre de noeuds.
classe Champ_Ostwald_VDF Represente un champ en discretisation VDF qui varie en fonction
void mettre_a_jour(double temps) override
Mise a jour en temps du champ.
void me_calculer(double tps) override
Calcul le champ Ostwald : calcul de D::D.
int initialiser(const double temps) override
Initialise le champs.
void calculer_mu(DoubleTab &)
Calcul la viscosite mu en fonction de la consistance et de l'indice de structure en utilisant la loi ...
classe Champ_Ostwald Represente un champ qui varie en fonction de la consistance et
classe Champ_Uniforme Represente un champ constant dans l'espace et dans le temps.
double temps_
Definition Champ_base.h:123
virtual double changer_temps(const double t)
Fixe le temps auquel se situe le champ.
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
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
Classe de base des flux de sortie.
Definition Sortie.h:52