mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: solidFoam: allow time-step control. Fixes #2415.
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
solidRegionDiffNo.C
|
||||
solidFoam.C
|
||||
|
||||
EXE = $(FOAM_APPBIN)/solidFoam
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
EXE_INC = \
|
||||
-I../chtMultiRegionFoam/include \
|
||||
-I../chtMultiRegionFoam/solid \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
||||
|
||||
36
applications/solvers/heatTransfer/solidFoam/dummyCourantNo.H
Normal file
36
applications/solvers/heatTransfer/solidFoam/dummyCourantNo.H
Normal file
@ -0,0 +1,36 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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
|
||||
CourantNo
|
||||
|
||||
Description
|
||||
Dummy (fluid) Courant number.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
scalar CoNum = 0.0;
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,31 @@
|
||||
scalar DiNum = -GREAT;
|
||||
|
||||
{
|
||||
tmp<volScalarField> magKappa;
|
||||
if (thermo.isotropic())
|
||||
{
|
||||
magKappa = thermo.kappa();
|
||||
}
|
||||
else
|
||||
{
|
||||
magKappa = mag(thermo.Kappa());
|
||||
}
|
||||
|
||||
tmp<volScalarField> tcp = thermo.Cp();
|
||||
const volScalarField& cp = tcp();
|
||||
|
||||
tmp<volScalarField> trho = thermo.rho();
|
||||
const volScalarField& rho = trho();
|
||||
|
||||
DiNum = max
|
||||
(
|
||||
solidRegionDiffNo
|
||||
(
|
||||
mesh,
|
||||
runTime,
|
||||
rho*cp,
|
||||
magKappa()
|
||||
),
|
||||
DiNum
|
||||
);
|
||||
}
|
||||
@ -41,6 +41,8 @@ Description
|
||||
#include "fvOptions.H"
|
||||
#include "simpleControl.H"
|
||||
#include "pimpleControl.H"
|
||||
#include "dummyCourantNo.H"
|
||||
#include "solidRegionDiffNo.H"
|
||||
#include "coordinateSystem.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -88,17 +90,31 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
pimpleControl pimple(mesh);
|
||||
|
||||
#include "createDyMControls.H"
|
||||
|
||||
while (runTime.run())
|
||||
{
|
||||
#include "readDyMControls.H"
|
||||
#include "readSolidTimeControls.H"
|
||||
|
||||
#include "solidDiffusionNo.H"
|
||||
#include "setMultiRegionDeltaT.H"
|
||||
|
||||
++runTime;
|
||||
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
while (pimple.loop())
|
||||
{
|
||||
if (pimple.firstIter())
|
||||
if (pimple.firstIter() || moveMeshOuterCorrectors)
|
||||
{
|
||||
mesh.update();
|
||||
// Do any mesh changes
|
||||
mesh.controlledUpdate();
|
||||
|
||||
if (mesh.changing() && checkMeshCourantNo)
|
||||
{
|
||||
#include "meshCourantNo.H"
|
||||
}
|
||||
}
|
||||
|
||||
while (pimple.correct())
|
||||
|
||||
1
applications/solvers/heatTransfer/solidFoam/solidRegionDiffNo.C
Symbolic link
1
applications/solvers/heatTransfer/solidFoam/solidRegionDiffNo.C
Symbolic link
@ -0,0 +1 @@
|
||||
../chtMultiRegionFoam/solid/solidRegionDiffNo.C
|
||||
1
applications/solvers/heatTransfer/solidFoam/solidRegionDiffNo.H
Symbolic link
1
applications/solvers/heatTransfer/solidFoam/solidRegionDiffNo.H
Symbolic link
@ -0,0 +1 @@
|
||||
../chtMultiRegionFoam/solid/solidRegionDiffNo.H
|
||||
Reference in New Issue
Block a user