cloudVolumeFraction.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 "cloudVolumeFraction.H"
27 #include "grouped.H"
28 #include "shaped.H"
29 #include "volFields.H"
30 #include "LagrangiancAccumulate.H"
32 
33 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
34 
35 namespace Foam
36 {
37 namespace functionObjects
38 {
41 }
42 }
43 
44 
45 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
46 
48 (
49  const word& name,
50  const Time& runTime,
51  const dictionary& dict
52 )
53 :
55  alphaName_(cloud().mesh().name() + ":alpha")
56 {}
57 
58 
59 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
60 
62 {}
63 
64 
65 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
66 
68 {
69  return wordList::null();
70 }
71 
72 
74 {
75  const Foam::cloud& c = cloud();
76 
78  (
79  "v",
80  isCloud<clouds::grouped>()
81  ? cloud<clouds::grouped>().number(c.mesh())
82  *cloud<clouds::shaped>().v(c.mesh())
83  : cloud<clouds::shaped>().v(c.mesh())
84  );
85 
87  (
88  alphaName_,
89  Lagrangianc::accumulate<volMesh>(v)/fvMeshFunctionObject::mesh_.V()
90  );
91 
92  return true;
93 }
94 
95 
97 {
99 }
100 
101 
103 {
105 }
106 
107 
108 // ************************************************************************* //
Functions for accumulating Lagrangian values into cell fields.
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...
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
Base class for clouds. Provides a basic evolution algorithm, models, and a database for caching deriv...
Definition: cloud.H:63
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 an fvMesh and a cloud. Used, for example,...
Function to write the volume fraction field for a cloud.
virtual wordList fields() const
Return the list of fields required.
cloudVolumeFraction(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
virtual bool clear()
Clear the volume fraction.
virtual bool execute()
Calculate and store the volume fraction.
virtual bool write()
Write the volume fraction.
Function object that solves for the evolution of a cloud. Only provides one-way coupling with a finit...
const fvMesh & mesh_
Reference to the fvMesh.
ObjectType & store(const tmp< ObjectType > &tfield)
Store the given field in the objectRegistry.
bool writeObject(const word &fieldName)
Write field if present in objectRegistry.
bool clearObject(const word &fieldName)
Clear field from the objectRegistry if present.
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)
const dimensionedScalar c
Speed of light in a vacuum.
defineTypeNameAndDebug(adjustTimeStepToCombustion, 0)
addToRunTimeSelectionTable(functionObject, adjustTimeStepToCombustion, dictionary)
Namespace for OpenFOAM.
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
dictionary dict