IOMRFZoneListDF.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2 
3  DAFoam : Discrete Adjoint with OpenFOAM
4  Version : v3
5 
6  Description:
7  A modified version of MRF that allows changing the rotation speed at
8  the runtime to enable derivatives wrt the rotation speed
9 
10  This class is modified from OpenFOAM's source code
11  src/finiteVolume/cfdTools/general/MRF
12 
13  OpenFOAM: The Open Source CFD Toolbox
14 
15  Copyright (C): 2011-2016 OpenFOAM Foundation
16 
17  OpenFOAM License:
18 
19  OpenFOAM is free software: you can redistribute it and/or modify it
20  under the terms of the GNU General Public License as published by
21  the Free Software Foundation, either version 3 of the License, or
22  (at your option) any later version.
23 
24  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
25  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
26  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
27  for more details.
28 
29  You should have received a copy of the GNU General Public License
30  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
31 
32 \*---------------------------------------------------------------------------*/
33 
34 #include "IOMRFZoneListDF.H"
35 #include "fvMesh.H"
36 #include "Time.H"
37 
38 // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
39 
40 Foam::IOobject Foam::IOMRFZoneListDF::createIOobject(
41  const fvMesh& mesh) const
42 {
43  IOobject io(
44  "MRFProperties",
45  mesh.time().constant(),
46  mesh,
47  IOobject::MUST_READ,
48  IOobject::NO_WRITE);
49 
50  if (io.typeHeaderOk<IOdictionary>(true))
51  {
52  Info << "Creating MRF zone list from " << io.name() << endl;
53 
54  io.readOpt() = IOobject::MUST_READ_IF_MODIFIED;
55  return io;
56  }
57  else
58  {
59  Info << "No MRF models present" << nl << endl;
60 
61  io.readOpt() = IOobject::NO_READ;
62  return io;
63  }
64 }
65 
66 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
67 
68 Foam::IOMRFZoneListDF::IOMRFZoneListDF(
69  const fvMesh& mesh)
70  : IOdictionary(createIOobject(mesh)),
71  MRFZoneListDF(mesh, *this)
72 {
73 }
74 
76 {
77  // do nothing
78  return true;
79 }
80 
81 // ************************************************************************* //
IOMRFZoneListDF.H
Foam::IOMRFZoneListDF::read
virtual bool read()
Definition: IOMRFZoneListDF.C:75
Foam::MRFZoneListDF
Definition: MRFZoneListDF.H:55
mesh
fvMesh & mesh
Definition: createRefsHeatTransfer.H:4