cloud_fvModel.C
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 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 \*---------------------------------------------------------------------------*/
25 
26 #include "cloud_fvModel.H"
27 #include "coupled.H"
28 #include "massive.H"
29 
30 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
31 
32 namespace Foam
33 {
34 namespace fv
35 {
37 }
38 }
39 
40 
41 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
42 
43 template<class Type>
44 void Foam::fv::cloud::addSupType
45 (
46  const VolField<Type>& field,
47  fvMatrix<Type>& eqn
48 ) const
49 {
50  eqn += coupledCloud_.carrierEqn(field);
51 }
52 
53 
54 template<class Type>
55 void Foam::fv::cloud::addSupType
56 (
57  const volScalarField& rho,
58  const VolField<Type>& field,
59  fvMatrix<Type>& eqn
60 ) const
61 {
62  eqn += coupledCloud_.carrierEqn(field);
63 }
64 
65 
66 template<class Type>
67 void Foam::fv::cloud::addSupType
68 (
69  const volScalarField& alpha,
70  const volScalarField& rho,
71  const VolField<Type>& field,
72  fvMatrix<Type>& eqn
73 ) const
74 {
75  eqn += coupledCloud_.carrierEqn(field);
76 }
77 
78 
79 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
80 
82 {}
83 
84 
85 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
86 
87 bool Foam::fv::cloud::addsSupToField(const word& fieldName) const
88 {
89  const word group = IOobject::group(fieldName);
90 
91  return
92  cloud_.LagrangianModels().addsSupToField
93  (
95  )
96  || cloud_.LagrangianModels().addsSupToField
97  (
99  )
100  || cloud_.LagrangianModels().addsSupToField(fieldName);
101 }
102 
103 
105 {
107 }
108 
109 
111 
112 
114 
115 
117 
118 
119 void Foam::fv::cloud::correct()
120 {
121  cloudPtr_->solve();
122 }
123 
124 
126 {
127  cloudPtr_->storePosition();
128 }
129 
130 
132 {
133  return true;
134 }
135 
136 
138 {
139  cloudPtr_->topoChange(map);
140 }
141 
142 
144 {
145  cloudPtr_->mapMesh(map);
146 }
147 
148 
150 {
151  cloudPtr_->distribute(map);
152 }
153 
154 
155 // ************************************************************************* //
word group() const
Return group (extension part of name)
Definition: IOobject.C:321
static word groupName(Name name, const word &group)
CarrierEqn< Type > & carrierEqn(const VolField< Type > &)
Add/get a carrier equation to/from the cache.
static const word mName
Name of mass fields.
Definition: massive.H:60
static const word vName
Name of volume fields.
Definition: shaped.H:77
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Definition: fvMatrix.H:118
Finite volume model that solves for the evolution of a cloud. Provides two-way coupling with a finite...
Definition: cloud_fvModel.H:56
virtual bool movePoints()
Update for mesh motion.
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
virtual void preUpdateMesh()
Prepare for mesh update.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
virtual ~cloud()
Destructor.
Definition: cloud_fvModel.C:81
virtual void addSup(fvMatrix< scalar > &eqn) const
Add a source term to a field-less proxy equation.
virtual bool addsSupToField(const word &fieldName) const
Return true if the fvModel adds a source term to the given.
Definition: cloud_fvModel.C:87
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Class containing mesh-to-mesh mapping information.
Definition: polyMeshMap.H:51
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
A class for handling words, derived from string.
Definition: word.H:62
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:381
#define IMPLEMENT_FV_MODEL_ADD_FIELD_SUP(Type, modelType)
Definition: fvModelM.H:33
#define IMPLEMENT_FV_MODEL_ADD_ALPHA_RHO_FIELD_SUP(Type, modelType)
Definition: fvModelM.H:71
#define IMPLEMENT_FV_MODEL_ADD_RHO_FIELD_SUP(Type, modelType)
Definition: fvModelM.H:51
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
void correct(const RdeltaTType &rDeltaT, const RhoType &rho, volScalarField &psi, const surfaceScalarField &phiCorr, const SpType &Sp)
const char *const group
Group name for atomic constants.
defineTypeNameAndDebug(bound, 0)
Namespace for OpenFOAM.
VolField< scalar > volScalarField
Definition: volFieldsFwd.H:62
FOR_ALL_FIELD_TYPES(makeFieldSourceTypedef)
labelList fv(nPoints)