diff --git a/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/filmViscosityModel/filmViscosityModel.C b/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/filmViscosityModel/filmViscosityModel.C new file mode 100644 index 0000000000000000000000000000000000000000..69f75267af274d4e24dacff869b282cc10be0278 --- /dev/null +++ b/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/filmViscosityModel/filmViscosityModel.C @@ -0,0 +1,75 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "filmViscosityModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace regionModels +{ +namespace surfaceFilmModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(filmViscosityModel, 0); +defineRunTimeSelectionTable(filmViscosityModel, dictionary); + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +filmViscosityModel::filmViscosityModel +( + const word& type, + const surfaceFilmModel& owner, + const dictionary& dict, + volScalarField& mu +) +: + subModelBase(type, owner, dict), + mu_(mu) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +filmViscosityModel::~filmViscosityModel() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +void filmViscosityModel::info(Ostream& os) const +{} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // end namespace surfaceFilmModels +} // end namespace regionModels +} // end namespace Foam + +// ************************************************************************* // diff --git a/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/filmViscosityModel/filmViscosityModel.H b/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/filmViscosityModel/filmViscosityModel.H new file mode 100644 index 0000000000000000000000000000000000000000..26489bfa09f9a357ad1590638350be854f15f1e2 --- /dev/null +++ b/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/filmViscosityModel/filmViscosityModel.H @@ -0,0 +1,156 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 <http://www.gnu.org/licenses/>. + +Class + Foam::filmViscosityModel + +Description + Base class for surface film viscosity models + +SourceFiles + filmViscosityModel.C + filmViscosityModelNew.C + +\*---------------------------------------------------------------------------*/ + +#ifndef filmViscosityModel_H +#define filmViscosityModel_H + +#include "subModelBase.H" +#include "runTimeSelectionTables.H" +#include "scalarField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace regionModels +{ +namespace surfaceFilmModels +{ + +/*---------------------------------------------------------------------------*\ + Class filmViscosityModel Declaration +\*---------------------------------------------------------------------------*/ + +class filmViscosityModel +: + public subModelBase +{ +private: + + // Private Member Functions + + //- Disallow default bitwise copy construct + filmViscosityModel(const filmViscosityModel&); + + //- Disallow default bitwise assignment + void operator=(const filmViscosityModel&); + + +protected: + + // Protected Member Data + + //- Reference to the viscosity field + volScalarField& mu_; + + +public: + + //- Runtime type information + TypeName("filmViscosityModel"); + + + // Declare runtime constructor selection table + + declareRunTimeSelectionTable + ( + autoPtr, + filmViscosityModel, + dictionary, + ( + const surfaceFilmModel& owner, + const dictionary& dict, + volScalarField& mu + ), + (owner, dict, mu) + ); + + // Constructors + + //- Construct from type name, dictionary and surface film model + filmViscosityModel + ( + const word& type, + const surfaceFilmModel& owner, + const dictionary& dict, + volScalarField& mu + ); + + + // Selectors + + //- Return a reference to the selected phase change model + static autoPtr<filmViscosityModel> New + ( + const surfaceFilmModel& owner, + const dictionary& dict, + volScalarField& mu + ); + + + //- Destructor + virtual ~filmViscosityModel(); + + + // Member Functions + + // Evolution + + //- Correct + virtual void correct + ( + const volScalarField& p, + const volScalarField& T + ) = 0; + + + // I-O + + //- Provide some feedback + virtual void info(Ostream& os) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace surfaceFilmModels +} // End namespace regionModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/filmViscosityModel/filmViscosityModelNew.C b/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/filmViscosityModel/filmViscosityModelNew.C new file mode 100644 index 0000000000000000000000000000000000000000..a78bd24e5cad153dd35908270ed8ccb131bbcbdb --- /dev/null +++ b/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/filmViscosityModel/filmViscosityModelNew.C @@ -0,0 +1,79 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "filmViscosityModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace regionModels +{ +namespace surfaceFilmModels +{ + +// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // + +autoPtr<filmViscosityModel> filmViscosityModel::New +( + const surfaceFilmModel& model, + const dictionary& dict, + volScalarField& mu +) +{ + word modelType(dict.lookup("filmViscosityModel")); + + Info<< " Selecting filmViscosityModel " << modelType << endl; + + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(modelType); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalErrorIn + ( + "filmViscosityModel::New" + "(" + "const surfaceFilmModel&, " + "const dictionary&, " + "volScalarField&" + ")" + ) << "Unknown filmViscosityModel type " << modelType + << nl << nl << "Valid filmViscosityModel types are:" << nl + << dictionaryConstructorTablePtr_->toc() + << exit(FatalError); + } + + return autoPtr<filmViscosityModel>(cstrIter()(model, dict, mu)); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // end namespace surfaceFilmModels +} // end namespace regionModels +} // end namespace Foam + +// ************************************************************************* // diff --git a/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayer.C b/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayer.C index 560164221e88fcf998bfb6de23493b8d5196f16b..8fafa3529e69e5b5564e5b3e298f71b679d01556 100644 --- a/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayer.C +++ b/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayer.C @@ -34,6 +34,7 @@ License // Sub-models #include "filmThermoModel.H" +#include "filmViscosityModel.H" #include "heatTransferModel.H" #include "phaseChangeModel.H" #include "filmRadiationModel.H" @@ -298,6 +299,9 @@ void thermoSingleLayer::solveEnergy() ); correctThermoFields(); + + // evaluate viscosity from user-model + viscosity_->correct(pPrimary_, T_); } @@ -480,6 +484,7 @@ thermoSingleLayer::thermoSingleLayer YPrimary_(), + viscosity_(filmViscosityModel::New(*this, coeffs(), mu_)), htcs_ ( heatTransferModel::New(*this, coeffs().subDict("upperSurfaceModels")) @@ -548,6 +553,9 @@ thermoSingleLayer::thermoSingleLayer hs_ == hs(T_); deltaRho_ == delta_*rho_; phi_ = fvc::interpolate(deltaRho_*U_) & regionMesh().Sf(); + + // evaluate viscosity from user-model +// viscosity_->correct(pPrimary_, T_); } } diff --git a/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayer.H b/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayer.H index e2fbe233704b33da25092d0a76dacd268663d3ab..e7a11acac64983b704133d87fac89a5de121b88a 100644 --- a/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayer.H +++ b/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayer.H @@ -52,6 +52,7 @@ namespace surfaceFilmModels { // Forward declaration of classes +class filmViscosityModel; class heatTransferModel; class phaseChangeModel; class filmRadiationModel; @@ -165,6 +166,9 @@ protected: // Sub-models + //- Viscosity model + autoPtr<filmViscosityModel> viscosity_; + //- Heat transfer coefficient bewteen film surface and primary // region [W/m2/K] autoPtr<heatTransferModel> htcs_;