From f75d998b10572e06dde60d1ab7a63f5dd3964706 Mon Sep 17 00:00:00 2001 From: andy <andy> Date: Mon, 12 Nov 2012 10:45:11 +0000 Subject: [PATCH] ENH: Added film coverage calculation to thermoSingleLayer film model --- .../thermoSingleLayer/thermoSingleLayer.C | 40 +++++++++++++++++++ .../thermoSingleLayer/thermoSingleLayer.H | 21 +++++++++- 2 files changed, 60 insertions(+), 1 deletion(-) diff --git a/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayer.C b/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayer.C index 1cb392eb6aa..758abe807b4 100644 --- a/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayer.C +++ b/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayer.C @@ -227,6 +227,33 @@ void thermoSingleLayer::transferPrimaryRegionSourceFields() } +void thermoSingleLayer::correctAlpha() +{ + if (hydrophilic_) + { + const scalar hydrophilicDry = hydrophilicDryScale_*deltaWet_; + const scalar hydrophilicWet = hydrophilicWetScale_*deltaWet_; + + forAll(alpha_, i) + { + if ((alpha_[i] < 0.5) && (delta_[i] > hydrophilicDry)) + { + alpha_[i] = 1.0; + } + else if ((alpha_[i] > 0.5) && (delta_[i] < hydrophilicWet)) + { + alpha_[i] = 0.0; + } + } + } + else + { + alpha_ == + pos(delta_ - dimensionedScalar("deltaWet", dimLength, deltaWet_)); + } +} + + void thermoSingleLayer::updateSubmodels() { if (debug) @@ -426,6 +453,11 @@ thermoSingleLayer::thermoSingleLayer zeroGradientFvPatchScalarField::typeName ), + deltaWet_(readScalar(coeffs_.lookup("deltaWet"))), + hydrophilic_(readBool(coeffs_.lookup("hydrophilic"))), + hydrophilicDryScale_(0.0), + hydrophilicWetScale_(0.0), + hsSp_ ( IOobject @@ -510,6 +542,12 @@ thermoSingleLayer::thermoSingleLayer } } + if (hydrophilic_) + { + coeffs_.lookup("hydrophilicDryScale") >> hydrophilicDryScale_; + coeffs_.lookup("hydrophilicWetScale") >> hydrophilicWetScale_; + } + if (readFields) { transferPrimaryRegionThermoFields(); @@ -584,6 +622,8 @@ void thermoSingleLayer::evolveRegion() Info<< "thermoSingleLayer::evolveRegion()" << endl; } + correctAlpha(); + updateSubmodels(); // Solve continuity for deltaRho_ diff --git a/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayer.H b/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayer.H index 6814e25a3e4..bce30b44837 100644 --- a/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayer.H +++ b/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayer.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -123,6 +123,22 @@ protected: volScalarField primaryEnergyPCTrans_; + //- Threshold film thickness beyond which the film is considered 'wet' + scalar deltaWet_; + + + // Hyprophilic/phobic properties + + //- Activation flag + bool hydrophilic_; + + //- Length scale applied to deltaWet_ for dry faces, typically 0.5 + scalar hydrophilicDryScale_; + + //- Length scale applied to deltaWet_ for wet faces, typically 0.001 + scalar hydrophilicWetScale_; + + // Source term fields // Film region - registered to the film region mesh @@ -190,6 +206,9 @@ protected: //- Transfer source fields from the primary region to the film region virtual void transferPrimaryRegionSourceFields(); + //- Correct film coverage field + virtual void correctAlpha(); + //- Update the film sub-models virtual void updateSubmodels(); -- GitLab