distributionModel.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) 2011-2017 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 \*---------------------------------------------------------------------------*/
27 
28 #include "distributionModel.H"
29 
30 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
31 
32 namespace Foam
33 {
34  defineTypeNameAndDebug(distributionModel, 0);
35  defineRunTimeSelectionTable(distributionModel, dictionary);
36 }
37 
38 
39 // * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
40 
42 {
43  if (minValue() < 0)
44  {
46  << type() << "distribution: Minimum value must be greater than "
47  << "zero." << nl << "Supplied minValue = " << minValue()
48  << abort(FatalError);
49  }
50 
51  if (maxValue() < minValue())
52  {
54  << type() << "distribution: Maximum value is smaller than the "
55  << "minimum value:" << nl << " maxValue = " << maxValue()
56  << ", minValue = " << minValue()
57  << abort(FatalError);
58  }
59 }
60 
61 
62 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
63 
65 (
66  const word& name,
67  const dictionary& dict,
68  Random& rndGen
69 )
70 :
71  distributionModelDict_(dict),
72  rndGen_(rndGen)
73 {}
74 
75 
77 (
78  const distributionModel& p
79 )
80 :
81  distributionModelDict_(p.distributionModelDict_),
82  rndGen_(p.rndGen_)
83 {}
84 
85 
86 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
87 
89 {}
90 
91 
92 // ************************************************************************* //
Foam::distributionModel::check
virtual void check() const
Check that the distribution model is valid.
Definition: distributionModel.C:41
Foam::Random
Random number generator.
Definition: Random.H:59
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::defineRunTimeSelectionTable
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
Foam::distributionModel
A library of runtime-selectable distribution models.
Definition: distributionModel.H:70
Foam::distributionModel::maxValue
virtual scalar maxValue() const =0
Return the maximum value.
Foam::name
word name(const complex &c)
Return string representation of complex.
Definition: complex.C:76
Foam::distributionModel::distributionModel
distributionModel(const word &name, const dictionary &dict, Random &rndGen)
Construct from dictionary.
Definition: distributionModel.C:65
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::FatalError
error FatalError
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::abort
errorManip< error > abort(error &err)
Definition: errorManip.H:144
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:381
Foam::nl
constexpr char nl
Definition: Ostream.H:385
Foam::type
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: MSwindows.C:590
Foam::distributionModel::minValue
virtual scalar minValue() const =0
Return the minimum value.
rndGen
Random rndGen
Definition: createFields.H:23
Foam::distributionModel::~distributionModel
virtual ~distributionModel()
Destructor.
Definition: distributionModel.C:88
Foam::defineTypeNameAndDebug
defineTypeNameAndDebug(combustionModel, 0)
distributionModel.H