mass based velocity control - working but not feasible approach
This commit is contained in:
parent
a659368959
commit
cc3d365b3d
2 changed files with 13 additions and 2 deletions
|
|
@ -57,7 +57,8 @@ flameControllingVelocityFvPatchVectorField
|
|||
refValue_("refValue", dict, p.size()),
|
||||
Tref_(dict.lookupOrDefault<scalar>("Tref", 300.0)),
|
||||
startTime_(dict.lookupOrDefault("startTime", db().time().startTime().value())),
|
||||
lastVolume(-1)
|
||||
lastVolume(-1),
|
||||
lastMass(-1)
|
||||
{
|
||||
fvPatchVectorField::operator=(refValue_*patch().nf());
|
||||
}
|
||||
|
|
@ -154,12 +155,15 @@ void Foam::flameControllingVelocityFvPatchVectorField::updateCoeffs()
|
|||
scalar thisTime = db().time().timeOutputValue();
|
||||
|
||||
|
||||
const volScalarField &rho (db().lookupObject<volScalarField>("rho"));
|
||||
const volScalarField &T (db().lookupObject<volScalarField>("T"));
|
||||
|
||||
dimensionedScalar Tref("Tref", T.dimensions(), Tref_);
|
||||
|
||||
scalar lowTVolume = fvc::domainIntegrate(Foam::neg(T - Tref)).value();
|
||||
|
||||
scalar lowTMass = fvc::domainIntegrate(rho * Foam::neg(T - Tref)).value();
|
||||
|
||||
if (thisTime - lastTime > 0.0 && startTime_ <= thisTime)
|
||||
{
|
||||
scalar domainVolume = gSum(patch().boundaryMesh().mesh().V());
|
||||
|
|
@ -176,13 +180,18 @@ void Foam::flameControllingVelocityFvPatchVectorField::updateCoeffs()
|
|||
if (lastVolume < 0)
|
||||
{
|
||||
lastVolume = lowTVolume;
|
||||
lastMass = lowTMass;
|
||||
}
|
||||
|
||||
scalar dTV = lowTVolume - lastVolume;
|
||||
|
||||
scalar dTM = lowTMass - lastMass;
|
||||
|
||||
scalar patchArea = gSum(patch().magSf());
|
||||
|
||||
scalar dVel = (dTV / dt / patchArea);
|
||||
scalar patchRhoArea = gSum(patch().magSf() * rho.boundaryField()[patch().index()]);
|
||||
|
||||
scalar dVel = (dTM / dt / patchRhoArea);
|
||||
|
||||
Info << endl;
|
||||
Info << "delta Velocity " ;
|
||||
|
|
|
|||
|
|
@ -91,6 +91,8 @@ class flameControllingVelocityFvPatchVectorField
|
|||
|
||||
scalar lastVolume;
|
||||
|
||||
scalar lastMass;
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue