sizeGroup.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2017-2018 OpenFOAM Foundation
9  Copyright (C) 2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 \*---------------------------------------------------------------------------*/
28 
29 #include "sizeGroup.H"
30 #include "populationBalanceModel.H"
31 #include "mixedFvPatchField.H"
32 
33 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
34 
36 (
37  const word& name,
38  const dictionary& dict,
39  const phaseModel& phase,
41  const fvMesh& mesh
42 )
43 :
45  (
46  IOobject
47  (
48  IOobject::groupName
49  (
50  name,
51  IOobject::groupName
52  (
54  velocityGroup.popBalName()
55  )
56  ),
57  mesh.time().timeName(),
58  mesh,
59  IOobject::READ_IF_PRESENT,
60  IOobject::AUTO_WRITE
61  ),
62  mesh,
63  dimensionedScalar(name, dimless, dict.get<scalar>("value")),
64  velocityGroup.f().boundaryField().types()
65  ),
66  phase_(phase),
67  velocityGroup_(velocityGroup),
68  d_("d", dimLength, dict),
69  x_("x", velocityGroup.formFactor()*pow3(d_)),
70  value_(dict.get<scalar>("value"))
71 {
72  // Adjust refValue at mixedFvPatchField boundaries
73  forAll(this->boundaryField(), patchi)
74  {
75  typedef mixedFvPatchField<scalar> mixedFvPatchScalarField;
76 
77  if
78  (
79  isA<mixedFvPatchScalarField>(this->boundaryFieldRef()[patchi])
80  )
81  {
82  mixedFvPatchScalarField& f =
83  refCast<mixedFvPatchScalarField>
84  (
85  this->boundaryFieldRef()[patchi]
86  );
87 
88  f.refValue() = value_;
89  }
90  }
91 }
92 
93 
94 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
95 
97 {}
98 
99 
100 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
101 
104 {
106  return nullptr;
107 }
108 
109 
110 // ************************************************************************* //
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
dictionary dict
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
sizeGroup(const word &name, const dictionary &dict, const phaseModel &phase, const velocityGroup &velocityGroup, const fvMesh &mesh)
Definition: sizeGroup.C:29
This diameterModel is intended for use with a populationBalanceModel in order to simulate polydispers...
const dimensionSet dimless
Dimensionless.
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:421
autoPtr< sizeGroup > clone() const
Return clone.
Definition: sizeGroup.C:96
word timeName
Definition: getTimeIndex.H:3
dynamicFvMesh & mesh
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition: exprTraits.C:127
A class for handling words, derived from Foam::string.
Definition: word.H:63
virtual ~sizeGroup()
Destructor.
Definition: sizeGroup.C:89
labelList f(nPoints)
dimensionedScalar pow3(const dimensionedScalar &ds)
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:50
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
Definition: phase.H:50
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:686
Defines the attributes of an object for which implicit objectRegistry management is supported...
Definition: IOobject.H:172
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
Definition: phaseModel.H:53
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.