New modular solver framework for single- and multi-region simulations
in which different solver modules can be selected in each region to for complex
conjugate heat-transfer and other combined physics problems such as FSI
(fluid-structure interaction).
For single-region simulations the solver module is selected, instantiated and
executed in the PIMPLE loop in the new foamRun application.
For multi-region simulations the set of solver modules, one for each region, are
selected, instantiated and executed in the multi-region PIMPLE loop of new the
foamMultiRun application.
This provides a very general, flexible and extensible framework for complex
coupled problems by creating more solver modules, either by converting existing
solver applications or creating new ones.
The current set of solver modules provided are:
isothermalFluid
Solver module for steady or transient turbulent flow of compressible
isothermal fluids with optional mesh motion and mesh topology changes.
Created from the rhoSimpleFoam, rhoPimpleFoam and buoyantFoam solvers but
without the energy equation, hence isothermal. The buoyant pressure
formulation corresponding to the buoyantFoam solver is selected
automatically by the presence of the p_rgh pressure field in the start-time
directory.
fluid
Solver module for steady or transient turbulent flow of compressible fluids
with heat-transfer for HVAC and similar applications, with optional
mesh motion and mesh topology changes.
Derived from the isothermalFluid solver module with the addition of the
energy equation from the rhoSimpleFoam, rhoPimpleFoam and buoyantFoam
solvers, thus providing the equivalent functionality of these three solvers.
multicomponentFluid
Solver module for steady or transient turbulent flow of compressible
reacting fluids with optional mesh motion and mesh topology changes.
Derived from the isothermalFluid solver module with the addition of
multicomponent thermophysical properties energy and specie mass-fraction
equations from the reactingFoam solver, thus providing the equivalent
functionality in reactingFoam and buoyantReactingFoam. Chemical reactions
and/or combustion modelling may be optionally selected to simulate reacting
systems including fires, explosions etc.
solid
Solver module for turbulent flow of compressible fluids for conjugate heat
transfer, HVAC and similar applications, with optional mesh motion and mesh
topology changes.
The solid solver module may be selected in solid regions of a CHT case, with
either the fluid or multicomponentFluid solver module in the fluid regions
and executed with foamMultiRun to provide functionality equivalent
chtMultiRegionFoam but in a flexible and extensible framework for future
extension to more complex coupled problems.
All the usual fvModels, fvConstraints, functionObjects etc. are available with
these solver modules to support simulations including body-forces, local sources,
Lagrangian clouds, liquid films etc. etc.
Converting compressibleInterFoam and multiphaseEulerFoam into solver modules
would provide a significant enhancement to the CHT capability and incompressible
solvers like pimpleFoam run in conjunction with solidDisplacementFoam in
foamMultiRun would be useful for a range of FSI problems. Many other
combinations of existing solvers converted into solver modules could prove
useful for a very wide range of complex combined physics simulations.
All tutorials from the rhoSimpleFoam, rhoPimpleFoam, buoyantFoam, reactingFoam,
buoyantReactingFoam and chtMultiRegionFoam solver applications replaced by
solver modules have been updated and moved into the tutorials/modules directory:
modules
├── CHT
│ ├── coolingCylinder2D
│ ├── coolingSphere
│ ├── heatedDuct
│ ├── heatExchanger
│ ├── reverseBurner
│ └── shellAndTubeHeatExchanger
├── fluid
│ ├── aerofoilNACA0012
│ ├── aerofoilNACA0012Steady
│ ├── angledDuct
│ ├── angledDuctExplicitFixedCoeff
│ ├── angledDuctLTS
│ ├── annularThermalMixer
│ ├── BernardCells
│ ├── blockedChannel
│ ├── buoyantCavity
│ ├── cavity
│ ├── circuitBoardCooling
│ ├── decompressionTank
│ ├── externalCoupledCavity
│ ├── forwardStep
│ ├── helmholtzResonance
│ ├── hotRadiationRoom
│ ├── hotRadiationRoomFvDOM
│ ├── hotRoom
│ ├── hotRoomBoussinesq
│ ├── hotRoomBoussinesqSteady
│ ├── hotRoomComfort
│ ├── iglooWithFridges
│ ├── mixerVessel2DMRF
│ ├── nacaAirfoil
│ ├── pitzDaily
│ ├── prism
│ ├── shockTube
│ ├── squareBend
│ ├── squareBendLiq
│ └── squareBendLiqSteady
└── multicomponentFluid
├── aachenBomb
├── counterFlowFlame2D
├── counterFlowFlame2D_GRI
├── counterFlowFlame2D_GRI_TDAC
├── counterFlowFlame2DLTS
├── counterFlowFlame2DLTS_GRI_TDAC
├── cylinder
├── DLR_A_LTS
├── filter
├── hotBoxes
├── membrane
├── parcelInBox
├── rivuletPanel
├── SandiaD_LTS
├── simplifiedSiwek
├── smallPoolFire2D
├── smallPoolFire3D
├── splashPanel
├── verticalChannel
├── verticalChannelLTS
└── verticalChannelSteady
Also redirection scripts are provided for the replaced solvers which call
foamRun -solver <solver module name> or foamMultiRun in the case of
chtMultiRegionFoam for backward-compatibility.
Documentation for foamRun and foamMultiRun:
Application
foamRun
Description
Loads and executes an OpenFOAM solver module either specified by the
optional \c solver entry in the \c controlDict or as a command-line
argument.
Uses the flexible PIMPLE (PISO-SIMPLE) solution for time-resolved and
pseudo-transient and steady simulations.
Usage
\b foamRun [OPTION]
- \par -solver <name>
Solver name
- \par -libs '(\"lib1.so\" ... \"libN.so\")'
Specify the additional libraries loaded
Example usage:
- To run a \c rhoPimpleFoam case by specifying the solver on the
command line:
\verbatim
foamRun -solver fluid
\endverbatim
- To update and run a \c rhoPimpleFoam case add the following entries to
the controlDict:
\verbatim
application foamRun;
solver fluid;
\endverbatim
then execute \c foamRun
Application
foamMultiRun
Description
Loads and executes an OpenFOAM solver modules for each region of a
multiregion simulation e.g. for conjugate heat transfer.
The region solvers are specified in the \c regionSolvers dictionary entry in
\c controlDict, containing a list of pairs of region and solver names,
e.g. for a two region case with one fluid region named
liquid and one solid region named tubeWall:
\verbatim
regionSolvers
{
liquid fluid;
tubeWall solid;
}
\endverbatim
The \c regionSolvers entry is a dictionary to support name substitutions to
simplify the specification of a single solver type for a set of
regions, e.g.
\verbatim
fluidSolver fluid;
solidSolver solid;
regionSolvers
{
tube1 $fluidSolver;
tubeWall1 solid;
tube2 $fluidSolver;
tubeWall2 solid;
tube3 $fluidSolver;
tubeWall3 solid;
}
\endverbatim
Uses the flexible PIMPLE (PISO-SIMPLE) solution for time-resolved and
pseudo-transient and steady simulations.
Usage
\b foamMultiRun [OPTION]
- \par -libs '(\"lib1.so\" ... \"libN.so\")'
Specify the additional libraries loaded
Example usage:
- To update and run a \c chtMultiRegion case add the following entries to
the controlDict:
\verbatim
application foamMultiRun;
regionSolvers
{
fluid fluid;
solid solid;
}
\endverbatim
then execute \c foamMultiRun
This commit is contained in:
3
applications/solvers/modules/solid/solid/Make/files
Normal file
3
applications/solvers/modules/solid/solid/Make/files
Normal file
@ -0,0 +1,3 @@
|
||||
solid.C
|
||||
|
||||
LIB = $(FOAM_LIBBIN)/libsolid
|
||||
17
applications/solvers/modules/solid/solid/Make/options
Normal file
17
applications/solvers/modules/solid/solid/Make/options
Normal file
@ -0,0 +1,17 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/physicalProperties/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/cfdTools \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/sampling/lnInclude
|
||||
|
||||
LIB_LIBS = \
|
||||
-lsolidThermo \
|
||||
-lspecie \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools \
|
||||
-lsampling \
|
||||
-lfvModels \
|
||||
-lfvConstraints
|
||||
211
applications/solvers/modules/solid/solid/solid.C
Normal file
211
applications/solvers/modules/solid/solid/solid.C
Normal file
@ -0,0 +1,211 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2022 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/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "solid.H"
|
||||
#include "localEulerDdtScheme.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace solvers
|
||||
{
|
||||
defineTypeNameAndDebug(solid, 0);
|
||||
addToRunTimeSelectionTable(solver, solid, fvMesh);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
void Foam::solvers::solid::read()
|
||||
{
|
||||
maxDi =
|
||||
runTime.controlDict().lookupOrDefault<scalar>("maxDi", 1.0);
|
||||
|
||||
maxDeltaT_ =
|
||||
runTime.controlDict().lookupOrDefault<scalar>("maxDeltaT", great);
|
||||
}
|
||||
|
||||
|
||||
void Foam::solvers::solid::correctDiNum()
|
||||
{
|
||||
const volScalarField kappa
|
||||
(
|
||||
thermo.isotropic()
|
||||
? thermo.kappa()
|
||||
: mag(thermo.Kappa())()
|
||||
);
|
||||
|
||||
const surfaceScalarField kapparhoCpbyDelta
|
||||
(
|
||||
sqr(mesh.surfaceInterpolation::deltaCoeffs())
|
||||
*fvc::interpolate(kappa)
|
||||
/fvc::interpolate(thermo.rho()*thermo.Cp())
|
||||
);
|
||||
|
||||
DiNum = max(kapparhoCpbyDelta).value()*runTime.deltaTValue();
|
||||
const scalar meanDiNum =
|
||||
average(kapparhoCpbyDelta).value()*runTime.deltaTValue();
|
||||
|
||||
Info<< "Region: " << mesh.name() << " Diffusion Number mean: " << meanDiNum
|
||||
<< " max: " << DiNum << endl;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::solvers::solid::solid(fvMesh& mesh)
|
||||
:
|
||||
solver(mesh),
|
||||
|
||||
pThermo(solidThermo::New(mesh)),
|
||||
thermo(pThermo()),
|
||||
|
||||
T(thermo.T()),
|
||||
|
||||
DiNum(0)
|
||||
{
|
||||
// Read the controls
|
||||
read();
|
||||
|
||||
thermo.validate("solid", "h", "e");
|
||||
|
||||
if (transient())
|
||||
{
|
||||
correctDiNum();
|
||||
}
|
||||
else if (LTS)
|
||||
{
|
||||
FatalError
|
||||
<< type()
|
||||
<< " solver does not support LTS, use 'steadyState' ddtScheme"
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::solvers::solid::~solid()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::scalar Foam::solvers::solid::maxDeltaT() const
|
||||
{
|
||||
if (DiNum > small)
|
||||
{
|
||||
const scalar deltaT = maxDi*runTime.deltaTValue()/DiNum;
|
||||
return min(min(deltaT, fvModels().maxDeltaT()), maxDeltaT_);
|
||||
}
|
||||
else
|
||||
{
|
||||
return maxDeltaT_;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::solvers::solid::preSolve()
|
||||
{
|
||||
// Read the controls
|
||||
read();
|
||||
|
||||
fvModels().preUpdateMesh();
|
||||
|
||||
// Update the mesh for topology change, mesh to mesh mapping
|
||||
mesh.update();
|
||||
|
||||
if (transient())
|
||||
{
|
||||
correctDiNum();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool Foam::solvers::solid::moveMesh()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void Foam::solvers::solid::prePredictor()
|
||||
{}
|
||||
|
||||
|
||||
void Foam::solvers::solid::momentumPredictor()
|
||||
{}
|
||||
|
||||
|
||||
void Foam::solvers::solid::thermophysicalPredictor()
|
||||
{
|
||||
volScalarField& e = thermo.he();
|
||||
const volScalarField& rho = thermo.rho();
|
||||
|
||||
while (pimple.correctNonOrthogonal())
|
||||
{
|
||||
fvScalarMatrix eEqn
|
||||
(
|
||||
fvm::ddt(rho, e)
|
||||
+ thermo.divq(e)
|
||||
==
|
||||
fvModels().source(rho, e)
|
||||
);
|
||||
|
||||
eEqn.relax();
|
||||
|
||||
fvConstraints().constrain(eEqn);
|
||||
|
||||
eEqn.solve();
|
||||
|
||||
fvConstraints().constrain(e);
|
||||
}
|
||||
|
||||
thermo.correct();
|
||||
}
|
||||
|
||||
|
||||
void Foam::solvers::solid::pressureCorrector()
|
||||
{}
|
||||
|
||||
|
||||
void Foam::solvers::solid::momentumTransportCorrector()
|
||||
{}
|
||||
|
||||
|
||||
void Foam::solvers::solid::thermophysicalTransportCorrector()
|
||||
{}
|
||||
|
||||
|
||||
void Foam::solvers::solid::postSolve()
|
||||
{}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
167
applications/solvers/modules/solid/solid/solid.H
Normal file
167
applications/solvers/modules/solid/solid/solid.H
Normal file
@ -0,0 +1,167 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2022 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/>.
|
||||
|
||||
Class
|
||||
Foam::solvers::solid
|
||||
|
||||
Description
|
||||
Solver module for turbulent flow of compressible fluids for conjugate heat
|
||||
transfer, HVAC and similar applications, with optional mesh motion and mesh
|
||||
topology changes.
|
||||
|
||||
SourceFiles
|
||||
solid.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef solid_H
|
||||
#define solid_H
|
||||
|
||||
#include "solver.H"
|
||||
#include "solidThermo.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace solvers
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class solid Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class solid
|
||||
:
|
||||
public solver
|
||||
{
|
||||
|
||||
protected:
|
||||
|
||||
// Control parameters
|
||||
|
||||
scalar maxDi;
|
||||
|
||||
scalar maxDeltaT_;
|
||||
|
||||
|
||||
// Thermophysical properties
|
||||
|
||||
autoPtr<solidThermo> pThermo;
|
||||
|
||||
solidThermo& thermo;
|
||||
|
||||
volScalarField& T;
|
||||
|
||||
|
||||
// Time-step controls
|
||||
|
||||
scalar DiNum;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Read controls
|
||||
void read();
|
||||
|
||||
//- Set rDeltaT for LTS
|
||||
// void setRDeltaT();
|
||||
|
||||
//- Correct the cached Courant numbers
|
||||
void correctDiNum();
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("solid");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from region mesh
|
||||
solid(fvMesh& mesh);
|
||||
|
||||
//- Disallow default bitwise copy construction
|
||||
solid(const solid&) = delete;
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~solid();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return the current maximum time-step for stable solution
|
||||
virtual scalar maxDeltaT() const;
|
||||
|
||||
//- Called at the start of the time-step, before the PIMPLE loop
|
||||
virtual void preSolve();
|
||||
|
||||
//- Called at the start of the PIMPLE loop to move the mesh
|
||||
virtual bool moveMesh();
|
||||
|
||||
//- Called at the beginning of the PIMPLE loop
|
||||
virtual void prePredictor();
|
||||
|
||||
//- Construct and optionally solve the momentum equation
|
||||
virtual void momentumPredictor();
|
||||
|
||||
//- Construct and solve the energy equation,
|
||||
// convert to temperature
|
||||
// and update thermophysical and transport properties
|
||||
virtual void thermophysicalPredictor();
|
||||
|
||||
//- Construct and solve the pressure equation in the PISO loop
|
||||
virtual void pressureCorrector();
|
||||
|
||||
//- Correct the momentum transport modelling
|
||||
// Newtonian, non-Newtonian or turbulent
|
||||
virtual void momentumTransportCorrector();
|
||||
|
||||
//- Correct the thermophysical transport modelling
|
||||
virtual void thermophysicalTransportCorrector();
|
||||
|
||||
//- Called after the PIMPLE loop at the end of the time-step
|
||||
virtual void postSolve();
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const solid&) = delete;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace solvers
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
Reference in New Issue
Block a user