Giesekus.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) 2019-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 "Giesekus.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::Su
47  (
48  this->alpha_*this->rho_
49  *alphaGs_[modei]*innerSqr(sigma)/this->nuM_, sigma
50  )
51  - fvm::Sp(this->alpha_*this->rho_/this->lambdas_[modei], sigma);
52 }
53 
54 
55 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
56 
57 template<class BasicMomentumTransportModel>
59 (
60  const alphaField& alpha,
61  const rhoField& rho,
62  const volVectorField& U,
63  const surfaceScalarField& alphaRhoPhi,
64  const surfaceScalarField& phi,
65  const transportModel& transport,
66  const word& type
67 )
68 :
70  (
71  alpha,
72  rho,
73  U,
74  alphaRhoPhi,
75  phi,
76  transport,
77  type
78  ),
79 
80  alphaGs_(this->readModeCoefficients("alphaG", dimless))
81 {
82  if (type == typeName)
83  {
84  this->printCoeffs(type);
85  }
86 }
87 
88 
89 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
90 
91 template<class BasicMomentumTransportModel>
93 {
95  {
96  alphaGs_ = this->readModeCoefficients("alphaG", dimless);
97 
98  return true;
99  }
100  else
101  {
102  return false;
103  }
104 }
105 
106 
107 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
108 
109 } // End namespace laminarModels
110 } // End namespace Foam
111 
112 // ************************************************************************* //
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
tmp< fvMatrix< Type > > Su(const DimensionedField< Type, volMesh > &, const GeometricField< Type, fvPatchField, volMesh > &)
virtual bool read()
Re-read model coefficients if they have changed.
Definition: Giesekus.C:92
BasicMomentumTransportModel::transportModel transportModel
Definition: Giesekus.H:89
virtual tmp< fvSymmTensorMatrix > sigmaSource(const label modei, volSymmTensorField &sigma) const
Definition: Giesekus.C:41
Giesekus(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: Giesekus.C:59
tmp< fvMatrix< Type > > Sp(const volScalarField::Internal &, const GeometricField< Type, fvPatchField, volMesh > &)
Macros for easy insertion into run-time selection tables.
BasicMomentumTransportModel::alphaField alphaField
Definition: Giesekus.H:87
phi
Definition: pEqn.H:104
A class for handling words, derived from string.
Definition: word.H:59
dimensionedSymmTensor innerSqr(const dimensionedSymmTensor &dt)
U
Definition: pEqn.H:72
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:47
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
volScalarField alpha(IOobject("alpha", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
BasicMomentumTransportModel::rhoField rhoField
Definition: Giesekus.H:88
Namespace for OpenFOAM.