Stokes.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) 2013-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::Stokes
26 
27 Description
28  Momentum transport model for Stokes flow.
29 
30 SourceFiles
31  Stokes.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef Stokes_H
36 #define Stokes_H
37 
38 #include "laminarModel.H"
39 #include "linearViscousStress.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 namespace laminarModels
46 {
47 
48 /*---------------------------------------------------------------------------* \
49  Class Stokes Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 template
53 <
54  class BasicMomentumTransportModel,
55  template<class> class ViscousStress = linearViscousStress
56 >
57 class Stokes
58 :
59  public ViscousStress<laminarModel<BasicMomentumTransportModel>>
60 {
61 
62 public:
63 
64  typedef typename BasicMomentumTransportModel::alphaField alphaField;
65  typedef typename BasicMomentumTransportModel::rhoField rhoField;
66 
67 
68  //- Runtime type information
69  TypeName("Stokes");
70 
71 
72  // Constructors
73 
74  //- Construct from components
75  Stokes
76  (
77  const alphaField& alpha,
78  const rhoField& rho,
79  const volVectorField& U,
80  const surfaceScalarField& alphaRhoPhi,
81  const surfaceScalarField& phi,
82  const viscosity& viscosity
83  );
84 
85 
86  // Selectors
87 
88  //- Return a reference to the selected momentum transport model
89  static autoPtr<Stokes> New
90  (
91  const alphaField& alpha,
92  const rhoField& rho,
93  const volVectorField& U,
94  const surfaceScalarField& alphaRhoPhi,
95  const surfaceScalarField& phi,
96  const viscosity& viscosity
97  );
98 
99 
100  //- Destructor
101  virtual ~Stokes()
102  {}
103 
104 
105  // Member Functions
106 
107  //- Read momentumTransport dictionary
108  virtual bool read();
109 
110  //- Return the effective viscosity, i.e. the Stokes viscosity
111  virtual tmp<volScalarField> nuEff() const;
112 
113  //- Return the effective viscosity on patch
114  virtual tmp<scalarField> nuEff(const label patchi) const;
115 
116  //- Predict the Stokes viscosity
117  virtual void predict();
118 
119  //- The Stokes viscosity is not corrected
120  virtual void correct()
121  {}
122 };
123 
124 
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 
127 } // End namespace laminarModels
128 } // End namespace Foam
129 
130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
131 
132 #ifdef NoRepository
133  #include "Stokes.C"
134 #endif
135 
136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137 
138 #endif
139 
140 // ************************************************************************* //
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
BasicMomentumTransportModel::alphaField alphaField
Definition: laminarModel.H:70
BasicMomentumTransportModel::rhoField rhoField
Definition: laminarModel.H:71
Momentum transport model for Stokes flow.
Definition: Stokes.H:59
BasicMomentumTransportModel::alphaField alphaField
Definition: Stokes.H:63
virtual ~Stokes()
Destructor.
Definition: Stokes.H:100
static autoPtr< Stokes > 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.
virtual void predict()
Predict the Stokes viscosity.
Definition: Stokes.C:98
TypeName("Stokes")
Runtime type information.
virtual tmp< volScalarField > nuEff() const
Return the effective viscosity, i.e. the Stokes viscosity.
Definition: Stokes.C:77
virtual void correct()
The Stokes viscosity is not corrected.
Definition: Stokes.H:119
Stokes(const alphaField &alpha, const rhoField &rho, const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const viscosity &viscosity)
Construct from components.
Definition: Stokes.C:44
virtual bool read()
Read momentumTransport dictionary.
Definition: Stokes.C:69
BasicMomentumTransportModel::rhoField rhoField
Definition: Stokes.H:64
A class for managing temporary objects.
Definition: tmp.H:55
Abstract base class for all fluid physical properties.
Definition: viscosity.H:50
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