cloudMass.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 "cloudMass.H"
29 #include "massive.H"
31 
32 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
33 
34 namespace Foam
35 {
36 namespace functionObjects
37 {
40 }
41 }
42 
43 
44 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
45 
47 (
48  const word& name,
49  const Time& runTime,
50  const dictionary& dict
51 )
52 :
54 {}
55 
56 
57 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
58 
60 {}
61 
62 
63 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
64 
66 {
67  return wordList::null();
68 }
69 
70 
72 {
73  if (foundObject<LagrangianScalarDynamicField>(clouds::massive::mName))
74  {
75  return true;
76  }
77 
78  store
79  (
81  (
84  wordList
85  (
86  cloud().mesh().boundary().size(),
87  calculatedLagrangianPatchScalarField::typeName
88  ),
90  cloud().LagrangianModels().modelTypeFieldSourceTypes
91  <
94  >()
95  )
96  );
97 
98  return true;
99 }
100 
101 
103 (
104  const LagrangianSubScalarField& deltaT,
105  const bool final
106 )
107 {
108  const LagrangianSubMesh& subMesh = deltaT.mesh();
109 
111  (
112  subMesh.sub
113  (
114  lookupObjectRef<LagrangianScalarDynamicField>
115  (
117  )
118  )
119  );
120 
121  m = cloud<clouds::massive>().m(subMesh);
122 }
123 
124 
126 {
127  return writeObject(clouds::massive::mName);
128 }
129 
130 
132 {
133  return clearObject(clouds::massive::mName);
134 }
135 
136 
137 // ************************************************************************* //
Macros for easy insertion into run-time selection tables.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const Mesh & mesh() const
Return mesh.
static tmp< GeometricField< Type, GeoMesh, PrimitiveField > > New(const word &name, const Internal &, const PtrList< Patch > &, const HashPtrTable< Source > &=HashPtrTable< Source >())
Return a temporary field constructed from name,.
Base class for Lagrangian injections. Minimal wrapper over LagrangianSource. Implements some utility ...
List of Lagrangian models, constructed as a (Lagrangian) mesh object. Provides similar functions to t...
Mesh that relates to a sub-section of a Lagrangian mesh. This is used to construct fields that relate...
SubList< Type > sub(const List< Type > &list) const
Return a sub-list corresponding to this sub-mesh.
static const List< word > & null()
Return a null List.
Definition: ListI.H:118
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:76
static const word mName
Name of mass fields.
Definition: massive.H:60
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Abstract base-class for Time/database functionObjects.
Base class for function objects that refer to a LagrangianMesh and a cloud. Used, for example,...
Function to write the mass field for a cloud.
Definition: cloudMass.H:79
cloudMass(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
Definition: cloudMass.C:47
virtual wordList fields() const
Return the list of fields required.
Definition: cloudMass.C:65
virtual ~cloudMass()
Destructor.
Definition: cloudMass.C:59
virtual bool clear()
Clear the masses.
Definition: cloudMass.C:131
virtual bool execute()
Calculate and store the masses.
Definition: cloudMass.C:71
virtual bool write()
Write the masses.
Definition: cloudMass.C:125
virtual void calculate(const LagrangianSubScalarField &deltaT, const bool final)
Update the masses.
Definition: cloudMass.C:103
Function object that solves for the evolution of a cloud. Only provides one-way coupling with a finit...
This source condition provides the mass of introduced particles. It converts between the correspondin...
A class for handling words, derived from string.
Definition: word.H:62
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
defineTypeNameAndDebug(adjustTimeStepToCombustion, 0)
addToRunTimeSelectionTable(functionObject, adjustTimeStepToCombustion, dictionary)
Namespace for OpenFOAM.
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
faceListList boundary(nPatches)
dictionary dict