generalizedNewtonian.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2018-2020 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::laminarModels::generalizedNewtonian
28 
29 Description
30  Turbulence model for shear-dependent Non-Newtonian flow.
31 
32 SourceFiles
33  generalizedNewtonian.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef generalizedNewtonian_H
38 #define generalizedNewtonian_H
39 
40 #include "laminarModel.H"
41 #include "linearViscousStress.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 namespace laminarModels
49 {
50 
51 /*---------------------------------------------------------------------------*\
52  Class generalizedNewtonian Declaration
53 \*---------------------------------------------------------------------------*/
54 
55 template<class BasicMomentumTransportModel>
57 :
58  public linearViscousStress<laminarModel<BasicMomentumTransportModel>>
59 {
60 protected:
61 
62  // Protected Data
63 
64  //- Run-time selectable non-Newtonian viscosity model
66 
67  //- The non-Newtonian viscosity field
69 
70 
71  // Protected Member Functions
72 
73  virtual tmp<volScalarField> strainRate() const;
74 
75 
76 public:
77 
78  typedef typename BasicMomentumTransportModel::alphaField alphaField;
79  typedef typename BasicMomentumTransportModel::rhoField rhoField;
80  typedef typename BasicMomentumTransportModel::transportModel transportModel;
81 
82 
83  //- Runtime type information
84  TypeName("generalizedNewtonian");
85 
86 
87  // Constructors
88 
89  //- Construct from components
91  (
92  const alphaField& alpha,
93  const rhoField& rho,
94  const volVectorField& U,
95  const surfaceScalarField& alphaRhoPhi,
96  const surfaceScalarField& phi,
97  const transportModel& transport,
98  const word& propertiesName
99  );
100 
101 
102  // Selectors
103 
104  //- Return a reference to the selected turbulence model
106  (
107  const alphaField& alpha,
108  const rhoField& rho,
109  const volVectorField& U,
110  const surfaceScalarField& alphaRhoPhi,
111  const surfaceScalarField& phi,
112  const transportModel& transport,
113  const word& propertiesName
114  );
115 
116 
117  //- Destructor
118  virtual ~generalizedNewtonian() = default;
119 
120 
121  // Member Functions
122 
123  //- Read turbulence (momentumTransport) dictionary
124  virtual bool read();
125 
126  //- Return the turbulence viscosity,
127  virtual tmp<volScalarField> nut() const;
128 
129  //- Return the turbulence viscosity on patch
130  virtual tmp<scalarField> nut(const label patchi) const;
131 
132  //- Return the effective viscosity
133  virtual tmp<volScalarField> nuEff() const;
134 
135  //- Return the effective viscosity on patch
136  virtual tmp<scalarField> nuEff(const label patchi) const;
137 
138  //- Return the turbulence kinetic energy
139  virtual tmp<volScalarField> k() const;
140 
141  //- Return the turbulence kinetic energy dissipation rate,
142  virtual tmp<volScalarField> epsilon() const;
143 
144  //- Return the Reynolds stress tensor
145  virtual tmp<volSymmTensorField> R() const;
146 
147  //- Correct the generalizedNewtonian viscosity
148  virtual void correct();
149 };
150 
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 } // End namespace laminarModels
155 } // End namespace Foam
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 #ifdef NoRepository
160  #include "generalizedNewtonian.C"
161 #endif
162 
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 
165 #endif
166 
167 // ************************************************************************* //
Foam::laminarModels::generalizedNewtonian::nut
virtual tmp< volScalarField > nut() const
Return the turbulence viscosity,.
Definition: generalizedNewtonian.C:115
Foam::laminarModels::generalizedNewtonian::epsilon
virtual tmp< volScalarField > epsilon() const
Return the turbulence kinetic energy dissipation rate,.
Definition: generalizedNewtonian.C:175
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::laminarModels::generalizedNewtonian::TypeName
TypeName("generalizedNewtonian")
Runtime type information.
Foam::constant::atomic::alpha
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Definition: readThermalProperties.H:212
Foam::laminarModels::generalizedNewtonian::k
virtual tmp< volScalarField > k() const
Return the turbulence kinetic energy.
Definition: generalizedNewtonian.C:162
Foam::laminarModels::generalizedNewtonian::nu_
volScalarField nu_
The non-Newtonian viscosity field.
Definition: generalizedNewtonian.H:67
rho
rho
Definition: readInitialConditions.H:88
Foam::laminarModels::generalizedNewtonian::rhoField
BasicMomentumTransportModel::rhoField rhoField
Definition: generalizedNewtonian.H:78
Foam::laminarModels::generalizedNewtonian::read
virtual bool read()
Read turbulence (momentumTransport) dictionary.
Definition: generalizedNewtonian.C:105
Foam::laminarModels::generalizedNewtonian::R
virtual tmp< volSymmTensorField > R() const
Return the Reynolds stress tensor.
Definition: generalizedNewtonian.C:188
Foam::laminarModels::generalizedNewtonian::New
static autoPtr< generalizedNewtonian > New(const alphaField &alpha, const rhoField &rho, const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const transportModel &transport, const word &propertiesName)
Return a reference to the selected turbulence model.
Foam::linearViscousStress
Linear viscous stress turbulence model base class.
Definition: linearViscousStress.H:53
Foam::laminarModels::generalizedNewtonian
Turbulence model for shear-dependent Non-Newtonian flow.
Definition: generalizedNewtonian.H:55
Foam::laminarModels::generalizedNewtonian::viscosityModel_
autoPtr< generalizedNewtonianViscosityModel > viscosityModel_
Run-time selectable non-Newtonian viscosity model.
Definition: generalizedNewtonian.H:64
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
Foam::laminarModels::generalizedNewtonian::alphaField
BasicMomentumTransportModel::alphaField alphaField
Definition: generalizedNewtonian.H:77
Foam::laminarModels::generalizedNewtonian::~generalizedNewtonian
virtual ~generalizedNewtonian()=default
Destructor.
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::laminarModels::generalizedNewtonian::nuEff
virtual tmp< volScalarField > nuEff() const
Return the effective viscosity.
Definition: generalizedNewtonian.C:139
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
U
U
Definition: pEqn.H:72
laminarModel.H
Foam::laminarModels::generalizedNewtonian::generalizedNewtonian
generalizedNewtonian(const alphaField &alpha, const rhoField &rho, const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const transportModel &transport, const word &propertiesName)
Construct from components.
Definition: generalizedNewtonian.C:47
generalizedNewtonian.C
Foam::laminarModels::generalizedNewtonian::correct
virtual void correct()
Correct the generalizedNewtonian viscosity.
Definition: generalizedNewtonian.C:200
Foam::laminarModels::generalizedNewtonian::transportModel
BasicMomentumTransportModel::transportModel transportModel
Definition: generalizedNewtonian.H:79
Foam::GeometricField< scalar, fvPatchField, volMesh >
generalizedNewtonianViscosityModel.H
Foam::laminarModels::generalizedNewtonian::strainRate
virtual tmp< volScalarField > strainRate() const
Definition: generalizedNewtonian.C:96
linearViscousStress.H