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 
78 Foam::clouds::spherical::calcaByV
79 (
80  const LagrangianModelRef& model,
81  const LagrangianSubMesh& subMesh
82 ) const
83 {
84  return 6/d(model, subMesh);
85 }
86 
87 
88 // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
89 
91 {
92  const LagrangianSubMesh& subMesh = v.mesh();
93 
94  LagrangianSubScalarSubField d(subMesh.sub(this->d));
95 
97 }
98 
99 
100 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
101 
103 :
104  shaped(c),
105  d(dIo(c), c.mesh())
106 {}
107 
108 
109 Foam::clouds::spherical::spherical(const cloud& c, const grouped& groupedCloud)
110 :
111  shaped(c, groupedCloud),
112  d(dIo(c), c.mesh())
113 {}
114 
115 
116 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
117 
119 {}
120 
121 
122 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const GeoMesh & 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...
word sub(const word &fieldName) const
Return the name of a field corresponding to this sub-mesh.
A cloud is a collection of lagrangian particles.
Definition: cloud.H:61
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:102
virtual ~spherical()
Destructor.
Definition: spherical.C:118
void correct(const LagrangianSubScalarSubField &v)
Correct the shape to match the given volume.
Definition: spherical.C:90
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(carried, 0)
const dimensionedScalar c
Speed of light in a vacuum.
Namespace for OpenFOAM.
tmp< DimensionedField< typename outerProduct< Type, Type >::type, GeoMesh, Field >> sqr(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
void pow3(LagrangianPatchField< scalar > &f, const LagrangianPatchField< scalar > &f1)
void cbrt(LagrangianPatchField< scalar > &f, const LagrangianPatchField< scalar > &f1)