Loading...
Searching...
No Matches
resolutionIndex.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) 2022 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
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 "resolutionIndex.H"
30#include "turbulenceModel.H"
31#include "RASModel.H"
34// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
35
36namespace Foam
37{
38namespace functionObjects
39{
42}
43}
44
45
46// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
47
49(
50 const word& name,
51 const Time& runTime,
52 const dictionary& dict
53)
54:
55 fvMeshFunctionObject(name, runTime, dict),
56 resolutionIndexModelPtr_()
58 read(dict);
59}
60
61
62// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
65{} // resolutionIndexModel was forward declared
66
67
68// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
69
71{
72 if (mesh_.foundObject<RASModelBase>(turbulenceModel::propertiesName))
73 {
75 << type() << " " << name()
76 << " is not available for RANS-based turbulence models."
78
79 return false;
80 }
81
83 {
84 return false;
85 }
86
87 Info<< type() << " " << name() << ":" << endl;
88
89 resolutionIndexModelPtr_.reset
90 (
92 );
93
94 return true;
95}
96
97
99{
100 if (!resolutionIndexModelPtr_->execute())
101 {
102 return false;
103 }
104
105 return true;
106}
107
108
110{
111 Info<< type() << " " << name() << " write:" << endl;
112
113 if (!resolutionIndexModelPtr_->write())
114 {
115 return false;
116 }
117 Info<< endl;
118
119 return true;
120}
121
122
123// ************************************************************************* //
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition Time.H:75
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
Abstract base-class for Time/database function objects.
virtual bool read(const dictionary &dict)
Read and set the function object if its data have changed.
const fvMesh & mesh_
Reference to the fvMesh.
fvMeshFunctionObject(const fvMeshFunctionObject &)=delete
No copy construct.
Computes a single-mesh resolution index according to the specified model, which is used as a LES/DES ...
virtual bool read(const dictionary &dict)
Read the function-object dictionary.
resolutionIndex(const word &name, const Time &runTime, const dictionary &dict)
Construct from name, Time and dictionary.
virtual bool execute()
Execute the function-object operations.
virtual bool write()
Write the function-object results.
static autoPtr< resolutionIndexModel > New(const word &name, const fvMesh &mesh, const dictionary &dict)
Return a reference to the selected resolutionIndex model.
static const word propertiesName
Default name of the turbulence properties dictionary.
A class for handling words, derived from Foam::string.
Definition word.H:66
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition className.H:142
engineTime & runTime
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Definition error.H:629
auto & name
Function objects are OpenFOAM utilities to ease workflow configurations and enhance workflows.
Namespace for OpenFOAM.
messageStream Info
Information stream (stdout output on master, null elsewhere).
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition POSIX.C:801
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition Ostream.H:519
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition exprTraits.C:127
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition errorManip.H:125
dictionary dict