ENH: surface film - updated removeInjection model

This commit is contained in:
andy
2013-11-22 15:07:36 +00:00
parent 42befaaa08
commit b0ca0d9dde
2 changed files with 54 additions and 8 deletions

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -45,11 +45,35 @@ addToRunTimeSelectionTable(injectionModel, removeInjection, dictionary);
removeInjection::removeInjection removeInjection::removeInjection
( (
const surfaceFilmModel& owner, const surfaceFilmModel& owner,
const dictionary& const dictionary& dict
) )
: :
injectionModel(owner) injectionModel(type(), owner, dict),
{} deltaStable_(coeffs_.lookupOrDefault<scalar>("deltaStable", 0.0)),
mask_(owner.regionMesh().nCells(), -1)
{
wordReList patches;
if (coeffs_.readIfPresent("patches", patches))
{
Info<< " applying to patches:" << nl;
const polyBoundaryMesh& pbm = owner.regionMesh().boundaryMesh();
const labelHashSet patchSet = pbm.patchSet(patches);
forAllConstIter(labelHashSet, patchSet, iter)
{
label patchI = iter.key();
const polyPatch& pp = pbm[patchI];
UIndirectList<scalar>(mask_, pp.faceCells()) = 1.0;
Info<< " " << pp.name() << endl;
}
}
else
{
Info<< " applying to all patches" << endl;
mask_ = 1.0;
}
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
@ -64,11 +88,23 @@ void removeInjection::correct
( (
scalarField& availableMass, scalarField& availableMass,
scalarField& massToInject, scalarField& massToInject,
scalarField& scalarField& diameterToInject
) )
{ {
massToInject = availableMass; const scalarField& delta = owner().delta();
availableMass = 0.0; const scalarField& rho = owner().rho();
const scalarField& magSf = owner().magSf();
forAll(delta, cellI)
{
if (mask_[cellI] > 0)
{
scalar ddelta = max(0.0, delta[cellI] - deltaStable_);
scalar dMass = ddelta*rho[cellI]*magSf[cellI];
massToInject[cellI] += dMass;
availableMass[cellI] -= dMass;
}
}
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -65,6 +65,16 @@ private:
void operator=(const removeInjection&); void operator=(const removeInjection&);
protected:
//- Stable film thickness - mass only removed if thickness execeeds
// this threhold value
scalar deltaStable_;
//- Mask per cell to indicate whether mass can be removed
scalarField mask_;
public: public:
//- Runtime type information //- Runtime type information