/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-2026 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see .
\*---------------------------------------------------------------------------*/
#include "fvModel.H"
#include "volFields.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(fvModel, 0);
defineRunTimeSelectionTable(fvModel, dictionary);
}
const Foam::wordHashSet Foam::fvModel::keywords({"type", "libs"});
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
template
void Foam::fvModel::addSupType
(
const VolField& field,
fvMatrix& eqn
) const
{}
template
void Foam::fvModel::addSupType
(
const volScalarField& rho,
const VolField& field,
fvMatrix& eqn
) const
{}
template
void Foam::fvModel::addSupType
(
const volScalarField& alpha,
const volScalarField& rho,
const VolField& field,
fvMatrix& eqn
) const
{}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::fvModel::fvModel
(
const word& name,
const word& modelType,
const fvMesh& mesh,
const dictionary& dict
)
:
name_(name),
modelType_(modelType),
mesh_(mesh)
{}
// * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * //
Foam::autoPtr Foam::fvModel::New
(
const word& name,
const fvMesh& mesh,
const dictionary& dict
)
{
const word type(dict.lookup("type"));
Info<< indentOrNl << "Selecting " << type
<< " with name " << name << endl;
if
(
!dictionaryConstructorTablePtr_
|| dictionaryConstructorTablePtr_->find(type)
== dictionaryConstructorTablePtr_->end()
)
{
if
(
!libs.open
(
dict,
"libs",
dictionaryConstructorTablePtr_
)
)
{
libs.open("lib" + type.remove(':') + ".so", false);
}
if (!dictionaryConstructorTablePtr_)
{
FatalErrorInFunction
<< "Unknown model type "
<< type << nl << nl
<< "Table of fvModels is empty"
<< exit(FatalError);
}
}
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(type);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalIOErrorInFunction(dict)
<< "Unknown fvModel " << type << nl << nl
<< "Valid fvModels are:" << nl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalIOError);
}
printDictionary print(dict);
return autoPtr(cstrIter()(name, type, mesh, dict));
}
Foam::fvModel::~fvModel()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::wordList Foam::fvModel::addSupFields() const
{
return wordList::null();
}
bool Foam::fvModel::addsSupToField(const word& fieldName) const
{
return findIndex(addSupFields(), fieldName) != -1;
}
Foam::scalar Foam::fvModel::maxDeltaT() const
{
return vGreat;
}
void Foam::fvModel::addSup(fvMatrix& eqn) const
{}
FOR_ALL_FIELD_TYPES(IMPLEMENT_FV_MODEL_ADD_FIELD_SUP, fvModel)
FOR_ALL_FIELD_TYPES(IMPLEMENT_FV_MODEL_ADD_RHO_FIELD_SUP, fvModel)
FOR_ALL_FIELD_TYPES(IMPLEMENT_FV_MODEL_ADD_ALPHA_RHO_FIELD_SUP, fvModel)
void Foam::fvModel::preUpdateMesh()
{}
void Foam::fvModel::correct()
{}
bool Foam::fvModel::read(const dictionary& dict)
{
return true;
}
bool Foam::fvModel::write(const bool write) const
{
return true;
}
// ************************************************************************* //