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  (
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 // ************************************************************************* //
populationBalanceModel.H
Foam::phaseModel
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
Definition: phaseModel.H:54
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:169
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::dimLength
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:52
Foam::phase
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
Definition: phase.H:54
Foam::diameterModels::sizeGroup::clone
autoPtr< sizeGroup > clone() const
Return clone.
Definition: sizeGroup.C:103
Foam::diameterModels::velocityGroup::formFactor
const dimensionedScalar & formFactor() const
Return the form factor.
Definition: velocityGroupI.H:45
mixedFvPatchField.H
Foam::diameterModels::velocityGroup::popBalName
const word & popBalName() const
Return name of populationBalance this velocityGroup belongs to.
Definition: velocityGroupI.H:31
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:296
Foam::diameterModels::sizeGroup::sizeGroup
sizeGroup(const word &name, const dictionary &dict, const phaseModel &phase, const velocityGroup &velocityGroup, const fvMesh &mesh)
Definition: sizeGroup.C:36
NotImplemented
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:517
Foam::pow3
dimensionedScalar pow3(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:89
Foam::diameterModels::sizeGroup::~sizeGroup
virtual ~sizeGroup()
Destructor.
Definition: sizeGroup.C:96
sizeGroup.H
Foam::dimensionedScalar
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Definition: dimensionedScalarFwd.H:42
Foam::diameterModels::velocityGroup
This diameterModel is intended for use with a populationBalanceModel in order to simulate polydispers...
Definition: velocityGroup.H:107
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:57
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam::mixedFvPatchField< scalar >
Foam::diameterModels::velocityGroup::f
const volScalarField & f() const
Return reference field for sizeGroup's.
Definition: velocityGroupI.H:38
Foam::phaseModel::name
const word & name() const
Definition: phaseModel.H:140
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
f
labelList f(nPoints)
Foam::name
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
Foam::diameterModel::phase
const phaseModel & phase() const
Return the phase.
Definition: diameterModel.H:116
Foam::GeometricField::boundaryField
const Boundary & boundaryField() const
Return const-reference to the boundary field.
Definition: GeometricFieldI.H:62
Foam::dimless
const dimensionSet dimless
Dimensionless.
Definition: dimensionSets.C:189