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-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::laminarModels::generalizedNewtonian
29
30Description
31 Turbulence model for shear-dependent Non-Newtonian flow.
32
33SourceFiles
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
47namespace Foam
48{
49namespace laminarModels
50{
51
52/*---------------------------------------------------------------------------*\
53 Class generalizedNewtonian Declaration
54\*---------------------------------------------------------------------------*/
55
56template<class BasicMomentumTransportModel>
58:
59 public linearViscousStress<laminarModel<BasicMomentumTransportModel>>
60{
61protected:
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
77public:
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,
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// ************************************************************************* //
surfaceScalarField & phi
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
Turbulence model for shear-dependent Non-Newtonian flow.
BasicMomentumTransportModel::alphaField alphaField
virtual ~generalizedNewtonian()=default
Destructor.
autoPtr< generalizedNewtonianViscosityModel > viscosityModel_
Run-time selectable non-Newtonian viscosity model.
virtual void correct()
Correct the generalizedNewtonian viscosity.
volScalarField nu_
The non-Newtonian viscosity field.
virtual tmp< volScalarField > strainRate() const
TypeName("generalizedNewtonian")
Runtime type information.
virtual tmp< volScalarField > nuEff() const
Return the effective viscosity.
BasicMomentumTransportModel::transportModel transportModel
virtual tmp< volScalarField > nut() const
Return the turbulence viscosity,.
virtual bool read()
Read turbulence (momentumTransport) dictionary.
BasicMomentumTransportModel::rhoField rhoField
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.
Linear viscous stress turbulence model base class.
A class for managing temporary objects.
Definition: tmp.H:65
A class for handling words, derived from Foam::string.
Definition: word.H:68
U
Definition: pEqn.H:72
Namespace for OpenFOAM.
volScalarField & alpha
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73