src/finiteVolume/cfdTools: Removed unused code

Solver modules have replaced code that was previously shared between
solvers by means of #include-ing header files. Some of these headers are
now unused and have been removed. Others are only now used in a single
solver and have been moved into that solver.
This commit is contained in:
Will Bainbridge
2023-02-22 16:15:32 +00:00
parent a35fed405e
commit a432c3f6df
17 changed files with 2 additions and 488 deletions

View File

@ -0,0 +1,35 @@
if (!mesh.foundObject<IOdictionary>("radiationProperties"))
{
typeIOobject<IOdictionary> radiationProperties
(
"radiationProperties",
runTime.constant(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
);
if (radiationProperties.headerOk())
{
const word modelType
(
IOdictionary(radiationProperties).lookup("radiationModel")
);
if (modelType != "none")
{
FatalErrorInFunction
<< "Radiation model " << modelType
<< " selected but not enabled in fvModels" << nl
<< "To enable radiation add " << nl << nl
<< "radiation" << nl
<< "{" << nl
<< " type radiation;" << nl
<< " libs (\"libradiationModels.so\");" << nl
<< "}" << nl << nl
<< "to " << radiationProperties.relativePath()/"fvModels"
<< exit(FatalError);
}
}
}

View File

@ -0,0 +1,50 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2023 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 <http://www.gnu.org/licenses/>.
Global
meshCourantNo
Description
Calculates and outputs the mean and maximum Courant Numbers.
\*---------------------------------------------------------------------------*/
scalar meshCoNum = 0.0;
scalar meanMeshCoNum = 0.0;
{
scalarField sumPhi
(
fvc::surfaceSum(mag(mesh.phi()))().primitiveField()
);
meshCoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();
meanMeshCoNum =
0.5*(gSum(sumPhi)/gSum(mesh.V().field()))*runTime.deltaTValue();
}
Info<< "Mesh Courant Number mean: " << meanMeshCoNum
<< " max: " << meshCoNum << endl;
// ************************************************************************* //

View File

@ -0,0 +1,54 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-2023 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 <http://www.gnu.org/licenses/>.
Global
createUfIfPresent
Description
Creates and initialises the velocity field Uf if required.
\*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
autoPtr<surfaceVectorField> Uf;
if (mesh.dynamic())
{
Info<< "Constructing face velocity Uf\n" << endl;
Uf = new surfaceVectorField
(
IOobject
(
"Uf",
runTime.name(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
fvc::interpolate(U)
);
}
// ************************************************************************* //

View File

@ -0,0 +1,4 @@
Info<< "Calculating field g.h\n" << endl;
dimensionedScalar ghRef(- mag(g)*hRef);
volScalarField gh("gh", (g & mesh.C()) - ghRef);
surfaceScalarField ghf("ghf", (g & mesh.Cf()) - ghRef);

View File

@ -0,0 +1,13 @@
Info<< "\nReading hRef" << endl;
uniformDimensionedScalarField hRef
(
IOobject
(
"hRef",
runTime.constant(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE
),
dimensionedScalar(dimLength, 0)
);