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  Copyright (C) 2021 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::laminarModels::generalizedNewtonian
29 
30 Description
31  Turbulence model for shear-dependent Non-Newtonian flow.
32 
33 SourceFiles
34  generalizedNewtonian.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef generalizedNewtonian_H
39 #define generalizedNewtonian_H
40 
41 #include "laminarModel.H"
42 #include "linearViscousStress.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 namespace laminarModels
50 {
51 
52 /*---------------------------------------------------------------------------*\
53  Class generalizedNewtonian Declaration
54 \*---------------------------------------------------------------------------*/
55 
56 template<class BasicMomentumTransportModel>
58 :
59  public linearViscousStress<laminarModel<BasicMomentumTransportModel>>
60 {
61 protected:
62 
63  // Protected Data
64 
65  //- Run-time selectable non-Newtonian viscosity model
67 
68  //- The non-Newtonian viscosity field
70 
71 
72  // Protected Member Functions
73 
74  virtual tmp<volScalarField> strainRate() const;
75 
76 
77 public:
78 
79  typedef typename BasicMomentumTransportModel::alphaField alphaField;
80  typedef typename BasicMomentumTransportModel::rhoField rhoField;
81  typedef typename BasicMomentumTransportModel::transportModel transportModel;
82 
83 
84  //- Runtime type information
85  TypeName("generalizedNewtonian");
86 
87 
88  // Constructors
89 
90  //- Construct from components
92  (
93  const alphaField& alpha,
94  const rhoField& rho,
95  const volVectorField& U,
96  const surfaceScalarField& alphaRhoPhi,
97  const surfaceScalarField& phi,
98  const transportModel& transport,
99  const word& propertiesName
100  );
101 
102 
103  // Selectors
104 
105  //- Return a reference to the selected turbulence model
107  (
108  const alphaField& alpha,
109  const rhoField& rho,
110  const volVectorField& U,
111  const surfaceScalarField& alphaRhoPhi,
112  const surfaceScalarField& phi,
113  const transportModel& transport,
114  const word& propertiesName
115  );
116 
117 
118  //- Destructor
119  virtual ~generalizedNewtonian() = default;
120 
121 
122  // Member Functions
123 
124  //- Read turbulence (momentumTransport) dictionary
125  virtual bool read();
126 
127  //- Return the turbulence viscosity,
128  virtual tmp<volScalarField> nut() const;
129 
130  //- Return the turbulence viscosity on patch
131  virtual tmp<scalarField> nut(const label patchi) const;
132 
133  //- Return the effective viscosity
134  virtual tmp<volScalarField> nuEff() const;
135 
136  //- Return the effective viscosity on patch
137  virtual tmp<scalarField> nuEff(const label patchi) const;
138 
139  //- Correct the generalizedNewtonian viscosity
140  virtual void correct();
141 };
142 
143 
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 
146 } // End namespace laminarModels
147 } // End namespace Foam
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 #ifdef NoRepository
152  #include "generalizedNewtonian.C"
153 #endif
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 #endif
158 
159 // ************************************************************************* //
Foam::laminarModels::generalizedNewtonian::nut
virtual tmp< volScalarField > nut() const
Return the turbulence viscosity,.
Definition: generalizedNewtonian.C:115
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
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::nu_
volScalarField nu_
The non-Newtonian viscosity field.
Definition: generalizedNewtonian.H:68
rho
rho
Definition: readInitialConditions.H:88
Foam::laminarModels::generalizedNewtonian::rhoField
BasicMomentumTransportModel::rhoField rhoField
Definition: generalizedNewtonian.H:79
Foam::laminarModels::generalizedNewtonian::read
virtual bool read()
Read turbulence (momentumTransport) dictionary.
Definition: generalizedNewtonian.C:105
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:56
Foam::laminarModels::generalizedNewtonian::viscosityModel_
autoPtr< generalizedNewtonianViscosityModel > viscosityModel_
Run-time selectable non-Newtonian viscosity model.
Definition: generalizedNewtonian.H:65
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
Foam::laminarModels::generalizedNewtonian::alphaField
BasicMomentumTransportModel::alphaField alphaField
Definition: generalizedNewtonian.H:78
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:161
Foam::laminarModels::generalizedNewtonian::transportModel
BasicMomentumTransportModel::transportModel transportModel
Definition: generalizedNewtonian.H:80
Foam::GeometricField< scalar, fvPatchField, volMesh >
generalizedNewtonianViscosityModel.H
Foam::laminarModels::generalizedNewtonian::strainRate
virtual tmp< volScalarField > strainRate() const
Definition: generalizedNewtonian.C:96
linearViscousStress.H