generalisedNewtonian.H
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) 2018-2026 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 Class
25  Foam::laminarModels::generalisedNewtonian
26 
27 Description
28  Momentum transport model for shear-dependent Non-Newtonian flow.
29 
30 SourceFiles
31  generalisedNewtonian.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef generalisedNewtonian_H
36 #define generalisedNewtonian_H
37 
38 #include "laminarModel.H"
39 #include "linearViscousStress.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 namespace laminarModels
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class generalisedNewtonian Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 template<class BasicMomentumTransportModel>
55 :
56  public linearViscousStress<laminarModel<BasicMomentumTransportModel>>
57 {
58 
59 protected:
60 
61  // Protected data
62 
63  //- Run-time selectable generalised Newtonian viscosity model
65 
66 
67 public:
68 
69  typedef typename BasicMomentumTransportModel::alphaField alphaField;
70  typedef typename BasicMomentumTransportModel::rhoField rhoField;
71 
72 
73  //- Runtime type information
74  TypeName("generalisedNewtonian");
75 
76 
77  // Constructors
78 
79  //- Construct from components
81  (
82  const alphaField& alpha,
83  const rhoField& rho,
84  const volVectorField& U,
85  const surfaceScalarField& alphaRhoPhi,
86  const surfaceScalarField& phi,
87  const viscosity& viscosity,
88  const word& type = typeName
89  );
90 
91 
92  // Selectors
93 
94  //- Return a reference to the selected momentum transport model
96  (
97  const alphaField& alpha,
98  const rhoField& rho,
99  const volVectorField& U,
100  const surfaceScalarField& alphaRhoPhi,
101  const surfaceScalarField& phi,
102  const viscosity& viscosity
103  );
104 
105 
106  //- Destructor
107  virtual ~generalisedNewtonian()
108  {}
109 
110 
111  // Member Functions
112 
113  //- Read momentumTransport dictionary
114  virtual bool read();
115 
116  //- Return the effective viscosity
117  // i.e. the generalisedNewtonian viscosity
118  virtual tmp<volScalarField> nuEff() const;
119 
120  //- Return the effective viscosity on patch
121  virtual tmp<scalarField> nuEff(const label patchi) const;
122 
123  //- Predict the generalisedNewtonian viscosity
124  virtual void predict();
125 
126  //- The generalisedNewtonian viscosity is not corrected
127  virtual void correct()
128  {}
129 };
130 
131 
132 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
133 
134 } // End namespace laminarModels
135 } // End namespace Foam
136 
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138 
139 #ifdef NoRepository
140  #include "generalisedNewtonian.C"
141 #endif
142 
143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144 
145 #endif
146 
147 // ************************************************************************* //
Generic GeometricField class.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
Momentum transport model for shear-dependent Non-Newtonian flow.
BasicMomentumTransportModel::alphaField alphaField
autoPtr< generalisedNewtonianViscosityModel > viscosityModel_
Run-time selectable generalised Newtonian viscosity model.
virtual void predict()
Predict the generalisedNewtonian viscosity.
virtual tmp< volScalarField > nuEff() const
Return the effective viscosity.
virtual void correct()
The generalisedNewtonian viscosity is not corrected.
static autoPtr< generalisedNewtonian > New(const alphaField &alpha, const rhoField &rho, const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const viscosity &viscosity)
Return a reference to the selected momentum transport model.
TypeName("generalisedNewtonian")
Runtime type information.
generalisedNewtonian(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.
virtual bool read()
Read momentumTransport dictionary.
BasicMomentumTransportModel::rhoField rhoField
Linear viscous stress momentum transport model base class.
A class for managing temporary objects.
Definition: tmp.H:55
Template function which returns the un-mangled name of a given type. Useful for types which do not ha...
Abstract base class for all fluid physical properties.
Definition: viscosity.H:50
A class for handling words, derived from string.
Definition: word.H:63
label patchi
U
Definition: pEqn.H:72
rho
Definition: pEqn.H:1
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
Namespace for OpenFOAM.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488