cloudSurfaceArea.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 "cloudSurfaceArea.H"
29 #include "shaped.H"
31 
32 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
33 
34 namespace Foam
35 {
36 namespace functionObjects
37 {
40 }
41 }
42 
43 
45 
46 
47 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
48 
50 (
51  const word& name,
52  const Time& runTime,
53  const dictionary& dict
54 )
55 :
57 {}
58 
59 
60 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
61 
63 {}
64 
65 
66 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
67 
69 {
70  return wordList::null();
71 }
72 
73 
75 {
76  if (foundObject<LagrangianScalarDynamicField>(aName_))
77  {
78  return true;
79  }
80 
81  store
82  (
84  (
85  aName_,
86  cloud<clouds::shaped>().a(mesh())(),
87  wordList
88  (
89  cloud().mesh().boundary().size(),
90  calculatedLagrangianPatchScalarField::typeName
91  ),
93  cloud().LagrangianModels().modelTypeFieldSourceTypes
94  <
97  >()
98  )
99  );
100 
101  return true;
102 }
103 
104 
106 (
107  const LagrangianSubScalarField& deltaT,
108  const bool final
109 )
110 {
111  const LagrangianSubMesh& subMesh = deltaT.mesh();
112 
114  (
115  subMesh.sub
116  (
117  lookupObjectRef<LagrangianScalarDynamicField>
118  (
119  aName_
120  )
121  )
122  );
123 
124  a = cloud<clouds::shaped>().a(subMesh);
125 }
126 
127 
129 {
130  return writeObject(aName_);
131 }
132 
133 
135 {
136  return clearObject(aName_);
137 }
138 
139 
140 // ************************************************************************* //
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
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 surface area field for a cloud.
virtual wordList fields() const
Return the list of fields required.
virtual bool clear()
Clear the surface areas.
cloudSurfaceArea(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
static const word aName_
The name of the surface area field.
virtual bool execute()
Calculate and store the surface areas.
virtual bool write()
Write the surface areas.
virtual void calculate(const LagrangianSubScalarField &deltaT, const bool final)
Update the surface areas.
Function object that solves for the evolution of a cloud. Only provides one-way coupling with a finit...
This source condition provides the surface area of introduced particles. It converts between the corr...
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