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-2021 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 viscosity& viscosity,
66  const word& type
67 )
68 :
70  (
71  alpha,
72  rho,
73  U,
74  alphaRhoPhi,
75  phi,
76  viscosity,
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 // ************************************************************************* //
U
Definition: pEqn.H:72
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
volScalarField alpha(IOobject("alpha", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
const dimensionSet dimless
virtual tmp< fvSymmTensorMatrix > sigmaSource(const label modei, volSymmTensorField &sigma) const
Definition: Giesekus.C:41
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
Giesekus(const alphaField &alpha, const rhoField &rho, const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const viscosity &viscosity, const word &type=typeName)
Construct from components.
Definition: Giesekus.C:59
A class for handling words, derived from string.
Definition: word.H:59
Info<< "Reading field p\"<< endl;volScalarField p(IOobject("p", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);Info<< "Reading field U\"<< endl;volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);pressureReference pressureReference(p, simple.dict());mesh.schemes().setFluxRequired(p.name());Info<< "Reading field pa\"<< endl;volScalarField pa(IOobject("pa", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);Info<< "Reading field Ua\"<< endl;volVectorField Ua(IOobject("Ua", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);# 65 "/home/ubuntu/OpenFOAM-10/applications/solvers/incompressible/adjointShapeOptimisationFoam/createFields.H" 2label paRefCell=0;scalar paRefValue=0.0;setRefCell(pa, simple.dict(), paRefCell, paRefValue);mesh.schemes().setFluxRequired(pa.name());autoPtr< viscosityModel > viscosity(viscosityModel::New(mesh))
phi
Definition: correctPhi.H:3
dimensionedSymmTensor innerSqr(const dimensionedSymmTensor &dt)
Abstract base class for all fluid physical properties.
Definition: viscosity.H:49
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
BasicMomentumTransportModel::rhoField rhoField
Definition: Giesekus.H:88
Namespace for OpenFOAM.