MRFZones.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) 2012-2026 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 "MRFZones.H"
27 
28 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
29 
30 namespace Foam
31 {
33 }
34 
35 
36 // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
37 
38 Foam::IOobject Foam::MRFZones::createIOobject(const fvMesh& mesh)
39 {
40  typeIOobject<IOdictionary> io
41  (
42  "MRFProperties",
43  mesh.time().constant(),
44  mesh,
47  );
48 
49  if (io.headerOk())
50  {
52  << "Constructing MRF zones from " << io.name()
53  << endl;
54 
55  io.readOpt() = IOobject::MUST_READ_IF_MODIFIED;
56  return io;
57  }
58  else
59  {
60  io.readOpt() = IOobject::NO_READ;
61  return io;
62  }
63 }
64 
65 
66 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
67 
69 (
70  const fvMesh& mesh
71 )
72 :
74  <
75  fvMesh,
77  MRFZones,
79  >
80  (
81  createIOobject(mesh),
82  mesh
83  ),
84  MRFZoneList(mesh, *this)
85 {}
86 
87 
88 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
89 
91 {}
92 
93 
95 {
96  update();
97  return true;
98 }
99 
100 
102 {
103  update();
104 }
105 
106 
108 {
109  update();
110 }
111 
112 
114 {
115  update();
116 }
117 
118 
120 {
121  if (regIOobject::read())
122  {
123  MRFZoneList::read(*this);
124  return true;
125  }
126  else
127  {
128  return false;
129  }
130 }
131 
132 
133 // ************************************************************************* //
Templated abstract base-class for demand-driven mesh objects used to automate their allocation to the...
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:57
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:99
@ MUST_READ_IF_MODIFIED
Definition: IOobject.H:119
virtual const fileName & name() const
Return the name of the stream.
Definition: IOstream.H:297
List container for MRF zones.
Definition: MRFZoneList.H:55
bool read(const dictionary &dict)
Read dictionary.
Definition: MRFZoneList.C:101
MRF zones DemandDrivenMeshObject read from MRFProperties dictionary.
Definition: MRFZones.H:76
virtual bool movePoints()
Update for mesh motion.
Definition: MRFZones.C:94
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
Definition: MRFZones.C:101
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
Definition: MRFZones.C:113
MRFZones(const fvMesh &mesh)
Construct from mesh.
Definition: MRFZones.C:69
virtual void preUpdateMesh()
Prepare for mesh update.
Definition: MRFZones.C:90
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
Definition: MRFZones.C:107
virtual bool read()
Read dictionary.
Definition: MRFZones.C:119
static const word & constant()
Return constant name.
Definition: TimePaths.H:122
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:98
const Time & time() const
Return the top-level database.
Definition: fvMesh.H:433
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Class containing mesh-to-mesh mapping information.
Definition: polyMeshMap.H:51
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
virtual bool read()
Read object.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
Namespace for OpenFOAM.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:288
messageStream Info
Ostream & indentOrNl(Ostream &os)
Indent stream or add newline if indent level == 0.
Definition: Ostream.H:250
defineTypeNameAndDebug(atmosphericBoundaryLayer, 0)