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-2021 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<class BasicMomentumTransportModel>
53 class Stokes
54 :
55  public linearViscousStress<laminarModel<BasicMomentumTransportModel>>
56 {
57 
58 public:
59 
60  typedef typename BasicMomentumTransportModel::alphaField alphaField;
61  typedef typename BasicMomentumTransportModel::rhoField rhoField;
62 
63 
64  //- Runtime type information
65  TypeName("Stokes");
66 
67 
68  // Constructors
69 
70  //- Construct from components
71  Stokes
72  (
73  const alphaField& alpha,
74  const rhoField& rho,
75  const volVectorField& U,
76  const surfaceScalarField& alphaRhoPhi,
77  const surfaceScalarField& phi,
78  const viscosity& viscosity
79  );
80 
81 
82  // Selectors
83 
84  //- Return a reference to the selected turbulence model
85  static autoPtr<Stokes> New
86  (
87  const alphaField& alpha,
88  const rhoField& rho,
89  const volVectorField& U,
90  const surfaceScalarField& alphaRhoPhi,
91  const surfaceScalarField& phi,
92  const viscosity& viscosity
93  );
94 
95 
96  //- Destructor
97  virtual ~Stokes()
98  {}
99 
100 
101  // Member Functions
102 
103  //- Const access to the coefficients dictionary
104  virtual const dictionary& coeffDict() const;
105 
106  //- Read momentumTransport dictionary
107  virtual bool read();
108 
109  //- Return the effective viscosity, i.e. the Stokes viscosity
110  virtual tmp<volScalarField> nuEff() const;
111 
112  //- Return the effective viscosity on patch
113  virtual tmp<scalarField> nuEff(const label patchi) const;
114 
115  //- Correct the Stokes viscosity
116  virtual void correct();
117 };
118 
119 
120 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
121 
122 } // End namespace laminarModels
123 } // End namespace Foam
124 
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 
127 #ifdef NoRepository
128  #include "Stokes.C"
129 #endif
130 
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 
133 #endif
134 
135 // ************************************************************************* //
virtual tmp< volScalarField > nuEff() const
Return the effective viscosity, i.e. the Stokes viscosity.
Definition: Stokes.C:83
U
Definition: pEqn.H:72
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
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
volScalarField alpha(IOobject("alpha", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
virtual bool read()
Read momentumTransport dictionary.
Definition: Stokes.C:76
Linear viscous stress turbulence model base class.
virtual const dictionary & coeffDict() const
Const access to the coefficients dictionary.
Definition: Stokes.C:69
BasicMomentumTransportModel::rhoField rhoField
Definition: Stokes.H:60
TypeName("Stokes")
Runtime type information.
phi
Definition: correctPhi.H:3
virtual ~Stokes()
Destructor.
Definition: Stokes.H:96
Abstract base class for all fluid physical properties.
Definition: viscosity.H:49
BasicMomentumTransportModel::alphaField alphaField
Definition: Stokes.H:59
label patchi
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 turbulence model.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
Momentum transport model for Stokes flow.
Definition: Stokes.H:52
virtual void correct()
Correct the Stokes viscosity.
Definition: Stokes.C:104
A class for managing temporary objects.
Definition: PtrList.H:53
Namespace for OpenFOAM.