spherical.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 "spherical.H"
27 
28 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
29 
30 namespace Foam
31 {
32 namespace clouds
33 {
35 }
36 }
37 
38 
39 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
40 
41 Foam::IOobject Foam::clouds::spherical::dIo(const cloud& c)
42 {
43  return
44  IOobject
45  (
46  "d",
47  c.time().name(),
48  c.mesh(),
51  );
52 }
53 
54 
56 Foam::clouds::spherical::calcv
57 (
58  const LagrangianModelRef& model,
59  const LagrangianSubMesh& subMesh
60 ) const
61 {
62  return constant::mathematical::pi*pow3(d(model, subMesh))/6;
63 }
64 
65 
67 Foam::clouds::spherical::calca
68 (
69  const LagrangianModelRef& model,
70  const LagrangianSubMesh& subMesh
71 ) const
72 {
73  return constant::mathematical::pi*sqr(d(model, subMesh));
74 }
75 
76 
77 // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
78 
80 {
81  const LagrangianSubMesh& subMesh = v.mesh();
82 
83  LagrangianSubScalarSubField d(subMesh.sub(this->d));
84 
86 }
87 
88 
89 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
90 
92 :
93  shaped(c),
94  d(c.stateField<scalar>(dIo(c), c.mesh()))
95 {}
96 
97 
98 Foam::clouds::spherical::spherical(const cloud& c, const grouped& groupedCloud)
99 :
100  shaped(c, groupedCloud),
101  d(c.stateField<scalar>(dIo(c), c.mesh()))
102 {}
103 
104 
105 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
106 
108 {}
109 
110 
111 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const Mesh & mesh() const
Return mesh.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:99
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.
Base class for clouds. Provides a basic evolution algorithm, models, and a database for caching deriv...
Definition: cloud.H:63
Base class for clouds in which particles are grouped into parcels.
Definition: grouped.H:51
Base class for clouds with particles with mass.
Definition: shaped.H:51
Base class for clouds with spherical particles.
Definition: spherical.H:53
spherical(const cloud &)
Construct from a reference to the cloud.
Definition: spherical.C:91
virtual ~spherical()
Destructor.
Definition: spherical.C:107
void correct(const LagrangianSubScalarSubField &v)
Correct the shape to match the given volume.
Definition: spherical.C:79
const word & name() const
Return const reference to name.
A class for managing temporary objects.
Definition: tmp.H:55
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
defineTypeNameAndDebug(coupled, 0)
const dimensionedScalar c
Speed of light in a vacuum.
Namespace for OpenFOAM.
void pow3(LagrangianPatchField< scalar > &f, const LagrangianPatchField< scalar > &f1)
void cbrt(LagrangianPatchField< scalar > &f, const LagrangianPatchField< scalar > &f1)
void sqr(LagrangianPatchField< typename outerProduct< Type, Type >::type > &f, const LagrangianPatchField< Type > &f1)