From 1d4bedae682a66e3f221c7169c6e2c4f5f71fc48 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Tue, 2 Aug 2016 21:35:37 +0100 Subject: [PATCH] surfaceFilmModels::BrunDrippingInjection: New dripping model based on the Rayleigh-Taylor stability analysis of film flow on an inclined plane by Brun et.al. Brun, P. T., Damiano, A., Rieu, P., Balestra, G., & Gallaire, F. (2015). Rayleigh-Taylor instability under an inclined plane. Physics of Fluids (1994-present), 27(8), 084107. --- src/regionModels/surfaceFilmModels/Make/files | 1 + .../kinematicSingleLayer.H | 2 +- .../BrunDrippingInjection.C | 182 ++++++++++++++++++ .../BrunDrippingInjection.H | 151 +++++++++++++++ 4 files changed, 335 insertions(+), 1 deletion(-) create mode 100644 src/regionModels/surfaceFilmModels/submodels/kinematic/injectionModel/BrunDrippingInjection/BrunDrippingInjection.C create mode 100644 src/regionModels/surfaceFilmModels/submodels/kinematic/injectionModel/BrunDrippingInjection/BrunDrippingInjection.H diff --git a/src/regionModels/surfaceFilmModels/Make/files b/src/regionModels/surfaceFilmModels/Make/files index 0f6502d8e..e17e76bbf 100644 --- a/src/regionModels/surfaceFilmModels/Make/files +++ b/src/regionModels/surfaceFilmModels/Make/files @@ -20,6 +20,7 @@ $(KINEMATICMODELS)/injectionModel/injectionModel/injectionModel.C $(KINEMATICMODELS)/injectionModel/injectionModel/injectionModelNew.C $(KINEMATICMODELS)/injectionModel/injectionModelList/injectionModelList.C $(KINEMATICMODELS)/injectionModel/drippingInjection/drippingInjection.C +$(KINEMATICMODELS)/injectionModel/BrunDrippingInjection/BrunDrippingInjection.C $(KINEMATICMODELS)/injectionModel/patchInjection/patchInjection.C $(KINEMATICMODELS)/injectionModel/curvatureSeparation/curvatureSeparation.C diff --git a/src/regionModels/surfaceFilmModels/kinematicSingleLayer/kinematicSingleLayer.H b/src/regionModels/surfaceFilmModels/kinematicSingleLayer/kinematicSingleLayer.H index 2a51b9270..9ecdf418e 100644 --- a/src/regionModels/surfaceFilmModels/kinematicSingleLayer/kinematicSingleLayer.H +++ b/src/regionModels/surfaceFilmModels/kinematicSingleLayer/kinematicSingleLayer.H @@ -340,7 +340,7 @@ public: //- Return const access to the dynamic viscosity / [Pa.s] inline const volScalarField& mu() const; - //- Return const access to the surface tension / [m/s2] + //- Return const access to the surface tension / [kg/s2] inline const volScalarField& sigma() const; diff --git a/src/regionModels/surfaceFilmModels/submodels/kinematic/injectionModel/BrunDrippingInjection/BrunDrippingInjection.C b/src/regionModels/surfaceFilmModels/submodels/kinematic/injectionModel/BrunDrippingInjection/BrunDrippingInjection.C new file mode 100644 index 000000000..57132e13e --- /dev/null +++ b/src/regionModels/surfaceFilmModels/submodels/kinematic/injectionModel/BrunDrippingInjection/BrunDrippingInjection.C @@ -0,0 +1,182 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2016 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 . + +\*---------------------------------------------------------------------------*/ + +#include "BrunDrippingInjection.H" +#include "addToRunTimeSelectionTable.H" +#include "fvMesh.H" +#include "Time.H" +#include "mathematicalConstants.H" +#include "Random.H" +#include "volFields.H" +#include "kinematicSingleLayer.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace regionModels +{ +namespace surfaceFilmModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(BrunDrippingInjection, 0); +addToRunTimeSelectionTable(injectionModel, BrunDrippingInjection, dictionary); + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +BrunDrippingInjection::BrunDrippingInjection +( + surfaceFilmModel& owner, + const dictionary& dict +) +: + injectionModel(type(), owner, dict), + ubarStar_(coeffDict_.lookupOrDefault("ubarStar", 1.62208)), + deltaStable_(readScalar(coeffDict_.lookup("deltaStable"))), + particlesPerParcel_(readScalar(coeffDict_.lookup("particlesPerParcel"))), + rndGen_(label(0), -1), + parcelDistribution_ + ( + distributionModels::distributionModel::New + ( + coeffDict_.subDict("parcelDistribution"), + rndGen_ + ) + ), + diameter_(owner.regionMesh().nCells(), -1.0) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +BrunDrippingInjection::~BrunDrippingInjection() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +void BrunDrippingInjection::correct +( + scalarField& availableMass, + scalarField& massToInject, + scalarField& diameterToInject +) +{ + const kinematicSingleLayer& film = + refCast(this->owner()); + + const scalar pi = constant::mathematical::pi; + + // Calculate available dripping mass + tmp tsinAlpha(film.gNorm()/mag(film.g())); + const scalarField& sinAlpha = tsinAlpha(); + const scalarField& magSf = film.magSf(); + + const scalarField& delta = film.delta(); + const scalarField& rho = film.rho(); + const scalarField& sigma = film.sigma(); + const scalar magg = mag(film.g().value()); + + scalarField massDrip(film.regionMesh().nCells(), 0.0); + + forAll(delta, i) + { + if (sinAlpha[i] > SMALL && delta[i] > deltaStable_) + { + scalar lc = sqrt(sigma[i]/(rho[i]*magg)); + scalar deltaStable = max + ( + 3*lc*sqrt(1 - sqr(sinAlpha[i])) + /(ubarStar_*sqrt(sinAlpha[i])*sinAlpha[i]), + deltaStable_ + ); + + Info<< delta[i] << " " << deltaStable << endl; + if (delta[i] > deltaStable) + { + const scalar ddelta = max(0.0, delta[i] - deltaStable); + massDrip[i] += + min(availableMass[i], max(0.0, ddelta*rho[i]*magSf[i])); + } + } + } + + + // Collect the data to be transferred + forAll(massDrip, celli) + { + if (massDrip[celli] > 0) + { + // Set new particle diameter if not already set + if (diameter_[celli] < 0) + { + diameter_[celli] = parcelDistribution_->sample(); + } + + scalar& diam = diameter_[celli]; + scalar rhoc = rho[celli]; + scalar minMass = particlesPerParcel_*rhoc*pi/6*pow3(diam); + + if (massDrip[celli] > minMass) + { + // All drip mass can be injected + massToInject[celli] += massDrip[celli]; + availableMass[celli] -= massDrip[celli]; + + // Set particle diameter + diameterToInject[celli] = diam; + + // Retrieve new particle diameter sample + diam = parcelDistribution_->sample(); + + addToInjectedMass(massDrip[celli]); + } + else + { + // Particle mass below minimum threshold - cannot be injected + massToInject[celli] = 0; + diameterToInject[celli] = 0; + } + } + else + { + massToInject[celli] = 0; + diameterToInject[celli] = 0; + } + } + + injectionModel::correct(); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace surfaceFilmModels +} // End namespace regionModels +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/regionModels/surfaceFilmModels/submodels/kinematic/injectionModel/BrunDrippingInjection/BrunDrippingInjection.H b/src/regionModels/surfaceFilmModels/submodels/kinematic/injectionModel/BrunDrippingInjection/BrunDrippingInjection.H new file mode 100644 index 000000000..9acdf9f0b --- /dev/null +++ b/src/regionModels/surfaceFilmModels/submodels/kinematic/injectionModel/BrunDrippingInjection/BrunDrippingInjection.H @@ -0,0 +1,151 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2016 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 . + +Class + Foam::BrunDrippingInjection + +Description + Film Dripping mass transfer model. + + If the film thickness exceeds the critical value needed to generate a valid + parcel, the equivalent mass is removed from the film. The critical film + thickness is calculated from the Rayleigh-Taylor stability analysis + of film flow on an inclined plane by Brun et.al. + + Reference: + \verbatim + Brun, P. T., Damiano, A., Rieu, P., Balestra, G., & Gallaire, F. (2015). + Rayleigh-Taylor instability under an inclined plane. + Physics of Fluids (1994-present), 27(8), 084107. + \endverbatim + + New parcel diameters are sampled from a PDF. + +SourceFiles + BrunDrippingInjection.C + +\*---------------------------------------------------------------------------*/ + +#ifndef BrunDrippingInjection_H +#define BrunDrippingInjection_H + +#include "injectionModel.H" +#include "distributionModel.H" +#include "cachedRandom.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace regionModels +{ +namespace surfaceFilmModels +{ + +/*---------------------------------------------------------------------------*\ + Class BrunDrippingInjection Declaration +\*---------------------------------------------------------------------------*/ + +class BrunDrippingInjection +: + public injectionModel +{ + // Private member functions + + //- Disallow default bitwise copy construct + BrunDrippingInjection(const BrunDrippingInjection&); + + //- Disallow default bitwise assignment + void operator=(const BrunDrippingInjection&); + + +protected: + + // Protected data + + //- Critical non-dimensional interface velocity + // Coefficient in the film angle stability function + // defaults to 1.62208 + scalar ubarStar_; + + //- Stable film thickness - drips only formed if thickness + // execeeds this threhold value + scalar deltaStable_; + + //- Number of particles per parcel + scalar particlesPerParcel_; + + //- Random number generator + cachedRandom rndGen_; + + //- Parcel size PDF model + const autoPtr + parcelDistribution_; + + //- Diameters of particles to inject into the dripping + scalarList diameter_; + + +public: + + //- Runtime type information + TypeName("BrunDrippingInjection"); + + + // Constructors + + //- Construct from surface film model + BrunDrippingInjection + ( + surfaceFilmModel& owner, + const dictionary& dict + ); + + + //- Destructor + virtual ~BrunDrippingInjection(); + + + // Member Functions + + //- Correct + virtual void correct + ( + scalarField& availableMass, + scalarField& massToInject, + scalarField& diameterToInject + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace surfaceFilmModels +} // End namespace regionModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* //