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 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 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
37 
38 template<class BasicTurbulenceModel>
40 (
41  const alphaField& alpha,
42  const rhoField& rho,
43  const volVectorField& U,
44  const surfaceScalarField& alphaRhoPhi,
45  const surfaceScalarField& phi,
46  const transportModel& transport,
47  const word& propertiesName,
48  const word& type
49 )
50 :
52  (
53  alpha,
54  rho,
55  U,
56  alphaRhoPhi,
57  phi,
58  transport,
59  propertiesName,
60  type
61  ),
62 
63  alphaG_("alphaG", dimless, this->coeffDict_)
64 {
65  if (type == typeName)
66  {
67  this->printCoeffs(type);
68  }
69 }
70 
71 
72 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
73 
74 template<class BasicTurbulenceModel>
76 {
78  {
79  alphaG_.read(this->coeffDict());
80 
81  return true;
82  }
83  else
84  {
85  return false;
86  }
87 }
88 
89 
90 template<class BasicTurbulenceModel>
93 {
94  return fvm::Su
95  (
96  this->alpha_*this->rho_
97  *alphaG_*innerSqr(this->sigma_)/this->nuM_, this->sigma_
98  );
99 }
100 
101 
102 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
103 
104 } // End namespace laminarModels
105 } // End namespace Foam
106 
107 // ************************************************************************* //
surfaceScalarField & phi
BasicTurbulenceModel::alphaField alphaField
Definition: Giesekus.H:82
Maxwell model for viscoelasticity using the upper-convected time derivative of the stress tensor...
Definition: Maxwell.H:67
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:75
BasicTurbulenceModel::rhoField rhoField
Definition: Giesekus.H:83
BasicTurbulenceModel::transportModel transportModel
Definition: Giesekus.H:84
Macros for easy insertion into run-time selection tables.
Giesekus(const alphaField &alpha, const rhoField &rho, const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const transportModel &transport, const word &propertiesName=turbulenceModel::propertiesName, const word &type=typeName)
Construct from components.
Definition: Giesekus.C:40
A class for handling words, derived from string.
Definition: word.H:59
virtual tmp< fvSymmTensorMatrix > sigmaSource() const
Definition: Giesekus.C:92
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))
A class for managing temporary objects.
Definition: PtrList.H:53
Namespace for OpenFOAM.