mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-12-28 03:37:59 +00:00
Provides run-time selection of buoyancy sources for compressible solvers
Replaces the built-in buoyancy sources in XiFoam, reactingFoam and
rhoReactingFoam.
e.g. in constant/fvOptions specify
momentumSource
{
type buoyancyForce;
buoyancyForceCoeffs
{
fieldNames (U);
}
}
and optionally specify the buoyancy energy source in the enthalpy
equation:
energySource
{
type buoyancyEnergy;
buoyancyEnergyCoeffs
{
fieldNames (h);
}
}
or internal energy equation
energySource
{
type buoyancyEnergy;
buoyancyEnergyCoeffs
{
fieldNames (e);
}
}
37 lines
727 B
C
37 lines
727 B
C
{
|
|
volScalarField& he = thermo.he();
|
|
|
|
fvScalarMatrix EEqn
|
|
(
|
|
fvm::ddt(rho, he) + mvConvection->fvmDiv(phi, he)
|
|
+ fvc::ddt(rho, K) + fvc::div(phi, K)
|
|
+ (
|
|
he.name() == "e"
|
|
? fvc::div
|
|
(
|
|
fvc::absolute(phi/fvc::interpolate(rho), U),
|
|
p,
|
|
"div(phiv,p)"
|
|
)
|
|
: -dpdt
|
|
)
|
|
- fvm::laplacian(turbulence->alphaEff(), he)
|
|
==
|
|
reaction->Sh()
|
|
+ fvOptions(rho, he)
|
|
);
|
|
|
|
EEqn.relax();
|
|
|
|
fvOptions.constrain(EEqn);
|
|
|
|
EEqn.solve();
|
|
|
|
fvOptions.correct(he);
|
|
|
|
thermo.correct();
|
|
|
|
Info<< "min/max(T) = "
|
|
<< min(T).value() << ", " << max(T).value() << endl;
|
|
}
|