TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Perte_Charge_Isotrope_VEF_P1NC.cpp
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#include <Perte_Charge_Isotrope_VEF_P1NC.h>
17#include <Motcle.h>
18#include <Equation_base.h>
19
20Implemente_instanciable(Perte_Charge_Isotrope_VEF_P1NC,"Perte_Charge_Isotrope_VEF_P1NC",Perte_Charge_VEF);
21// XD perte_charge_isotrope source_base perte_charge_isotrope BRACE Isotropic pressure loss (available in VEF and
22// XD_CONT PolyMAC_CDO).
23// XD attr lambda chaine lambda_u REQ Function for loss coefficient which may be Reynolds dependant (Ex: 64/Re).
24// XD attr diam_hydr champ_don_base diam_hydr REQ Hydraulic diameter value.
25// XD attr sous_zone chaine sous_zone OPT Optional sub-area where pressure loss applies.
26// XD attr regul bloc_lecture regul OPT Optional parameter for pressure drop coefficient regulation on target flow rate.
27// XD attr surface bloc_lecture surface OPT Optional parameter for surface used to impose the pressure drop.
28
30{
31 return s << que_suis_je() << finl;
32}
33
35{
37 return s;
38}
39
40////////////////////////////////////////////////////////////////
41// //
42// Main function: pressure drop coefficients //
43// //
44////////////////////////////////////////////////////////////////
45
46void Perte_Charge_Isotrope_VEF_P1NC::coeffs_perte_charge(const DoubleVect& u, const DoubleVect& pos,
47 double t, double norme_u, double dh, double nu, double reynolds, double& coeff_ortho, double& coeff_long,double& u_l, DoubleVect& v_valeur) const
48{
49 // Compute lambda
50 lambda.setVar(0,reynolds);
51 lambda.setVar(1,t);
52 lambda.setVar(2,pos[0]);
53 if (dimension>1)
54 lambda.setVar(3,pos[1]);
55 if (dimension>2)
56 lambda.setVar(4,pos[2]);
57
58 // Compute the result
59 coeff_ortho=lambda.eval()*norme_u/2./dh;
60 coeff_long=coeff_ortho;
61 // v is unused since coeff_ortho=coeff_long
62 // for (int dim=0;dim<dimension;dim++)
63 // p_charge[dim] = -lambda.eval()*norme_u/2./dh*u[dim];
64 u_l=0;
65}
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
static int dimension
Definition Objet_U.h:94
const Nom & que_suis_je() const
Returns the string identifying the class.
Definition Objet_U.cpp:104
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
Isotropic pressure drop (proportional to -u).
void coeffs_perte_charge(const DoubleVect &u, const DoubleVect &pos, double t, double norme_u, double dh, double nu, double reynolds, double &coeff_ortho, double &coeff_long, double &u_l, DoubleVect &v_valeur) const override
Implements the effective computation of the pressure drop at a given location.
Factorizes the common functionality of several pressure drop operators in VEF, velocity at faces.
Base class for output streams.
Definition Sortie.h:52