PTT.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) 2020 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 
26 #include "PTT.H"
28 
29 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
30 
31 namespace Foam
32 {
33 namespace laminarModels
34 {
35 
36 // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
37 
38 template<class BasicMomentumTransportModel>
39 tmp<fvSymmTensorMatrix>
41 (
42  const label modei,
43  volSymmTensorField& sigma
44 ) const
45 {
46  return -fvm::Sp
47  (
48  this->alpha_*this->rho_
49  *exp(-epsilons_[modei]*this->lambdas_[modei]*tr(sigma)/this->nuM_)
50  /this->lambdas_[modei],
51  sigma
52  );
53 }
54 
55 
56 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
57 
58 template<class BasicMomentumTransportModel>
60 (
61  const alphaField& alpha,
62  const rhoField& rho,
63  const volVectorField& U,
64  const surfaceScalarField& alphaRhoPhi,
65  const surfaceScalarField& phi,
66  const transportModel& transport,
67  const word& type
68 )
69 :
71  (
72  alpha,
73  rho,
74  U,
75  alphaRhoPhi,
76  phi,
77  transport,
78  type
79  ),
80 
81  epsilons_(this->readModeCoefficients("epsilon", dimless))
82 {
83  if (type == typeName)
84  {
85  this->printCoeffs(type);
86  }
87 }
88 
89 
90 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
91 
92 template<class BasicMomentumTransportModel>
94 {
96  {
97  epsilons_ = this->readModeCoefficients("epsilon", dimless);
98 
99  return true;
100  }
101  else
102  {
103  return false;
104  }
105 }
106 
107 
108 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
109 
110 } // End namespace laminarModels
111 } // End namespace Foam
112 
113 // ************************************************************************* //
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Generalised Maxwell model for viscoelasticity using the upper-convected time derivative of the stress...
Definition: Maxwell.H:76
volScalarField alpha(IOobject("alpha", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
PTT(const alphaField &alpha, const rhoField &rho, const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const transportModel &transport, const word &type=typeName)
Construct from components.
Definition: PTT.C:60
const dimensionSet dimless
BasicMomentumTransportModel::rhoField rhoField
Definition: laminarModel.H:77
tmp< fvMatrix< Type > > Sp(const volScalarField::Internal &, const GeometricField< Type, fvPatchField, volMesh > &)
BasicMomentumTransportModel::alphaField alphaField
Definition: laminarModel.H:76
BasicMomentumTransportModel::transportModel transportModel
Definition: laminarModel.H:78
Macros for easy insertion into run-time selection tables.
virtual bool read()
Re-read model coefficients if they have changed.
Definition: PTT.C:93
dimensionedScalar exp(const dimensionedScalar &ds)
A class for handling words, derived from string.
Definition: word.H:59
phi
Definition: correctPhi.H:3
dimensionedScalar tr(const dimensionedSphericalTensor &dt)
U
Definition: pEqn.H:72
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
virtual tmp< fvSymmTensorMatrix > sigmaSource(const label modei, volSymmTensorField &sigma) const
Definition: PTT.C:41
Namespace for OpenFOAM.