coupledToFluid.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) 2025-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::clouds::coupledToFluid
26 
27 Description
28  Base class for clouds which are coupled to a variable density fluid
29 
30 SourceFiles
31  coupledToFluid.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef coupledToFluid_H
36 #define coupledToFluid_H
37 
38 #include "coupled.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 namespace clouds
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class coupledToFluid Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 class coupledToFluid
52 :
53  public coupled
54 {
55 private:
56 
57  // Private Data
58 
59  //- Reference to the mesh
60  const LagrangianMesh& mesh_;
61 
62  //- Reference to the carried cloud
63  const carried& carriedCloud_;
64 
65  //- Cached carrier density field
66  tmp<volScalarField> trhocVf_;
67 
68  //- Cached corresponding Eulerian phase density field
69  tmp<volScalarField> trhocPhaseVf_;
70 
71  //- Reference to the carrier dynamic viscosity field. Might be null.
72  const volScalarField& mucVf_;
73 
74 
75  // Private Member Functions
76 
77  //- Get the carrier density field
78  tmp<volScalarField> getRhocVf(const word& phaseName) const;
79 
80  //- Get a reference to the carrier dynamic viscosity field. Might
81  // return null.
82  const volScalarField& getMucVf(const word& phaseName) const;
83 
84  //- Calculate the carrier kinematic viscosity
85  virtual tmp<LagrangianSubScalarField> calcNuc
86  (
87  const LagrangianModelRef& model,
88  const LagrangianSubMesh& subMesh
89  ) const;
90 
91 
92 protected:
93 
94  // Protected Member Functions
95 
96  //- Update the cached carrier fields
97  void updateCarrier();
98 
99 
100 public:
101 
102  // Public Static Data
103 
104  //- Run-time type information
105  TypeName("coupledToFluid");
106 
107 
108  // Public Data
109 
110  //- Carrier density
111  const CarrierField<scalar>& rhoc;
112 
113  //- Corresponding Eulerian density
115 
116  //- Carrier dynamic viscosity
118 
119 
120  // Constructors
121 
122  //- Construct from a reference to the cloud
123  coupledToFluid(const cloud& c, const carried&);
124 
125 
126  //- Destructor
127  virtual ~coupledToFluid();
128 };
129 
130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
131 
132 } // End namespace clouds
133 } // End namespace Foam
134 
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 
137 #endif
138 
139 // ************************************************************************* //
Generic GeometricField class.
Class containing Lagrangian geometry and topology.
Simple wrapper to provide an optional reference to a Lagrangian model.
Mesh that relates to a sub-section of a Lagrangian mesh. This is used to construct fields that relate...
Base class for clouds. Provides a basic evolution algorithm, models, and a database for caching deriv...
Definition: cloud.H:61
Base class for clouds which are carried by a fluid.
Definition: carried.H:57
Base class for clouds which are coupled to a variable density fluid.
const CarrierField< scalar > & rhocPhase
Corresponding Eulerian density.
TypeName("coupledToFluid")
Run-time type information.
const CarrierField< scalar > & rhoc
Carrier density.
const CloudDerivedField< scalar > & muc
Carrier dynamic viscosity.
virtual ~coupledToFluid()
Destructor.
coupledToFluid(const cloud &c, const carried &)
Construct from a reference to the cloud.
void updateCarrier()
Update the cached carrier fields.
Base class for clouds which are coupled to a carrier.
Definition: coupled.H:55
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:63
const dimensionedScalar c
Speed of light in a vacuum.
Namespace for OpenFOAM.