Some experiments to get more stability.

This commit is contained in:
tlichtenegger
2018-04-19 15:07:24 +02:00
parent 24c5c25f7c
commit d8682c6a79
5 changed files with 55 additions and 11 deletions

View File

@ -52,4 +52,9 @@
thermo.correct(); thermo.correct();
Info<< "T max/min : " << max(T).value() << " " << min(T).value() << endl; Info<< "T max/min : " << max(T).value() << " " << min(T).value() << endl;
particleCloud.clockM().start(31,"energySolve");
particleCloud.solve();
particleCloud.clockM().stop("energySolve");
} }

View File

@ -19,14 +19,21 @@ fvOptions.constrain(UEqn);
if (modelType=="B" || modelType=="Bfull") if (modelType=="B" || modelType=="Bfull")
{ {
solve(UEqn == -fvc::grad(p)+ Ksl*Us); solve(UEqn == -fvc::grad(p)+ Ksl*Us);
fvOptions.correct(U);
K = 0.5*magSqr(U);
} }
else else
{ {
solve(UEqn == -voidfraction*fvc::grad(p)+ Ksl*Us); solve(UEqn == -voidfraction*fvc::grad(p)+ Ksl*Us);
}
fvOptions.correct(U); fvOptions.correct(U);
K = 0.5*magSqr(U);
// limit vel
forAll(U,cellI)
{
scalar mU = mag(U[cellI]);
if (mU > 200.0) U[cellI] *= 200.0/mU;
} }
K = 0.5*magSqr(U);

View File

@ -108,12 +108,14 @@ int main(int argc, char *argv[])
// Pressure-velocity SIMPLE corrector // Pressure-velocity SIMPLE corrector
#include "UEqn.H" #include "UEqn.H"
#include "EEqn.H"
// besides this pEqn, OF offers a "simple consistent"-option // besides this pEqn, OF offers a "simple consistent"-option
#include "pEqn.H" #include "pEqn.H"
rhoeps=rho*voidfraction; rhoeps=rho*voidfraction;
#include "EEqn.H"
turbulence->correct(); turbulence->correct();
particleCloud.clockM().start(32,"postFlow"); particleCloud.clockM().start(32,"postFlow");

View File

@ -75,6 +75,16 @@ else
{ {
U = HbyA - rAU*(fvc::grad(p)-Ksl*Us); U = HbyA - rAU*(fvc::grad(p)-Ksl*Us);
} }
// limit vel
forAll(U,cellI)
{
scalar mU = mag(U[cellI]);
if (mU > 200.0) U[cellI] *= 200.0/mU;
}
U.correctBoundaryConditions(); U.correctBoundaryConditions();
fvOptions.correct(U); fvOptions.correct(U);
K = 0.5*magSqr(U); K = 0.5*magSqr(U);

View File

@ -81,6 +81,8 @@ heatTransferGunnPartField::heatTransferGunnPartField
FatalError << "heatTransferGunnPartField: provide list of specific heat capacities." << abort(FatalError); FatalError << "heatTransferGunnPartField: provide list of specific heat capacities." << abort(FatalError);
} }
partTempField_.writeOpt() = IOobject::AUTO_WRITE;
allocateMyArrays(); allocateMyArrays();
} }
@ -173,18 +175,29 @@ void heatTransferGunnPartField::postFlow()
void heatTransferGunnPartField::solve() void heatTransferGunnPartField::solve()
{ {
Info << "patch types of partTemp boundary: " << partTempField_.boundaryField().types() << endl; // for some weird reason, the particle-fluid heat transfer fields were defined with a negative sign
volScalarField Qsource = QPartFluidCoeff_*tempField_;
volScalarField alphaP = 1.0 - voidfraction_; volScalarField alphaP = 1.0 - voidfraction_;
volScalarField correctedQPartFluidCoeff(QPartFluidCoeff_);
// no heattransfer in empty cells -- for numerical stability, add small amount
forAll(correctedQPartFluidCoeff,cellI)
{
if (-correctedQPartFluidCoeff[cellI] < SMALL) correctedQPartFluidCoeff[cellI] = -SMALL;
}
volScalarField Qsource = correctedQPartFluidCoeff*tempField_;
volScalarField partCpEff = alphaP*partRhoField_*partCpField_; volScalarField partCpEff = alphaP*partRhoField_*partCpField_;
volScalarField thCondEff = alphaP*thermCondModel_().thermCond(); volScalarField thCondEff = alphaP*thermCondModel_().thermCond();
// thCondEff.correctBoundaryConditions(); // thCondEff.correctBoundaryConditions();
fvScalarMatrix partTEqn fvScalarMatrix partTEqn
( (
// fvm::ddt(partCpEff, partTempField_)
// + Qsource
Qsource Qsource
- fvm::Sp(QPartFluidCoeff_, partTempField_) - fvm::Sp(correctedQPartFluidCoeff, partTempField_)
- fvm::laplacian(thCondEff,partTempField_) - fvm::laplacian(thCondEff,partTempField_)
== ==
fvOptions(partCpEff, partTempField_) fvOptions(partCpEff, partTempField_)
@ -199,8 +212,15 @@ void heatTransferGunnPartField::solve()
partTEqn.solve(); partTEqn.solve();
partTempField_.relax();
fvOptions.correct(partTempField_); fvOptions.correct(partTempField_);
dimensionedScalar pTMin("pTMin",dimensionSet(0,0,0,1,0,0,0),293.0);
dimensionedScalar pTMax("pTMin",dimensionSet(0,0,0,1,0,0,0),3000.0);
partTempField_ = max(partTempField_, pTMin);
partTempField_ = min(partTempField_, pTMax);
Info<< "partT max/min : " << max(partTempField_).value() << " " << min(partTempField_).value() << endl; Info<< "partT max/min : " << max(partTempField_).value() << " " << min(partTempField_).value() << endl;
} }