simplifiedViscousStress.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2026 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
27 #include "fvmLaplacian.H"
28 #include "fvcSnGrad.H"
29 
30 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
31 
32 template<class BasicMomentumTransportModel>
35 (
36  const word& modelName,
37  const alphaField& alpha,
38  const rhoField& rho,
39  const volVectorField& U,
40  const surfaceScalarField& alphaRhoPhi,
41  const surfaceScalarField& phi,
42  const viscosity& viscosity
43 )
44 :
45  BasicMomentumTransportModel
46  (
47  modelName,
48  alpha,
49  rho,
50  U,
51  alphaRhoPhi,
52  phi,
53  viscosity
54  )
55 {}
56 
57 
58 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
59 
60 template<class BasicMomentumTransportModel>
62 {
64 }
65 
66 
67 template<class BasicMomentumTransportModel>
70 {
71  const surfaceScalarField alphaRhoNuEff
72  (
73  fvc::interpolate(this->alpha_*this->rho_*this->nuEff())
74  );
75 
77  (
78  this->groupName("devTau"),
79  -alphaRhoNuEff*fvc::snGrad(this->U_)
80  );
81 }
82 
83 
84 template<class BasicMomentumTransportModel>
85 template<class RhoFieldType>
88 (
89  const RhoFieldType& rho,
91 ) const
92 {
93  const surfaceScalarField alphaRhoNuEff
94  (
95  fvc::interpolate(this->alpha_*rho*this->nuEff())
96  );
97 
98  return -fvm::laplacian(alphaRhoNuEff, U);
99 }
100 
101 
102 template<class BasicMomentumTransportModel>
105 (
107 ) const
108 {
109  return DivDevTau(this->rho_, U);
110 }
111 
112 
113 template<class BasicMomentumTransportModel>
116 (
117  const volScalarField& rho,
119 ) const
120 {
121  return DivDevTau(rho, U);
122 }
123 
124 
125 template<class BasicMomentumTransportModel>
127 {
129 }
130 
131 
132 // ************************************************************************* //
Generic GeometricField class.
static tmp< GeometricField< Type, GeoMesh, PrimitiveField > > New(const word &name, const Internal &, const PtrList< Patch > &, const HashPtrTable< Source > &=HashPtrTable< Source >())
Return a temporary field constructed from name,.
BasicMomentumTransportModel::alphaField alphaField
tmp< fvVectorMatrix > DivDevTau(const RhoFieldType &rho, volVectorField &U) const
Return the source term for the momentum equation.
virtual tmp< surfaceVectorField > devTau() const
Return the effective surface stress.
virtual bool read()=0
Re-read model coefficients if they have changed.
simplifiedViscousStress(const word &modelName, const alphaField &alpha, const rhoField &rho, const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const viscosity &viscosity)
Construct from components.
virtual void correct()=0
Solve the turbulence equations and correct the turbulence viscosity.
virtual tmp< fvVectorMatrix > divDevTau(volVectorField &U) const
Return the source term for the momentum equation.
BasicMomentumTransportModel::rhoField rhoField
A class for managing temporary objects.
Definition: tmp.H:55
Abstract base class for all fluid physical properties.
Definition: viscosity.H:50
A class for handling words, derived from string.
Definition: word.H:63
const scalar nuEff
Calculate the snGrad of the given volField.
Calculate the matrix for the laplacian of the field.
U
Definition: pEqn.H:72
rho
Definition: pEqn.H:1
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
void correct(const RdeltaTType &rDeltaT, const RhoType &rho, volScalarField &psi, const surfaceScalarField &phiCorr, const SpType &Sp)
void read(Istream &, label &, const dictionary &)
In-place read with dictionary lookup.
static tmp< SurfaceField< Type > > interpolate(const VolField< Type > &tvf, const surfaceScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
tmp< SurfaceField< Type > > snGrad(const VolField< Type > &vf, const word &name)
Definition: fvcSnGrad.C:45
tmp< fvMatrix< Type > > laplacian(const VolField< Type > &vf, const word &name)
Definition: fvmLaplacian.C:47