diff --git a/src/surfaceFilmModels/Make/files b/src/surfaceFilmModels/Make/files deleted file mode 100644 index 3f2aaef30153c5b6480af09d899887c3037364ff..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/Make/files +++ /dev/null @@ -1,38 +0,0 @@ -/* Surface film models */ -surfaceFilmModel/surfaceFilmModel/surfaceFilmModel.C -surfaceFilmModel/surfaceFilmModel/surfaceFilmModelNew.C -surfaceFilmModel/noFilm/noFilm.C -surfaceFilmModel/kinematicSingleLayer/kinematicSingleLayer.C -surfaceFilmModel/thermoSingleLayer/thermoSingleLayer.C - - -/* Sub-models */ -submodels/kinematic/injectionModel/injectionModel/injectionModel.C -submodels/kinematic/injectionModel/injectionModel/injectionModelNew.C -submodels/kinematic/injectionModel/noInjection/noInjection.C -submodels/kinematic/injectionModel/cloudInjection/cloudInjection.C -submodels/kinematic/injectionModel/removeInjection/removeInjection.C - -submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModel.C -submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModelNew.C -submodels/thermo/phaseChangeModel/noPhaseChange/noPhaseChange.C -submodels/thermo/phaseChangeModel/standardPhaseChange/standardPhaseChange.C - -submodels/thermo/heatTransferModel/heatTransferModel/heatTransferModel.C -submodels/thermo/heatTransferModel/heatTransferModel/heatTransferModelNew.C -submodels/thermo/heatTransferModel/constantHeatTransfer/constantHeatTransfer.C -submodels/thermo/heatTransferModel/mappedConvectiveHeatTransfer/mappedConvectiveHeatTransfer.C - - -/* Boundary conditions */ -derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFields.C -derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFields.C -derivedFvPatchFields/filmHeightInletVelocity/filmHeightInletVelocityFvPatchVectorField.C -derivedFvPatchFields/htcConv/htcConvFvPatchScalarField.C - -/* Wall functions for primary region */ -derivedFvPatchFields/wallFunctions/alphatFilmWallFunction/alphatFilmWallFunctionFvPatchScalarField.C -derivedFvPatchFields/wallFunctions/mutFilmWallFunction/mutFilmWallFunctionFvPatchScalarField.C - - -LIB = $(FOAM_LIBBIN)/libsurfaceFilmModels diff --git a/src/surfaceFilmModels/Make/options b/src/surfaceFilmModels/Make/options deleted file mode 100644 index 3b0199a09b5a9b3694ce73c9c915977c0441bb2a..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/Make/options +++ /dev/null @@ -1,23 +0,0 @@ -EXE_INC = \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/pointSolids/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/pointSolidMixture/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/pdfs/lnInclude \ - -I$(LIB_SRC)/turbulenceModels \ - -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ - -I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude - -EXE_LIBS = \ - -lSLGThermo \ - -lfiniteVolume \ - -lmeshTools \ - -lpdf \ - -lcompressibleRASModels \ - -lcompressibleLESModels diff --git a/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchField.C b/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchField.C deleted file mode 100644 index 0bbb056b9ac95db68977abe97bb164dbeb90cbbf..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchField.C +++ /dev/null @@ -1,154 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. - \\/ 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 "directMappedFixedInternalValueFvPatchField.H" -#include "UIndirectList.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -template<class Type> -directMappedFixedInternalValueFvPatchField<Type>:: -directMappedFixedInternalValueFvPatchField -( - const fvPatch& p, - const DimensionedField<Type, volMesh>& iF -) -: - directMappedFixedValueFvPatchField<Type>(p, iF) -{} - - -template<class Type> -directMappedFixedInternalValueFvPatchField<Type>:: -directMappedFixedInternalValueFvPatchField -( - const directMappedFixedInternalValueFvPatchField<Type>& ptf, - const fvPatch& p, - const DimensionedField<Type, volMesh>& iF, - const fvPatchFieldMapper& mapper -) -: - directMappedFixedValueFvPatchField<Type>(ptf, p, iF, mapper) -{} - - -template<class Type> -directMappedFixedInternalValueFvPatchField<Type>:: -directMappedFixedInternalValueFvPatchField -( - const fvPatch& p, - const DimensionedField<Type, volMesh>& iF, - const dictionary& dict -) -: - directMappedFixedValueFvPatchField<Type>(p, iF, dict) -{} - - -template<class Type> -directMappedFixedInternalValueFvPatchField<Type>:: -directMappedFixedInternalValueFvPatchField -( - const directMappedFixedInternalValueFvPatchField<Type>& ptf -) -: - directMappedFixedValueFvPatchField<Type>(ptf) -{} - - -template<class Type> -directMappedFixedInternalValueFvPatchField<Type>:: -directMappedFixedInternalValueFvPatchField -( - const directMappedFixedInternalValueFvPatchField<Type>& ptf, - const DimensionedField<Type, volMesh>& iF -) -: - directMappedFixedValueFvPatchField<Type>(ptf, iF) -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -template<class Type> -void directMappedFixedInternalValueFvPatchField<Type>::updateCoeffs() -{ - typedef GeometricField<Type, fvPatchField, volMesh> FieldType; - - if (this->updated()) - { - return; - } - - // Retrieve the neighbour values and assign to this patch boundary field - directMappedFixedValueFvPatchField<Type>::updateCoeffs(); - - // Get the coupling information from the directMappedPatchBase - const directMappedPatchBase& mpp = - refCast<const directMappedPatchBase>(this->patch().patch()); - const polyMesh& nbrMesh = mpp.sampleMesh(); - const fvPatch& nbrPatch = - refCast<const fvMesh> - ( - nbrMesh - ).boundary()[mpp.samplePolyPatch().index()]; - - // Force recalculation of mapping and schedule - const mapDistribute& distMap = mpp.map(); - - // Retrieve the neighbour field - const fvPatchField<Type>& nbrField = - nbrPatch.lookupPatchField<FieldType, Type> - ( - this->dimensionedInternalField().name() - ); - - // Retrieve the neighbour patch internal field - Field<Type> nbrIntFld(nbrField.patchInternalField()); - distMap.distribute(nbrIntFld); - - // Assign (this) patch internal field to its neighbour values - Field<Type>& intFld = const_cast<Field<Type>&>(this->internalField()); - UIndirectList<Type>(intFld, this->patch().faceCells()) = nbrIntFld; -} - - -template<class Type> -void directMappedFixedInternalValueFvPatchField<Type>::write(Ostream& os) const -{ - directMappedFixedValueFvPatchField<Type>::write(os); -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchField.H b/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchField.H deleted file mode 100644 index 4aef5ebd2cc83330135ec3b5731e5431b08046f5..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchField.H +++ /dev/null @@ -1,150 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. - \\/ 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::directMappedFixedInternalValueFvPatchField - -Description - Recycles the boundary and internal values of a neighbour patch field to - the boundary and internal values of *this. - -SourceFiles - directMappedFixedInternalValueFvPatchField.C - -\*---------------------------------------------------------------------------*/ - -#ifndef directMappedFixedInternalValueFvPatchField_H -#define directMappedFixedInternalValueFvPatchField_H - -#include "directMappedFixedValueFvPatchField.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class directMappedFixedInternalValueFvPatchField Declaration -\*---------------------------------------------------------------------------*/ - -template<class Type> -class directMappedFixedInternalValueFvPatchField -: - public directMappedFixedValueFvPatchField<Type> -{ - -public: - - //- Runtime type information - TypeName("directMappedFixedInternalValue"); - - - // Constructors - - //- Construct from patch and internal field - directMappedFixedInternalValueFvPatchField - ( - const fvPatch&, - const DimensionedField<Type, volMesh>& - ); - - //- Construct from patch, internal field and dictionary - directMappedFixedInternalValueFvPatchField - ( - const fvPatch&, - const DimensionedField<Type, volMesh>&, - const dictionary& - ); - - //- Construct by mapping given - // directMappedFixedInternalValueFvPatchField onto a new patch - directMappedFixedInternalValueFvPatchField - ( - const directMappedFixedInternalValueFvPatchField<Type>&, - const fvPatch&, - const DimensionedField<Type, volMesh>&, - const fvPatchFieldMapper& - ); - - //- Construct as copy - directMappedFixedInternalValueFvPatchField - ( - const directMappedFixedInternalValueFvPatchField<Type>& - ); - - //- Construct and return a clone - virtual tmp<fvPatchField<Type> > clone() const - { - return tmp<fvPatchField<Type> > - ( - new directMappedFixedInternalValueFvPatchField<Type>(*this) - ); - } - - //- Construct as copy setting internal field reference - directMappedFixedInternalValueFvPatchField - ( - const directMappedFixedInternalValueFvPatchField<Type>&, - const DimensionedField<Type, volMesh>& - ); - - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchField<Type> > clone - ( - const DimensionedField<Type, volMesh>& iF - ) const - { - return tmp<fvPatchField<Type> > - ( - new directMappedFixedInternalValueFvPatchField<Type>(*this, iF) - ); - } - - - // Member functions - - // Evaluation functions - - //- Update the coefficients associated with the patch field - virtual void updateCoeffs(); - - //- Write - virtual void write(Ostream&) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#ifdef NoRepository -# include "directMappedFixedInternalValueFvPatchField.C" -#endif - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFields.C b/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFields.C deleted file mode 100644 index 11a290c3c19f5225a7482b242637f722d39de1e6..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFields.C +++ /dev/null @@ -1,43 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. - \\/ 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 "directMappedFixedInternalValueFvPatchFields.H" -#include "volMesh.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -makePatchFields(directMappedFixedInternalValue); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFields.H b/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFields.H deleted file mode 100644 index efc2b26edfafbff7c70d97fed1d76cd43447c560..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFields.H +++ /dev/null @@ -1,49 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. - \\/ 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/>. - -\*---------------------------------------------------------------------------*/ - -#ifndef directMappedFixedInternalValueFvPatchFields_H -#define directMappedFixedInternalValueFvPatchFields_H - -#include "directMappedFixedInternalValueFvPatchField.H" -#include "fieldTypes.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -makePatchTypeFieldTypedefs(directMappedFixedInternalValue); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFieldsFwd.H b/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFieldsFwd.H deleted file mode 100644 index 3c1fba79ae83efb096893beb0544ac115891e4c0..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFieldsFwd.H +++ /dev/null @@ -1,50 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. - \\/ 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/>. - -\*---------------------------------------------------------------------------*/ - -#ifndef directMappedFixedInternalValueFvPatchFieldsFwd_H -#define directMappedFixedInternalValueFvPatchFieldsFwd_H - -#include "fieldTypes.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -template<class Type> class directMappedFixedInternalValueFvPatchField; - -makePatchTypeFieldTypedefs(directMappedFixedInternalValue); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchField.C b/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchField.C deleted file mode 100644 index c9230d8adfa69bcea9cc704f76a9d891d6c0e57d..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchField.C +++ /dev/null @@ -1,133 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. - \\/ 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 "directMappedFixedPushedInternalValueFvPatchField.H" -#include "UIndirectList.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -template<class Type> -directMappedFixedPushedInternalValueFvPatchField<Type>:: -directMappedFixedPushedInternalValueFvPatchField -( - const fvPatch& p, - const DimensionedField<Type, volMesh>& iF -) -: - directMappedFixedValueFvPatchField<Type>(p, iF) -{} - - -template<class Type> -directMappedFixedPushedInternalValueFvPatchField<Type>:: -directMappedFixedPushedInternalValueFvPatchField -( - const directMappedFixedPushedInternalValueFvPatchField<Type>& ptf, - const fvPatch& p, - const DimensionedField<Type, volMesh>& iF, - const fvPatchFieldMapper& mapper -) -: - directMappedFixedValueFvPatchField<Type>(ptf, p, iF, mapper) -{} - - -template<class Type> -directMappedFixedPushedInternalValueFvPatchField<Type>:: -directMappedFixedPushedInternalValueFvPatchField -( - const fvPatch& p, - const DimensionedField<Type, volMesh>& iF, - const dictionary& dict -) -: - directMappedFixedValueFvPatchField<Type>(p, iF, dict) -{} - - -template<class Type> -directMappedFixedPushedInternalValueFvPatchField<Type>:: -directMappedFixedPushedInternalValueFvPatchField -( - const directMappedFixedPushedInternalValueFvPatchField<Type>& ptf -) -: - directMappedFixedValueFvPatchField<Type>(ptf) -{} - - -template<class Type> -directMappedFixedPushedInternalValueFvPatchField<Type>:: -directMappedFixedPushedInternalValueFvPatchField -( - const directMappedFixedPushedInternalValueFvPatchField<Type>& ptf, - const DimensionedField<Type, volMesh>& iF -) -: - directMappedFixedValueFvPatchField<Type>(ptf, iF) -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -template<class Type> -void directMappedFixedPushedInternalValueFvPatchField<Type>::updateCoeffs() -{ - typedef GeometricField<Type, fvPatchField, volMesh> FieldType; - - if (this->updated()) - { - return; - } - - // Retrieve the neighbour values and assign to this patch boundary field - directMappedFixedValueFvPatchField<Type>::updateCoeffs(); - - // Assign the patch internal field to its boundary value - Field<Type>& intFld = const_cast<Field<Type>&>(this->internalField()); - UIndirectList<Type>(intFld, this->patch().faceCells()) = *this; -} - - -template<class Type> -void directMappedFixedPushedInternalValueFvPatchField<Type>::write -( - Ostream& os -) const -{ - directMappedFixedValueFvPatchField<Type>::write(os); -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchField.H b/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchField.H deleted file mode 100644 index 3074b80896f7d6ccb4997b841e3df46ae471dae4..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchField.H +++ /dev/null @@ -1,157 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. - \\/ 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::directMappedFixedPushedInternalValueFvPatchField - -Description - Recycles the boundary values of a neighbour patch field to the boundary - and internal values of *this. - -SourceFiles - directMappedFixedPushedInternalValueFvPatchField.C - -\*---------------------------------------------------------------------------*/ - -#ifndef directMappedFixedPushedInternalValueFvPatchField_H -#define directMappedFixedPushedInternalValueFvPatchField_H - -#include "directMappedFixedValueFvPatchField.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class directMappedFixedPushedInternalValueFvPatchField Declaration -\*---------------------------------------------------------------------------*/ - -template<class Type> -class directMappedFixedPushedInternalValueFvPatchField -: - public directMappedFixedValueFvPatchField<Type> -{ - -public: - - //- Runtime type information - TypeName("directMappedFixedPushedInternalValue"); - - - // Constructors - - //- Construct from patch and internal field - directMappedFixedPushedInternalValueFvPatchField - ( - const fvPatch&, - const DimensionedField<Type, volMesh>& - ); - - //- Construct from patch, internal field and dictionary - directMappedFixedPushedInternalValueFvPatchField - ( - const fvPatch&, - const DimensionedField<Type, volMesh>&, - const dictionary& - ); - - //- Construct by mapping given a - // directMappedFixedPushedInternalValueFvPatchField onto a new patch - directMappedFixedPushedInternalValueFvPatchField - ( - const directMappedFixedPushedInternalValueFvPatchField<Type>&, - const fvPatch&, - const DimensionedField<Type, volMesh>&, - const fvPatchFieldMapper& - ); - - //- Construct as copy - directMappedFixedPushedInternalValueFvPatchField - ( - const directMappedFixedPushedInternalValueFvPatchField<Type>& - ); - - //- Construct and return a clone - virtual tmp<fvPatchField<Type> > clone() const - { - return tmp<fvPatchField<Type> > - ( - new directMappedFixedPushedInternalValueFvPatchField<Type> - ( - *this - ) - ); - } - - //- Construct as copy setting internal field reference - directMappedFixedPushedInternalValueFvPatchField - ( - const directMappedFixedPushedInternalValueFvPatchField<Type>&, - const DimensionedField<Type, volMesh>& - ); - - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchField<Type> > clone - ( - const DimensionedField<Type, volMesh>& iF - ) const - { - return tmp<fvPatchField<Type> > - ( - new directMappedFixedPushedInternalValueFvPatchField<Type> - ( - *this, - iF - ) - ); - } - - - // Member functions - - // Evaluation functions - - //- Update the coefficients associated with the patch field - virtual void updateCoeffs(); - - //- Write - virtual void write(Ostream&) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#ifdef NoRepository -# include "directMappedFixedPushedInternalValueFvPatchField.C" -#endif - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFields.C b/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFields.C deleted file mode 100644 index b7ab2101066670c00eb5bfca6fcec71d87f31249..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFields.C +++ /dev/null @@ -1,43 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. - \\/ 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 "directMappedFixedPushedInternalValueFvPatchFields.H" -#include "volMesh.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -makePatchFields(directMappedFixedPushedInternalValue); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFields.H b/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFields.H deleted file mode 100644 index 97b7b7e25cfd0aafda87cca32a391bee42b055d2..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFields.H +++ /dev/null @@ -1,49 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. - \\/ 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/>. - -\*---------------------------------------------------------------------------*/ - -#ifndef directMappedFixedPushedInternalValueFvPatchFields_H -#define directMappedFixedPushedInternalValueFvPatchFields_H - -#include "directMappedFixedPushedInternalValueFvPatchField.H" -#include "fieldTypes.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -makePatchTypeFieldTypedefs(directMappedFixedPushedInternalValue); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFieldsFwd.H b/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFieldsFwd.H deleted file mode 100644 index f0c8d864b277faaf4e7934197d0116b669b0380d..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFieldsFwd.H +++ /dev/null @@ -1,50 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. - \\/ 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/>. - -\*---------------------------------------------------------------------------*/ - -#ifndef directMappedFixedPushedInternalValueFvPatchFieldsFwd_H -#define directMappedFixedPushedInternalValueFvPatchFieldsFwd_H - -#include "fieldTypes.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -template<class Type> class directMappedFixedPushedInternalValueFvPatchField; - -makePatchTypeFieldTypedefs(directMappedFixedInternalValue); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/derivedFvPatchFields/filmHeightInletVelocity/filmHeightInletVelocityFvPatchVectorField.C b/src/surfaceFilmModels/derivedFvPatchFields/filmHeightInletVelocity/filmHeightInletVelocityFvPatchVectorField.C deleted file mode 100644 index 7dea8cdb9148c854a4469cdeb9f6d9447bf06df9..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/derivedFvPatchFields/filmHeightInletVelocity/filmHeightInletVelocityFvPatchVectorField.C +++ /dev/null @@ -1,167 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. - \\/ 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 "filmHeightInletVelocityFvPatchVectorField.H" -#include "addToRunTimeSelectionTable.H" -#include "volFields.H" -#include "surfaceFields.H" - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::filmHeightInletVelocityFvPatchVectorField:: -filmHeightInletVelocityFvPatchVectorField -( - const fvPatch& p, - const DimensionedField<vector, volMesh>& iF -) -: - fixedValueFvPatchVectorField(p, iF), - phiName_("phi"), - rhoName_("rho"), - deltafName_("deltaf") -{} - - -Foam::filmHeightInletVelocityFvPatchVectorField:: -filmHeightInletVelocityFvPatchVectorField -( - const filmHeightInletVelocityFvPatchVectorField& ptf, - const fvPatch& p, - const DimensionedField<vector, volMesh>& iF, - const fvPatchFieldMapper& mapper -) -: - fixedValueFvPatchVectorField(ptf, p, iF, mapper), - phiName_(ptf.phiName_), - rhoName_(ptf.rhoName_), - deltafName_(ptf.deltafName_) -{} - - -Foam::filmHeightInletVelocityFvPatchVectorField:: -filmHeightInletVelocityFvPatchVectorField -( - const fvPatch& p, - const DimensionedField<vector, volMesh>& iF, - const dictionary& dict -) -: - fixedValueFvPatchVectorField(p, iF), - phiName_(dict.lookupOrDefault<word>("phi", "phi")), - rhoName_(dict.lookupOrDefault<word>("rho", "rho")), - deltafName_(dict.lookupOrDefault<word>("deltaf", "deltaf")) -{ - fvPatchVectorField::operator=(vectorField("value", dict, p.size())); -} - - -Foam::filmHeightInletVelocityFvPatchVectorField:: -filmHeightInletVelocityFvPatchVectorField -( - const filmHeightInletVelocityFvPatchVectorField& fhivpvf -) -: - fixedValueFvPatchVectorField(fhivpvf), - phiName_(fhivpvf.phiName_), - rhoName_(fhivpvf.rhoName_), - deltafName_(fhivpvf.deltafName_) -{} - - -Foam::filmHeightInletVelocityFvPatchVectorField:: -filmHeightInletVelocityFvPatchVectorField -( - const filmHeightInletVelocityFvPatchVectorField& fhivpvf, - const DimensionedField<vector, volMesh>& iF -) -: - fixedValueFvPatchVectorField(fhivpvf, iF), - phiName_(fhivpvf.phiName_), - rhoName_(fhivpvf.rhoName_), - deltafName_(fhivpvf.deltafName_) -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void Foam::filmHeightInletVelocityFvPatchVectorField::updateCoeffs() -{ - if (updated()) - { - return; - } - - const fvsPatchField<scalar>& phip = - patch().lookupPatchField<surfaceScalarField, scalar>(phiName_); - - const fvPatchField<scalar>& rhop = - patch().lookupPatchField<volScalarField, scalar>(rhoName_); - - const fvPatchField<scalar>& deltafp = - patch().lookupPatchField<volScalarField, scalar>(deltafName_); - - const vectorField n(patch().nf()); - const scalarField& magSf = patch().magSf(); - - operator==(deltafp*n*phip/(rhop*magSf*sqr(deltafp) + ROOTVSMALL)); - - fixedValueFvPatchVectorField::updateCoeffs(); -} - - -void Foam::filmHeightInletVelocityFvPatchVectorField::write(Ostream& os) const -{ - fvPatchVectorField::write(os); - writeEntryIfDifferent<word>(os, "phi", "phi", phiName_); - writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_); - writeEntryIfDifferent<word>(os, "deltaf", "deltaf", deltafName_); - writeEntry("value", os); -} - - -// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // - -void Foam::filmHeightInletVelocityFvPatchVectorField::operator= -( - const fvPatchField<vector>& pvf -) -{ - fvPatchField<vector>::operator=(patch().nf()*(patch().nf() & pvf)); -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - makePatchTypeField - ( - fvPatchVectorField, - filmHeightInletVelocityFvPatchVectorField - ); -} - - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/derivedFvPatchFields/filmHeightInletVelocity/filmHeightInletVelocityFvPatchVectorField.H b/src/surfaceFilmModels/derivedFvPatchFields/filmHeightInletVelocity/filmHeightInletVelocityFvPatchVectorField.H deleted file mode 100644 index 3c6132cd6cc01fa315f2169d847a6be7c5426016..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/derivedFvPatchFields/filmHeightInletVelocity/filmHeightInletVelocityFvPatchVectorField.H +++ /dev/null @@ -1,198 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. - \\/ 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::filmHeightInletVelocityFvPatchVectorField - -Description - Velocity inlet boundary condition for patches where the film height is - specified. The inflow velocity is obtained from the flux with a direction - normal to the patch faces. - -SourceFiles - filmHeightInletVelocityFvPatchVectorField.C - -\*---------------------------------------------------------------------------*/ - -#ifndef filmHeightInletVelocityFvPatchVectorField_H -#define filmHeightInletVelocityFvPatchVectorField_H - -#include "fvPatchFields.H" -#include "fixedValueFvPatchFields.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class filmHeightInletVelocityFvPatchVectorField Declaration -\*---------------------------------------------------------------------------*/ - -class filmHeightInletVelocityFvPatchVectorField -: - public fixedValueFvPatchVectorField -{ - // Private data - - //- Name of flux field - word phiName_; - - //- Name of density field - word rhoName_; - - //- Name of film height field - word deltafName_; - - -public: - - //- Runtime type information - TypeName("filmHeightInletVelocity"); - - - // Constructors - - //- Construct from patch and internal field - filmHeightInletVelocityFvPatchVectorField - ( - const fvPatch&, - const DimensionedField<vector, volMesh>& - ); - - //- Construct from patch, internal field and dictionary - filmHeightInletVelocityFvPatchVectorField - ( - const fvPatch&, - const DimensionedField<vector, volMesh>&, - const dictionary& - ); - - //- Construct by mapping given filmHeightInletVelocityFvPatchVectorField - // onto a new patch - filmHeightInletVelocityFvPatchVectorField - ( - const filmHeightInletVelocityFvPatchVectorField&, - const fvPatch&, - const DimensionedField<vector, volMesh>&, - const fvPatchFieldMapper& - ); - - //- Construct as copy - filmHeightInletVelocityFvPatchVectorField - ( - const filmHeightInletVelocityFvPatchVectorField& - ); - - //- Construct and return a clone - virtual tmp<fvPatchVectorField> clone() const - { - return tmp<fvPatchVectorField> - ( - new filmHeightInletVelocityFvPatchVectorField(*this) - ); - } - - //- Construct as copy setting internal field reference - filmHeightInletVelocityFvPatchVectorField - ( - const filmHeightInletVelocityFvPatchVectorField&, - const DimensionedField<vector, volMesh>& - ); - - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchVectorField> clone - ( - const DimensionedField<vector, volMesh>& iF - ) const - { - return tmp<fvPatchVectorField> - ( - new filmHeightInletVelocityFvPatchVectorField(*this, iF) - ); - } - - - // Member functions - - // Access - - //- Return the name of phi - const word& phiName() const - { - return phiName_; - } - - //- Return reference to the name of phi to allow adjustment - word& phiName() - { - return phiName_; - } - - //- Return the name of rho - const word& rhoName() const - { - return rhoName_; - } - - //- Return reference to the name of rho to allow adjustment - word& rhoName() - { - return rhoName_; - } - - //- Return the name of deltaf - const word& deltafName() const - { - return deltafName_; - } - - //- Return reference to the name of df to allow adjustment - word& deltafName() - { - return deltafName_; - } - - - //- Update the coefficients associated with the patch field - virtual void updateCoeffs(); - - //- Write - virtual void write(Ostream&) const; - - - // Member operators - - virtual void operator=(const fvPatchField<vector>& pvf); -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/derivedFvPatchFields/htcConv/htcConvFvPatchScalarField.C b/src/surfaceFilmModels/derivedFvPatchFields/htcConv/htcConvFvPatchScalarField.C deleted file mode 100644 index 261ecaea8f7272533710836e826d756225820647..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/derivedFvPatchFields/htcConv/htcConvFvPatchScalarField.C +++ /dev/null @@ -1,165 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. - \\/ 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 "htcConvFvPatchScalarField.H" -#include "RASModel.H" -#include "fvPatchFieldMapper.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace compressible -{ -namespace RASModels -{ - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -htcConvFvPatchScalarField::htcConvFvPatchScalarField -( - const fvPatch& p, - const DimensionedField<scalar, volMesh>& iF -) -: - fixedValueFvPatchScalarField(p, iF), - L_(1.0) -{} - - -htcConvFvPatchScalarField::htcConvFvPatchScalarField -( - const htcConvFvPatchScalarField& ptf, - const fvPatch& p, - const DimensionedField<scalar, volMesh>& iF, - const fvPatchFieldMapper& mapper -) -: - fixedValueFvPatchScalarField(ptf, p, iF, mapper), - L_(ptf.L_) -{} - - -htcConvFvPatchScalarField::htcConvFvPatchScalarField -( - const fvPatch& p, - const DimensionedField<scalar, volMesh>& iF, - const dictionary& dict -) -: - fixedValueFvPatchScalarField(p, iF, dict), - L_(readScalar(dict.lookup("L"))) -{} - - -htcConvFvPatchScalarField::htcConvFvPatchScalarField -( - const htcConvFvPatchScalarField& htcpsf -) -: - fixedValueFvPatchScalarField(htcpsf), - L_(htcpsf.L_) -{} - - -htcConvFvPatchScalarField::htcConvFvPatchScalarField -( - const htcConvFvPatchScalarField& htcpsf, - const DimensionedField<scalar, volMesh>& iF -) -: - fixedValueFvPatchScalarField(htcpsf, iF), - L_(htcpsf.L_) -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void htcConvFvPatchScalarField::updateCoeffs() -{ - if (updated()) - { - return; - } - - const label patchI = patch().index(); - - const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties"); - const scalarField alphaEffw(rasModel.alphaEff()().boundaryField()[patchI]); - const scalarField& muw = rasModel.mu().boundaryField()[patchI]; - const scalarField& rhow = rasModel.rho().boundaryField()[patchI]; - const vectorField& Uc = rasModel.U(); - const vectorField& Uw = rasModel.U().boundaryField()[patchI]; - const scalarField& Tw = rasModel.thermo().T().boundaryField()[patchI]; - const scalarField Cpw(rasModel.thermo().Cp(Tw, patchI)); - - const scalarField kappaw(Cpw*alphaEffw); - const scalarField Pr(muw*Cpw/kappaw); - - scalarField& htc = *this; - forAll(htc, faceI) - { - label faceCellI = patch().faceCells()[faceI]; - - scalar Re = rhow[faceI]*mag(Uc[faceCellI] - Uw[faceI])*L_/muw[faceI]; - - if (Re < 5.0E+05) - { - htc[faceI] = 0.664*sqrt(Re)*cbrt(Pr[faceI])*kappaw[faceI]/L_; - } - else - { - htc[faceI] = 0.037*pow(Re, 0.8)*cbrt(Pr[faceI])*kappaw[faceI]/L_; - } - } -} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void htcConvFvPatchScalarField::write(Ostream& os) const -{ - fvPatchField<scalar>::write(os); - os.writeKeyword("L") << L_ << token::END_STATEMENT << nl; - writeEntry("value", os); -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -makePatchTypeField -( - fvPatchScalarField, - htcConvFvPatchScalarField -); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace RASModels -} // End namespace compressible -} // End namespace Foam - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/derivedFvPatchFields/htcConv/htcConvFvPatchScalarField.H b/src/surfaceFilmModels/derivedFvPatchFields/htcConv/htcConvFvPatchScalarField.H deleted file mode 100644 index 4b5585e578e55a72ef699720834b902adade23c4..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/derivedFvPatchFields/htcConv/htcConvFvPatchScalarField.H +++ /dev/null @@ -1,159 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. - \\/ 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::compressible::RASModels::htcConvFvPatchScalarField - -Description - Convective heat transfer boundary condition - -SourceFiles - htcConvFvPatchScalarField.C - -\*---------------------------------------------------------------------------*/ - -#ifndef compressibleMutRoughWallFunctionFvPatchScalarField_H -#define compressibleMutRoughWallFunctionFvPatchScalarField_H - -#include "fixedValueFvPatchFields.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace compressible -{ -namespace RASModels -{ - -/*---------------------------------------------------------------------------*\ - Class htcConvFvPatchScalarField Declaration -\*---------------------------------------------------------------------------*/ - -class htcConvFvPatchScalarField -: - public fixedValueFvPatchScalarField -{ -protected: - - // Protected data - - //- L Length scale [m] - const scalar L_; - - -public: - - //- Runtime type information - TypeName("htcConvection"); - - - // Constructors - - //- Construct from patch and internal field - htcConvFvPatchScalarField - ( - const fvPatch&, - const DimensionedField<scalar, volMesh>& - ); - - //- Construct from patch, internal field and dictionary - htcConvFvPatchScalarField - ( - const fvPatch&, - const DimensionedField<scalar, volMesh>&, - const dictionary& - ); - - //- Construct by mapping given - // htcConvFvPatchScalarField - // onto a new patch - htcConvFvPatchScalarField - ( - const htcConvFvPatchScalarField&, - const fvPatch&, - const DimensionedField<scalar, volMesh>&, - const fvPatchFieldMapper& - ); - - //- Construct as copy - htcConvFvPatchScalarField - ( - const htcConvFvPatchScalarField& - ); - - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new htcConvFvPatchScalarField(*this) - ); - } - - //- Construct as copy setting internal field reference - htcConvFvPatchScalarField - ( - const htcConvFvPatchScalarField&, - const DimensionedField<scalar, volMesh>& - ); - - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone - ( - const DimensionedField<scalar, volMesh>& iF - ) const - { - return tmp<fvPatchScalarField> - ( - new htcConvFvPatchScalarField(*this, iF) - ); - } - - - // Member functions - - // Evaluation functions - - //- Update the coefficients associated with the patch field - virtual void updateCoeffs(); - - - // I-O - - //- Write - virtual void write(Ostream&) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace RASModels -} // End namespace compressible -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/derivedFvPatchFields/wallFunctions/alphatFilmWallFunction/alphatFilmWallFunctionFvPatchScalarField.C b/src/surfaceFilmModels/derivedFvPatchFields/wallFunctions/alphatFilmWallFunction/alphatFilmWallFunctionFvPatchScalarField.C deleted file mode 100644 index 6245c6398b361316d773293de79f7050cf6d48a1..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/derivedFvPatchFields/wallFunctions/alphatFilmWallFunction/alphatFilmWallFunctionFvPatchScalarField.C +++ /dev/null @@ -1,249 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. - \\/ 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 "alphatFilmWallFunctionFvPatchScalarField.H" -#include "RASModel.H" -#include "surfaceFilmModel.H" -#include "fvPatchFieldMapper.H" -#include "volFields.H" -#include "addToRunTimeSelectionTable.H" -#include "directMappedWallPolyPatch.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace compressible -{ -namespace RASModels -{ - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -alphatFilmWallFunctionFvPatchScalarField:: -alphatFilmWallFunctionFvPatchScalarField -( - const fvPatch& p, - const DimensionedField<scalar, volMesh>& iF -) -: - fixedValueFvPatchScalarField(p, iF), - B_(5.5), - yPlusCrit_(11.05), - Cmu_(0.09), - kappa_(0.41), - Prt_(0.85) -{} - - -alphatFilmWallFunctionFvPatchScalarField:: -alphatFilmWallFunctionFvPatchScalarField -( - const alphatFilmWallFunctionFvPatchScalarField& ptf, - const fvPatch& p, - const DimensionedField<scalar, volMesh>& iF, - const fvPatchFieldMapper& mapper -) -: - fixedValueFvPatchScalarField(ptf, p, iF, mapper), - B_(ptf.B_), - yPlusCrit_(ptf.yPlusCrit_), - Cmu_(ptf.Cmu_), - kappa_(ptf.kappa_), - Prt_(ptf.Prt_) -{} - - -alphatFilmWallFunctionFvPatchScalarField:: -alphatFilmWallFunctionFvPatchScalarField -( - const fvPatch& p, - const DimensionedField<scalar, volMesh>& iF, - const dictionary& dict -) -: - fixedValueFvPatchScalarField(p, iF, dict), - B_(dict.lookupOrDefault("B", 5.5)), - yPlusCrit_(dict.lookupOrDefault("yPlusCrit", 11.05)), - Cmu_(dict.lookupOrDefault("Cmu", 0.09)), - kappa_(dict.lookupOrDefault("kappa", 0.41)), - Prt_(dict.lookupOrDefault("Prt", 0.85)) -{} - - -alphatFilmWallFunctionFvPatchScalarField:: -alphatFilmWallFunctionFvPatchScalarField -( - const alphatFilmWallFunctionFvPatchScalarField& fwfpsf -) -: - fixedValueFvPatchScalarField(fwfpsf), - B_(fwfpsf.B_), - yPlusCrit_(fwfpsf.yPlusCrit_), - Cmu_(fwfpsf.Cmu_), - kappa_(fwfpsf.kappa_), - Prt_(fwfpsf.Prt_) -{} - - -alphatFilmWallFunctionFvPatchScalarField:: -alphatFilmWallFunctionFvPatchScalarField -( - const alphatFilmWallFunctionFvPatchScalarField& fwfpsf, - const DimensionedField<scalar, volMesh>& iF -) -: - fixedValueFvPatchScalarField(fwfpsf, iF), - B_(fwfpsf.B_), - yPlusCrit_(fwfpsf.yPlusCrit_), - Cmu_(fwfpsf.Cmu_), - kappa_(fwfpsf.kappa_), - Prt_(fwfpsf.Prt_) -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void alphatFilmWallFunctionFvPatchScalarField::updateCoeffs() -{ - if (updated()) - { - return; - } - - bool ok = - db().objectRegistry::foundObject - <surfaceFilmModels::surfaceFilmModel>("surfaceFilmProperties"); - - if (!ok) - { - // do nothing on construction - film model doesn't exist yet - return; - } - - const label patchI = patch().index(); - - // Retrieve phase change mass from surface film model - const surfaceFilmModels::surfaceFilmModel& filmModel = - db().objectRegistry::lookupObject - <surfaceFilmModels::surfaceFilmModel>("surfaceFilmProperties"); - - const directMappedWallPolyPatch& wpp = - refCast<const directMappedWallPolyPatch>(patch().patch()); - const mapDistribute& distMap = wpp.map(); - label filmPatchI = -1; - forAll(filmModel.primaryPatchIDs(), i) - { - if (filmModel.primaryPatchIDs()[i] == patchI) - { - filmPatchI = filmModel.filmBottomPatchIDs()[i]; - break; - } - } - - scalarField mDotFilm - ( - filmModel.massPhaseChangeForPrimary().boundaryField()[filmPatchI] - ); - distMap.distribute(mDotFilm); - - // Retrieve RAS turbulence model - const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties"); - - const scalarField& y = rasModel.y()[patchI]; - const scalarField& rhow = rasModel.rho().boundaryField()[patchI]; - const tmp<volScalarField> tk = rasModel.k(); - const volScalarField& k = tk(); - const scalarField& muw = rasModel.mu().boundaryField()[patchI]; - const scalarField& alphaw = rasModel.alpha().boundaryField()[patchI]; - - const scalar Cmu25 = pow(Cmu_, 0.25); - - // Populate alphat field values - scalarField& alphat = *this; - forAll(alphat, faceI) - { - label faceCellI = patch().faceCells()[faceI]; - - scalar uTau = Cmu25*sqrt(k[faceCellI]); - - scalar yPlus = y[faceI]*uTau/(muw[faceI]/rhow[faceI]); - - scalar Pr = muw[faceI]/alphaw[faceI]; - - scalar factor = 0.0; - scalar mStar = mDotFilm[faceI]/(y[faceI]*uTau); - if (yPlus > yPlusCrit_) - { - scalar expTerm = exp(min(50.0, yPlusCrit_*mStar*Pr)); - scalar yPlusRatio = yPlus/yPlusCrit_; - scalar powTerm = mStar*Prt_/kappa_; - factor = - mStar/(expTerm*(pow(yPlusRatio, powTerm)) - 1.0 + ROOTVSMALL); - } - else - { - scalar expTerm = exp(min(50.0, yPlus*mStar*Pr)); - factor = mStar/(expTerm - 1.0 + ROOTVSMALL); - } - - scalar dx = patch().deltaCoeffs()[faceI]; - - scalar alphaEff = dx*rhow[faceI]*uTau*factor; - - alphat[faceI] = max(alphaEff - alphaw[faceI], 0.0); - } -} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void alphatFilmWallFunctionFvPatchScalarField::write(Ostream& os) const -{ - fvPatchField<scalar>::write(os); - os.writeKeyword("B") << B_ << token::END_STATEMENT << nl; - os.writeKeyword("yPlusCrit") << yPlusCrit_ << token::END_STATEMENT << nl; - os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl; - os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl; - os.writeKeyword("Prt") << Prt_ << token::END_STATEMENT << nl; - writeEntry("value", os); -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -makePatchTypeField -( - fvPatchScalarField, - alphatFilmWallFunctionFvPatchScalarField -); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace RASModels -} // End namespace compressible -} // End namespace Foam - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/derivedFvPatchFields/wallFunctions/alphatFilmWallFunction/alphatFilmWallFunctionFvPatchScalarField.H b/src/surfaceFilmModels/derivedFvPatchFields/wallFunctions/alphatFilmWallFunction/alphatFilmWallFunctionFvPatchScalarField.H deleted file mode 100644 index c899e853da05c3eccf9f089bd6ee13a800e8e77a..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/derivedFvPatchFields/wallFunctions/alphatFilmWallFunction/alphatFilmWallFunctionFvPatchScalarField.H +++ /dev/null @@ -1,172 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. - \\/ 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::compressible::RASModels::alphatFilmWallFunctionFvPatchScalarField - -Description - Turbulent thermal diffusivity boundary conditions for use with surface - film models. - -SourceFiles - alphatFilmWallFunctionFvPatchScalarField.C - -\*---------------------------------------------------------------------------*/ - -#ifndef compressibleMutRoughWallFunctionFvPatchScalarField_H -#define compressibleMutRoughWallFunctionFvPatchScalarField_H - -#include "fixedValueFvPatchFields.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace compressible -{ -namespace RASModels -{ - -/*---------------------------------------------------------------------------*\ - Class alphatFilmWallFunctionFvPatchScalarField Declaration -\*---------------------------------------------------------------------------*/ - -class alphatFilmWallFunctionFvPatchScalarField -: - public fixedValueFvPatchScalarField -{ -protected: - - // Protected data - - //- B Coefficient (default = 5.5) - scalar B_; - - //- y+ value for laminar -> turbulent transition (default = 11.05) - scalar yPlusCrit_; - - //- Turbulent Cmu coefficient (default = 0.09) - scalar Cmu_; - - //- Von-Karman constant (default = 0.41) - scalar kappa_; - - //- Turbulent Prandtl number (default = 0.85) - scalar Prt_; - - -public: - - //- Runtime type information - TypeName("alphatFilmWallFunction"); - - - // Constructors - - //- Construct from patch and internal field - alphatFilmWallFunctionFvPatchScalarField - ( - const fvPatch&, - const DimensionedField<scalar, volMesh>& - ); - - //- Construct from patch, internal field and dictionary - alphatFilmWallFunctionFvPatchScalarField - ( - const fvPatch&, - const DimensionedField<scalar, volMesh>&, - const dictionary& - ); - - //- Construct by mapping given - // alphatFilmWallFunctionFvPatchScalarField - // onto a new patch - alphatFilmWallFunctionFvPatchScalarField - ( - const alphatFilmWallFunctionFvPatchScalarField&, - const fvPatch&, - const DimensionedField<scalar, volMesh>&, - const fvPatchFieldMapper& - ); - - //- Construct as copy - alphatFilmWallFunctionFvPatchScalarField - ( - const alphatFilmWallFunctionFvPatchScalarField& - ); - - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new alphatFilmWallFunctionFvPatchScalarField(*this) - ); - } - - //- Construct as copy setting internal field reference - alphatFilmWallFunctionFvPatchScalarField - ( - const alphatFilmWallFunctionFvPatchScalarField&, - const DimensionedField<scalar, volMesh>& - ); - - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone - ( - const DimensionedField<scalar, volMesh>& iF - ) const - { - return tmp<fvPatchScalarField> - ( - new alphatFilmWallFunctionFvPatchScalarField(*this, iF) - ); - } - - - // Member functions - - // Evaluation functions - - //- Update the coefficients associated with the patch field - virtual void updateCoeffs(); - - - // I-O - - //- Write - virtual void write(Ostream&) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace RASModels -} // End namespace compressible -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/derivedFvPatchFields/wallFunctions/mutFilmWallFunction/mutFilmWallFunctionFvPatchScalarField.C b/src/surfaceFilmModels/derivedFvPatchFields/wallFunctions/mutFilmWallFunction/mutFilmWallFunctionFvPatchScalarField.C deleted file mode 100644 index 2f0c39439061017b01bf4fbd60d3096bef20fc71..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/derivedFvPatchFields/wallFunctions/mutFilmWallFunction/mutFilmWallFunctionFvPatchScalarField.C +++ /dev/null @@ -1,252 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. - \\/ 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 (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 "mutFilmWallFunctionFvPatchScalarField.H" -#include "fvPatchFieldMapper.H" -#include "volFields.H" -#include "RASModel.H" -#include "addToRunTimeSelectionTable.H" -#include "surfaceFilmModel.H" -#include "directMappedWallPolyPatch.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace compressible -{ -namespace RASModels -{ - -// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // - -tmp<scalarField> mutFilmWallFunctionFvPatchScalarField::calcUTau -( - const scalarField& magGradU -) const -{ - tmp<scalarField> tuTau(new scalarField(patch().size(), 0.0)); - scalarField& uTau = tuTau(); - - bool ok = - db().objectRegistry::foundObject - <surfaceFilmModels::surfaceFilmModel>("surfaceFilmProperties"); - - if (!ok) - { - // do nothing on construction - film model doesn't exist yet - return tuTau; - } - - const label patchI = patch().index(); - - // Retrieve phase change mass from surface film model - const surfaceFilmModels::surfaceFilmModel& filmModel = - db().objectRegistry::lookupObject - <surfaceFilmModels::surfaceFilmModel>("surfaceFilmProperties"); - - const directMappedWallPolyPatch& wpp = - refCast<const directMappedWallPolyPatch>(patch().patch()); - const mapDistribute& distMap = wpp.map(); - label filmPatchI = -1; - forAll(filmModel.primaryPatchIDs(), i) - { - if (filmModel.primaryPatchIDs()[i] == patchI) - { - filmPatchI = filmModel.filmBottomPatchIDs()[i]; - break; - } - } - - scalarField mDotFilm - ( - filmModel.massPhaseChangeForPrimary().boundaryField()[filmPatchI] - ); - distMap.distribute(mDotFilm); - - - // Retrieve RAS turbulence model - const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties"); - const scalarField& y = rasModel.y()[patchI]; - const fvPatchScalarField& rhow = rasModel.rho().boundaryField()[patchI]; - const fvPatchScalarField& muw = rasModel.mu().boundaryField()[patchI]; - const tmp<volScalarField> tk = rasModel.k(); - const volScalarField& k = tk(); - - const scalar Cmu25 = pow(Cmu_, 0.25); - - forAll(uTau, faceI) - { - label faceCellI = patch().faceCells()[faceI]; - - scalar ut = Cmu25*sqrt(k[faceCellI]); - - scalar yPlus = y[faceI]*ut/(muw[faceI]/rhow[faceI]); - - scalar mStar = mDotFilm[faceI]/(y[faceI]*ut); - - scalar factor = 0.0; - if (yPlus > yPlusCrit_) - { - scalar expTerm = exp(min(50.0, B_*mStar)); - scalar powTerm = pow(yPlus, mStar/kappa_); - factor = mStar/(expTerm*powTerm - 1.0 + ROOTVSMALL); - } - else - { - scalar expTerm = exp(min(50.0, mStar)); - factor = mStar/(expTerm*yPlus - 1.0 + ROOTVSMALL); - } - - uTau[faceI] = sqrt(max(0, magGradU[faceI]*ut*factor)); - } - - return tuTau; -} - - -tmp<scalarField> mutFilmWallFunctionFvPatchScalarField::calcMut() const -{ - const label patchI = patch().index(); - - const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties"); - const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; - const scalarField magGradU(mag(Uw.snGrad())); - const scalarField& rhow = rasModel.rho().boundaryField()[patchI]; - const scalarField& muw = rasModel.mu().boundaryField()[patchI]; - - return max - ( - scalar(0), - rhow*sqr(calcUTau(magGradU))/(magGradU + ROOTVSMALL) - muw - ); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -mutFilmWallFunctionFvPatchScalarField::mutFilmWallFunctionFvPatchScalarField -( - const fvPatch& p, - const DimensionedField<scalar, volMesh>& iF -) -: - mutkWallFunctionFvPatchScalarField(p, iF), - B_(5.5), - yPlusCrit_(11.05) -{} - - -mutFilmWallFunctionFvPatchScalarField::mutFilmWallFunctionFvPatchScalarField -( - const mutFilmWallFunctionFvPatchScalarField& ptf, - const fvPatch& p, - const DimensionedField<scalar, volMesh>& iF, - const fvPatchFieldMapper& mapper -) -: - mutkWallFunctionFvPatchScalarField(ptf, p, iF, mapper), - B_(5.5), - yPlusCrit_(11.05) -{} - - -mutFilmWallFunctionFvPatchScalarField::mutFilmWallFunctionFvPatchScalarField -( - const fvPatch& p, - const DimensionedField<scalar, volMesh>& iF, - const dictionary& dict -) -: - mutkWallFunctionFvPatchScalarField(p, iF, dict), - B_(dict.lookupOrDefault("B", 5.5)), - yPlusCrit_(dict.lookupOrDefault("yPlusCrit", 11.05)) -{} - - -mutFilmWallFunctionFvPatchScalarField::mutFilmWallFunctionFvPatchScalarField -( - const mutFilmWallFunctionFvPatchScalarField& wfpsf -) -: - mutkWallFunctionFvPatchScalarField(wfpsf), - B_(wfpsf.B_), - yPlusCrit_(wfpsf.yPlusCrit_) -{} - - -mutFilmWallFunctionFvPatchScalarField::mutFilmWallFunctionFvPatchScalarField -( - const mutFilmWallFunctionFvPatchScalarField& wfpsf, - const DimensionedField<scalar, volMesh>& iF -) -: - mutkWallFunctionFvPatchScalarField(wfpsf, iF), - B_(wfpsf.B_), - yPlusCrit_(wfpsf.yPlusCrit_) -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -tmp<scalarField> mutFilmWallFunctionFvPatchScalarField::yPlus() const -{ - const label patchI = patch().index(); - - const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties"); - const scalarField& y = rasModel.y()[patchI]; - const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; - const scalarField& rhow = rasModel.rho().boundaryField()[patchI]; - const scalarField& muw = rasModel.mu().boundaryField()[patchI]; - - return y*calcUTau(mag(Uw.snGrad()))/(muw/rhow); -} - - -void mutFilmWallFunctionFvPatchScalarField::write(Ostream& os) const -{ - fvPatchField<scalar>::write(os); - writeLocalEntries(os); - os.writeKeyword("B") << B_ << token::END_STATEMENT << nl; - os.writeKeyword("yPlusCrit") << yPlusCrit_ << token::END_STATEMENT << nl; - writeEntry("value", os); -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -makePatchTypeField -( - fvPatchScalarField, - mutFilmWallFunctionFvPatchScalarField -); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace RASModels -} // End namespace compressible -} // End namespace Foam - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/derivedFvPatchFields/wallFunctions/mutFilmWallFunction/mutFilmWallFunctionFvPatchScalarField.H b/src/surfaceFilmModels/derivedFvPatchFields/wallFunctions/mutFilmWallFunction/mutFilmWallFunctionFvPatchScalarField.H deleted file mode 100644 index e6a40f5f78c23c4c3b1c4a340c70b1ecab99d747..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/derivedFvPatchFields/wallFunctions/mutFilmWallFunction/mutFilmWallFunctionFvPatchScalarField.H +++ /dev/null @@ -1,172 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. - \\/ 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 (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::compressible::RASModels:: - mutFilmWallFunctionFvPatchScalarField - -Description - Wall function boundary condition for use with surface film models. - -SourceFiles - mutFilmWallFunctionFvPatchScalarField.C - -\*---------------------------------------------------------------------------*/ - -#ifndef compressibleMutSpalartAllmarasWallFunctionFvPatchScalarField_H -#define compressibleMutSpalartAllmarasWallFunctionFvPatchScalarField_H - -#include "mutkWallFunctionFvPatchScalarField.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace compressible -{ -namespace RASModels -{ - -/*---------------------------------------------------------------------------*\ - Class mutFilmWallFunctionFvPatchScalarField Declaration -\*---------------------------------------------------------------------------*/ - -class mutFilmWallFunctionFvPatchScalarField -: - public mutkWallFunctionFvPatchScalarField -{ -protected: - - // Protected data - - //- B Coefficient (default = 5.5) - scalar B_; - - //- y+ value for laminar -> turbulent transition (default = 11.05) - scalar yPlusCrit_; - - - // Protected member functions - - //- Calculate the turbulence viscosity - virtual tmp<scalarField> calcMut() const; - - //- Calculate the friction velocity - virtual tmp<scalarField> calcUTau(const scalarField& magGradU) const; - - -public: - - //- Runtime type information - TypeName("mutFilmWallFunction"); - - - // Constructors - - //- Construct from patch and internal field - mutFilmWallFunctionFvPatchScalarField - ( - const fvPatch&, - const DimensionedField<scalar, volMesh>& - ); - - //- Construct from patch, internal field and dictionary - mutFilmWallFunctionFvPatchScalarField - ( - const fvPatch&, - const DimensionedField<scalar, volMesh>&, - const dictionary& - ); - - //- Construct by mapping given - // mutFilmWallFunctionFvPatchScalarField - // onto a new patch - mutFilmWallFunctionFvPatchScalarField - ( - const mutFilmWallFunctionFvPatchScalarField&, - const fvPatch&, - const DimensionedField<scalar, volMesh>&, - const fvPatchFieldMapper& - ); - - //- Construct as copy - mutFilmWallFunctionFvPatchScalarField - ( - const mutFilmWallFunctionFvPatchScalarField& - ); - - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new mutFilmWallFunctionFvPatchScalarField(*this) - ); - } - - //- Construct as copy setting internal field reference - mutFilmWallFunctionFvPatchScalarField - ( - const mutFilmWallFunctionFvPatchScalarField&, - const DimensionedField<scalar, volMesh>& - ); - - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone - ( - const DimensionedField<scalar, volMesh>& iF - ) const - { - return tmp<fvPatchScalarField> - ( - new mutFilmWallFunctionFvPatchScalarField(*this, iF) - ); - } - - - // Member functions - - // Evaluation functions - - //- Calculate and return the yPlus at the boundary - virtual tmp<scalarField> yPlus() const; - - - // I-O - - //- Write - virtual void write(Ostream& os) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace RASModels -} // End namespace compressible -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/submodels/kinematic/injectionModel/cloudInjection/cloudInjection.C b/src/surfaceFilmModels/submodels/kinematic/injectionModel/cloudInjection/cloudInjection.C deleted file mode 100644 index 9102720a4023734b3ebf8286a945125189513c3a..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/submodels/kinematic/injectionModel/cloudInjection/cloudInjection.C +++ /dev/null @@ -1,110 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. - \\/ 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 "cloudInjection.H" -#include "addToRunTimeSelectionTable.H" -#include "fvMesh.H" -#include "Time.H" -#include "mathematicalConstants.H" -#include "volFields.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - namespace surfaceFilmModels - { - defineTypeNameAndDebug(cloudInjection, 0); - addToRunTimeSelectionTable(injectionModel, cloudInjection, dictionary); - } -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::surfaceFilmModels::cloudInjection::cloudInjection -( - const surfaceFilmModel& owner, - const dictionary& dict -) -: - injectionModel(type(), owner, dict), - particlesPerParcel_(readScalar(coeffs_.lookup("particlesPerParcel"))), - rndGen_(label(0), -1), - parcelPDF_(pdfs::pdf::New(coeffs_.subDict("parcelPDF"), rndGen_)), - diameter_(owner.film().nCells(), 0.0) -{ - forAll(diameter_, faceI) - { - diameter_[faceI] = parcelPDF_->sample(); - } -} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::surfaceFilmModels::cloudInjection::~cloudInjection() -{} - - -// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // - -void Foam::surfaceFilmModels::cloudInjection::inject -( - scalarField& massToInject, - scalarField& diameterToInject -) -{ - correctDetachedFilm(massToInject); - - const scalar pi = constant::mathematical::pi; - const scalarField& rhoFilm = owner().rho(); - - // Collect the data to be transferred - forAll(massToInject, cellI) - { - scalar rho = rhoFilm[cellI]; - scalar diam = diameter_[cellI]; - scalar minMass = particlesPerParcel_*rho*pi/6*pow3(diam); - - if (massToInject[cellI] > minMass) - { - // All mass can be injected - set particle diameter - diameterToInject[cellI] = diameter_[cellI]; - - // Retrieve new particle diameter sample - diameter_[cellI] = parcelPDF_->sample(); - } - else - { - // Mass below minimum threshold - cannot be injected - massToInject[cellI] = 0.0; - diameterToInject[cellI] = -1.0; - } - } -} - - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/submodels/kinematic/injectionModel/cloudInjection/cloudInjection.H b/src/surfaceFilmModels/submodels/kinematic/injectionModel/cloudInjection/cloudInjection.H deleted file mode 100644 index 4f9aa08fc6770f6ad513b04f300ce5e58dda7596..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/submodels/kinematic/injectionModel/cloudInjection/cloudInjection.H +++ /dev/null @@ -1,123 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. - \\/ 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::cloudInjection - -Description - Cloud injection model - -SourceFiles - cloudInjection.C - -\*---------------------------------------------------------------------------*/ - -#ifndef cloudInjection_H -#define cloudInjection_H - -#include "injectionModel.H" -#include "pdf.H" -#include "cachedRandom.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace surfaceFilmModels -{ - -/*---------------------------------------------------------------------------*\ - Class cloudInjection Declaration -\*---------------------------------------------------------------------------*/ - -class cloudInjection -: - public injectionModel -{ -private: - - // Private member functions - - //- Disallow default bitwise copy construct - cloudInjection(const cloudInjection&); - - //- Disallow default bitwise assignment - void operator=(const cloudInjection&); - - -protected: - - // Protected data - - //- Number of particles per parcel - scalar particlesPerParcel_; - - //- Random number generator - cachedRandom rndGen_; - - //- Parcel size PDF model - const autoPtr<pdfs::pdf> parcelPDF_; - - //- Diameters of particles to inject into the cloud - scalarList diameter_; - - -public: - - //- Runtime type information - TypeName("cloudInjection"); - - - // Constructors - - //- Construct from surface film model - cloudInjection(const surfaceFilmModel& owner, const dictionary& dict); - - - //- Destructor - virtual ~cloudInjection(); - - - // Member Functions - - // Evolution - - //- Inject - virtual void inject - ( - scalarField& massToInject, - scalarField& diameterToInject - ); -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace surfaceFilmModels -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModel.C b/src/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModel.C deleted file mode 100644 index 0e9b553107e80d04b70950e2ee5aafff5c708480..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModel.C +++ /dev/null @@ -1,126 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. - \\/ 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 "injectionModel.H" -#include "kinematicSingleLayer.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - namespace surfaceFilmModels - { - defineTypeNameAndDebug(injectionModel, 0); - defineRunTimeSelectionTable(injectionModel, dictionary); - } -} - - -// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // - -void Foam::surfaceFilmModels::injectionModel::correctDetachedFilm -( - scalarField& mass -) const -{ - mass = 0.0; - - const kinematicSingleLayer& film = - refCast<const kinematicSingleLayer>(owner_); - - const scalarField gNorm(film.gNorm()); - const scalarField& delta = film.delta(); - const scalarField& rho = film.rho(); - const scalarField& magSf = film.magSf(); - const scalarField& massPhaseChange = film.massPhaseChangeForPrimary(); - - forAll(gNorm, i) - { - if (gNorm[i] > SMALL) - { - const scalar ddelta = max(0.0, delta[i] - deltaStable_); - mass[i] = max(0.0, ddelta*rho[i]*magSf[i] - massPhaseChange[i]); - } - } -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::surfaceFilmModels::injectionModel::injectionModel -( - const surfaceFilmModel& owner -) -: - owner_(owner), - coeffs_(dictionary::null), - injectedMass_(0.0) -{} - - -Foam::surfaceFilmModels::injectionModel::injectionModel -( - const word& type, - const surfaceFilmModel& owner, - const dictionary& dict -) -: - owner_(owner), - coeffs_(dict.subDict(type + "Coeffs")), - injectedMass_(0.0), - deltaStable_(readScalar(coeffs_.lookup("deltaStable"))) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::surfaceFilmModels::injectionModel::~injectionModel() -{} - - -// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // - -void Foam::surfaceFilmModels::injectionModel::correct -( - volScalarField& massToInject, - volScalarField& diameterToInject -) -{ - inject(massToInject, diameterToInject); - massToInject.correctBoundaryConditions(); - diameterToInject.correctBoundaryConditions(); - - injectedMass_ += sum(massToInject.internalField()); -} - - -void Foam::surfaceFilmModels::injectionModel::info() const -{ - Info<< indent << "injected mass = " - << returnReduce<scalar>(injectedMass_, sumOp<scalar>()) << nl; -} - - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModel.H b/src/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModel.H deleted file mode 100644 index ca5b265101e616f086e85dbc870fb17eadb71cca..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModel.H +++ /dev/null @@ -1,197 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. - \\/ 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::injectionModel - -Description - Injection model class for use with surface film modelling - - Sets the newly injected fluid properties by manipulating two arrays: - - - massToInject - - diameterToInject - - This mass is later subtracted from the film - - -SourceFiles - injectionModelI.H - injectionModel.C - -\*---------------------------------------------------------------------------*/ - -#ifndef injectionModel_H -#define injectionModel_H - -#include "surfaceFilmModel.H" -#include "runTimeSelectionTables.H" -#include "scalarField.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace surfaceFilmModels -{ - -/*---------------------------------------------------------------------------*\ - Class injectionModel Declaration -\*---------------------------------------------------------------------------*/ - -class injectionModel -{ -private: - - // Private Member Functions - - //- Disallow default bitwise copy construct - injectionModel(const injectionModel&); - - //- Disallow default bitwise assignment - void operator=(const injectionModel&); - - -protected: - - // Protected data - - //- Reference to the owner surface film model - const surfaceFilmModel& owner_; - - //- Model coefficients dictionary - dictionary coeffs_; - - //- Cumulative injected mass - scalar injectedMass_; - - //- Stable film thickness - film cannot detach until reached - scalar deltaStable_; - - - // Protected Member Functions - - //- Correct film detached mass - void correctDetachedFilm(scalarField& mass) const; - - -public: - - //- Runtime type information - TypeName("injectionModel"); - - - // Declare runtime constructor selection table - - declareRunTimeSelectionTable - ( - autoPtr, - injectionModel, - dictionary, - ( - const surfaceFilmModel& owner, - const dictionary& dict - ), - (owner, dict) - ); - - // Constructors - - //- Construct null - injectionModel(const surfaceFilmModel& owner); - - //- Construct from type name, dictionary and surface film model - injectionModel - ( - const word& type, - const surfaceFilmModel& owner, - const dictionary& dict - ); - - - // Selectors - - //- Return a reference to the selected phase change model - static autoPtr<injectionModel> New - ( - const surfaceFilmModel& owner, - const dictionary& dict - ); - - - //- Destructor - virtual ~injectionModel(); - - - // Member Functions - - // Access - - //- Return the reference to the owner surface film model - inline const surfaceFilmModel& owner() const; - - //- Return the model coefficients dictionary - inline const dictionary& coeffs() const; - - //- Return access to the injected mass [kg] - inline scalar injectedMass() const; - - - // Evolution - - //- Correct - wrapper around inject(...) - virtual void correct - ( - volScalarField& massToInject, - volScalarField& diameterToInject - ); - - //- Inject - virtual void inject - ( - scalarField& massToInject, - scalarField& diameterToInject - ) = 0; - - - // Input/output - - //- Output model statistics - virtual void info() const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace surfaceFilmModels -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "injectionModelI.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModelI.H b/src/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModelI.H deleted file mode 100644 index 13455cee7bed240cc8f0c469e853e9166aee2cf2..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModelI.H +++ /dev/null @@ -1,51 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. - \\/ 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 "injectionModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -inline const Foam::surfaceFilmModels::surfaceFilmModel& -Foam::surfaceFilmModels::injectionModel::owner() const -{ - return owner_; -} - - -inline const Foam::dictionary& -Foam::surfaceFilmModels::injectionModel::coeffs() const -{ - return coeffs_; -} - - -inline Foam::scalar Foam::surfaceFilmModels::injectionModel::injectedMass() -const -{ - return injectedMass_; -} - - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModelNew.C b/src/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModelNew.C deleted file mode 100644 index 7bddebcc8edbb1877addd38d0c2025c4373b3130..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModelNew.C +++ /dev/null @@ -1,59 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. - \\/ 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 "injectionModel.H" - -// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // - -Foam::autoPtr<Foam::surfaceFilmModels::injectionModel> -Foam::surfaceFilmModels::injectionModel::New -( - const surfaceFilmModel& model, - const dictionary& dict -) -{ - word modelType(dict.lookup("injectionModel")); - - Info<< " Selecting injectionModel " << modelType << endl; - - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); - - if (cstrIter == dictionaryConstructorTablePtr_->end()) - { - FatalErrorIn - ( - "injectionModel::New(const surfaceFilmModel&, const dictionary&)" - ) << "Unknown injectionModel type " << modelType - << nl << nl << "Valid injectionModel types are:" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); - } - - return autoPtr<injectionModel>(cstrIter()(model, dict)); -} - - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/submodels/kinematic/injectionModel/noInjection/noInjection.C b/src/surfaceFilmModels/submodels/kinematic/injectionModel/noInjection/noInjection.C deleted file mode 100644 index da8ee087f64bd83fc52defead6f4033ade5b2465..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/submodels/kinematic/injectionModel/noInjection/noInjection.C +++ /dev/null @@ -1,73 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. - \\/ 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 "noInjection.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - namespace surfaceFilmModels - { - defineTypeNameAndDebug(noInjection, 0); - addToRunTimeSelectionTable(injectionModel, noInjection, dictionary); - } -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::surfaceFilmModels::noInjection::noInjection -( - const surfaceFilmModel& owner, - const dictionary& -) -: - injectionModel(owner) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::surfaceFilmModels::noInjection::~noInjection() -{} - - -// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // - -void Foam::surfaceFilmModels::noInjection::inject -( - scalarField& massToInject, - scalarField& diameterToInject -) -{ - // no mass injected - massToInject = 0.0; - diameterToInject = -1.0; -} - - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/submodels/kinematic/injectionModel/noInjection/noInjection.H b/src/surfaceFilmModels/submodels/kinematic/injectionModel/noInjection/noInjection.H deleted file mode 100644 index 405b2ba0850a86b640a62ae20946151a3992a23f..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/submodels/kinematic/injectionModel/noInjection/noInjection.H +++ /dev/null @@ -1,104 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. - \\/ 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::noInjection - -Description - Dummy injection model for 'none' - -SourceFiles - noInjection.C - -\*---------------------------------------------------------------------------*/ - -#ifndef noInjection_H -#define noInjection_H - -#include "injectionModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace surfaceFilmModels -{ - -/*---------------------------------------------------------------------------*\ - Class noInjection Declaration -\*---------------------------------------------------------------------------*/ - -class noInjection -: - public injectionModel -{ -private: - - // Private member functions - - //- Disallow default bitwise copy construct - noInjection(const noInjection&); - - //- Disallow default bitwise assignment - void operator=(const noInjection&); - - -public: - - //- Runtime type information - TypeName("none"); - - - // Constructors - - //- Construct from surface film model - noInjection(const surfaceFilmModel& owner, const dictionary& dict); - - - //- Destructor - virtual ~noInjection(); - - - // Member Functions - - // Evolution - - //- Inject - virtual void inject - ( - scalarField& massToInject, - scalarField& diameterToInject - ); -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace surfaceFilmModels -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/submodels/kinematic/injectionModel/removeInjection/removeInjection.C b/src/surfaceFilmModels/submodels/kinematic/injectionModel/removeInjection/removeInjection.C deleted file mode 100644 index b7cf4d59529f50bc761da73bdb21f7d798de750c..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/submodels/kinematic/injectionModel/removeInjection/removeInjection.C +++ /dev/null @@ -1,73 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. - \\/ 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 "removeInjection.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - namespace surfaceFilmModels - { - defineTypeNameAndDebug(removeInjection, 0); - addToRunTimeSelectionTable(injectionModel, removeInjection, dictionary); - } -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::surfaceFilmModels::removeInjection::removeInjection -( - const surfaceFilmModel& owner, - const dictionary& -) -: - injectionModel(owner) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::surfaceFilmModels::removeInjection::~removeInjection() -{} - - -// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // - -void Foam::surfaceFilmModels::removeInjection::inject -( - scalarField& massToInject, - scalarField& diameterToInject -) -{ - // all mass available to be removed - correctDetachedFilm(massToInject); - diameterToInject = -1; -} - - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/submodels/kinematic/injectionModel/removeInjection/removeInjection.H b/src/surfaceFilmModels/submodels/kinematic/injectionModel/removeInjection/removeInjection.H deleted file mode 100644 index c4b678e74cf5042837de92c44b9958b707802150..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/submodels/kinematic/injectionModel/removeInjection/removeInjection.H +++ /dev/null @@ -1,104 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. - \\/ 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::removeInjection - -Description - All mass available to be removed from the system is removed. - -SourceFiles - removeInjection.C - -\*---------------------------------------------------------------------------*/ - -#ifndef removeInjection_H -#define removeInjection_H - -#include "injectionModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace surfaceFilmModels -{ - -/*---------------------------------------------------------------------------*\ - Class removeInjection Declaration -\*---------------------------------------------------------------------------*/ - -class removeInjection -: - public injectionModel -{ -private: - - // Private member functions - - //- Disallow default bitwise copy construct - removeInjection(const removeInjection&); - - //- Disallow default bitwise assignment - void operator=(const removeInjection&); - - -public: - - //- Runtime type information - TypeName("removeInjection"); - - - // Constructors - - //- Construct from surface film model - removeInjection(const surfaceFilmModel& owner, const dictionary& dict); - - - //- Destructor - virtual ~removeInjection(); - - - // Member Functions - - // Evolution - - //- Inject - virtual void inject - ( - scalarField& massToInject, - scalarField& diameterToInject - ); -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace surfaceFilmModels -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/submodels/thermo/heatTransferModel/constantHeatTransfer/constantHeatTransfer.C b/src/surfaceFilmModels/submodels/thermo/heatTransferModel/constantHeatTransfer/constantHeatTransfer.C deleted file mode 100644 index 682971f3a62707d29c4018d12b773682929bfcfb..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/submodels/thermo/heatTransferModel/constantHeatTransfer/constantHeatTransfer.C +++ /dev/null @@ -1,105 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. - \\/ 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 "constantHeatTransfer.H" -#include "volFields.H" -#include "addToRunTimeSelectionTable.H" -#include "zeroGradientFvPatchFields.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - namespace surfaceFilmModels - { - defineTypeNameAndDebug(constantHeatTransfer, 0); - addToRunTimeSelectionTable - ( - heatTransferModel, - constantHeatTransfer, - dictionary - ); - } -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::surfaceFilmModels::constantHeatTransfer::constantHeatTransfer -( - const surfaceFilmModel& owner, - const dictionary& dict -) -: - heatTransferModel(typeName, owner, dict), - c0_(readScalar(coeffs_.lookup("c0"))) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::surfaceFilmModels::constantHeatTransfer::~constantHeatTransfer() -{} - - -// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // - -void Foam::surfaceFilmModels::constantHeatTransfer::correct() -{ - // do nothing -} - - -Foam::tmp<Foam::volScalarField> -Foam::surfaceFilmModels::constantHeatTransfer::h() const -{ - return tmp<volScalarField> - ( - new volScalarField - ( - IOobject - ( - "htc", - owner_.time().timeName(), - owner_.film(), - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - owner_.film(), - dimensionedScalar - ( - "c0", - dimEnergy/dimTime/sqr(dimLength)/dimTemperature, - c0_ - ), - zeroGradientFvPatchScalarField::typeName - ) - ); -} - - - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/submodels/thermo/heatTransferModel/constantHeatTransfer/constantHeatTransfer.H b/src/surfaceFilmModels/submodels/thermo/heatTransferModel/constantHeatTransfer/constantHeatTransfer.H deleted file mode 100644 index 537e70fae2089653f43a96bfa688cd06b27843d4..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/submodels/thermo/heatTransferModel/constantHeatTransfer/constantHeatTransfer.H +++ /dev/null @@ -1,114 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. - \\/ 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::constantHeatTransfer - -Description - Constant heat transfer model - -SourceFiles - constantHeatTransfer.C - -\*---------------------------------------------------------------------------*/ - -#ifndef constantHeatTransfer_H -#define constantHeatTransfer_H - -#include "heatTransferModel.H" -#include "volFieldsFwd.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace surfaceFilmModels -{ - -/*---------------------------------------------------------------------------*\ - Class constantHeatTransfer Declaration -\*---------------------------------------------------------------------------*/ - -class constantHeatTransfer -: - public heatTransferModel -{ -private: - - // Private data - - //- Constant heat transfer coefficient [W/m2/K] - scalar c0_; - - - // Private member functions - - //- Disallow default bitwise copy construct - constantHeatTransfer(const constantHeatTransfer&); - - //- Disallow default bitwise assignment - void operator=(const constantHeatTransfer&); - - -public: - - //- Runtime type information - TypeName("constant"); - - - // Constructors - - //- Construct from surface film model and dictionary - constantHeatTransfer - ( - const surfaceFilmModel& owner, - const dictionary& dict - ); - - - //- Destructor - virtual ~constantHeatTransfer(); - - - // Member Functions - - // Evolution - - //- Correct - virtual void correct(); - - //- Return the heat transfer coefficient [W/m2/K] - virtual tmp<volScalarField> h() const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace surfaceFilmModels -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/submodels/thermo/heatTransferModel/heatTransferModel/heatTransferModel.C b/src/surfaceFilmModels/submodels/thermo/heatTransferModel/heatTransferModel/heatTransferModel.C deleted file mode 100644 index b7ee18522596a104ccbc0c7e9439eec99b11d3a5..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/submodels/thermo/heatTransferModel/heatTransferModel/heatTransferModel.C +++ /dev/null @@ -1,69 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. - \\/ 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 "heatTransferModel.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - namespace surfaceFilmModels - { - defineTypeNameAndDebug(heatTransferModel, 0); - defineRunTimeSelectionTable(heatTransferModel, dictionary); - } -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::surfaceFilmModels::heatTransferModel::heatTransferModel -( - const surfaceFilmModel& owner -) -: - owner_(owner) -{} - - -Foam::surfaceFilmModels::heatTransferModel::heatTransferModel -( - const word& type, - const surfaceFilmModel& owner, - const dictionary& dict -) -: - owner_(owner), - coeffs_(dict.subDict(type + "Coeffs")) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::surfaceFilmModels::heatTransferModel::~heatTransferModel() -{} - - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/submodels/thermo/heatTransferModel/heatTransferModel/heatTransferModel.H b/src/surfaceFilmModels/submodels/thermo/heatTransferModel/heatTransferModel/heatTransferModel.H deleted file mode 100644 index 25caf051d910beaf2ae1d2813a8267fcaea1dc87..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/submodels/thermo/heatTransferModel/heatTransferModel/heatTransferModel.H +++ /dev/null @@ -1,159 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. - \\/ 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::heatTransferModel - -Description - Base class for heat transfer models - -SourceFiles - heatTransferModelI.H - heatTransferModel.C - -\*---------------------------------------------------------------------------*/ - -#ifndef heatTransferModel_H -#define heatTransferModel_H - -#include "surfaceFilmModel.H" -#include "runTimeSelectionTables.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace surfaceFilmModels -{ - -/*---------------------------------------------------------------------------*\ - Class heatTransferModel Declaration -\*---------------------------------------------------------------------------*/ - -class heatTransferModel -{ -private: - - // Private Member Functions - - //- Disallow default bitwise copy construct - heatTransferModel(const heatTransferModel&); - - //- Disallow default bitwise assignment - void operator=(const heatTransferModel&); - - -protected: - - // Protected data - - //- Reference to the owner surface film model - const surfaceFilmModel& owner_; - - //- Model coefficients dictionary - dictionary coeffs_; - - -public: - - //- Runtime type information - TypeName("heatTransferModel"); - - - // Declare runtime constructor selection table - - declareRunTimeSelectionTable - ( - autoPtr, - heatTransferModel, - dictionary, - ( - const surfaceFilmModel& owner, - const dictionary& dict - ), - (owner, dict) - ); - - // Constructors - - //- Construct null - heatTransferModel(const surfaceFilmModel& owner); - - //- Construct from type name, dictionary and surface film model - heatTransferModel - ( - const word& type, - const surfaceFilmModel& owner, - const dictionary& dict - ); - - - // Selectors - - //- Return a reference to the selected phase change model - static autoPtr<heatTransferModel> New - ( - const surfaceFilmModel& owner, - const dictionary& dict - ); - - - //- Destructor - virtual ~heatTransferModel(); - - - // Member Functions - - // Access - - //- Return the reference to the owner surface film model - inline const surfaceFilmModel& owner() const; - - //- Return the model coefficients dictionary - inline const dictionary& coeffs() const; - - - // Evolution - - //- Correct - virtual void correct() = 0; - - //- Return the heat transfer coefficient [W/m2/K] - virtual tmp<volScalarField> h() const = 0; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace surfaceFilmModels -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "heatTransferModelI.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/submodels/thermo/heatTransferModel/heatTransferModel/heatTransferModelI.H b/src/surfaceFilmModels/submodels/thermo/heatTransferModel/heatTransferModel/heatTransferModelI.H deleted file mode 100644 index c9a99ffe2988b64b577d9b85481f96859421bf0f..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/submodels/thermo/heatTransferModel/heatTransferModel/heatTransferModelI.H +++ /dev/null @@ -1,44 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. - \\/ 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 "heatTransferModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -inline const Foam::surfaceFilmModels::surfaceFilmModel& -Foam::surfaceFilmModels::heatTransferModel::owner() const -{ - return owner_; -} - - -inline const Foam::dictionary& -Foam::surfaceFilmModels::heatTransferModel::coeffs() const -{ - return coeffs_; -} - - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/submodels/thermo/heatTransferModel/heatTransferModel/heatTransferModelNew.C b/src/surfaceFilmModels/submodels/thermo/heatTransferModel/heatTransferModel/heatTransferModelNew.C deleted file mode 100644 index e16c40afaf0732d3093d4c2ec0499dac8461184f..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/submodels/thermo/heatTransferModel/heatTransferModel/heatTransferModelNew.C +++ /dev/null @@ -1,59 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. - \\/ 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 "heatTransferModel.H" - -// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // - -Foam::autoPtr<Foam::surfaceFilmModels::heatTransferModel> -Foam::surfaceFilmModels::heatTransferModel::New -( - const surfaceFilmModel& model, - const dictionary& dict -) -{ - word modelType(dict.lookup("heatTransferModel")); - - Info<< " Selecting heatTransferModel " << modelType << endl; - - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); - - if (cstrIter == dictionaryConstructorTablePtr_->end()) - { - FatalErrorIn - ( - "heatTransferModel::New(const surfaceFilmModel&, const dictionary&)" - ) << "Unknown heatTransferModel type " << modelType << nl << nl - << "Valid heatTransferModel types are:" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); - } - - return autoPtr<heatTransferModel>(cstrIter()(model, dict)); -} - - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/submodels/thermo/heatTransferModel/mappedConvectiveHeatTransfer/mappedConvectiveHeatTransfer.C b/src/surfaceFilmModels/submodels/thermo/heatTransferModel/mappedConvectiveHeatTransfer/mappedConvectiveHeatTransfer.C deleted file mode 100644 index cfe6d577fe77c460229b800ae01e227270f7df49..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/submodels/thermo/heatTransferModel/mappedConvectiveHeatTransfer/mappedConvectiveHeatTransfer.C +++ /dev/null @@ -1,121 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. - \\/ 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 "mappedConvectiveHeatTransfer.H" -#include "zeroGradientFvPatchFields.H" -#include "addToRunTimeSelectionTable.H" -#include "kinematicSingleLayer.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - namespace surfaceFilmModels - { - defineTypeNameAndDebug(mappedConvectiveHeatTransfer, 0); - addToRunTimeSelectionTable - ( - heatTransferModel, - mappedConvectiveHeatTransfer, - dictionary - ); - } -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::surfaceFilmModels::mappedConvectiveHeatTransfer:: -mappedConvectiveHeatTransfer -( - const surfaceFilmModel& owner, - const dictionary& dict -) -: -// heatTransferModel(typeName, owner, dict), - heatTransferModel(owner), - htcConvPrimary_ - ( - IOobject - ( - "htcConv", - owner.time().timeName(), - owner.mesh(), - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - owner.mesh() - ), - htcConvFilm_ - ( - IOobject - ( - htcConvPrimary_.name(), // must have same name as above for mapping - owner.time().timeName(), - owner.film(), - IOobject::NO_READ, - IOobject::NO_WRITE - ), - owner.film(), - dimensionedScalar("zero", dimMass/pow3(dimTime)/dimTemperature, 0.0), - refCast<const kinematicSingleLayer>(owner).pSp().boundaryField().types() - ) -{ - // Update the primary-side convective heat transfer coefficient - htcConvPrimary_.correctBoundaryConditions(); - - // Pull the data from the primary region via direct mapped BCs - htcConvFilm_.correctBoundaryConditions(); -} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::surfaceFilmModels::mappedConvectiveHeatTransfer:: -~mappedConvectiveHeatTransfer() -{} - - -// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // - -void Foam::surfaceFilmModels::mappedConvectiveHeatTransfer::correct() -{ - // Update the primary-side convective heat transfer coefficient - htcConvPrimary_.correctBoundaryConditions(); - - // Pull the data from the primary region via direct mapped BCs - htcConvFilm_.correctBoundaryConditions(); -} - - -Foam::tmp<Foam::volScalarField> -Foam::surfaceFilmModels::mappedConvectiveHeatTransfer::h() const -{ - return htcConvFilm_; -} - - - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/submodels/thermo/heatTransferModel/mappedConvectiveHeatTransfer/mappedConvectiveHeatTransfer.H b/src/surfaceFilmModels/submodels/thermo/heatTransferModel/mappedConvectiveHeatTransfer/mappedConvectiveHeatTransfer.H deleted file mode 100644 index 8f02cb61ba9bf5fc67437144439401360271fb0b..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/submodels/thermo/heatTransferModel/mappedConvectiveHeatTransfer/mappedConvectiveHeatTransfer.H +++ /dev/null @@ -1,120 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. - \\/ 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::mappedConvectiveHeatTransfer - -Description - Convective heat transfer model based on a re-working of a Nusselt number - correlation - -SourceFiles - mappedConvectiveHeatTransfer.C - -\*---------------------------------------------------------------------------*/ - -#ifndef mappedConvectiveHeatTransfer_H -#define mappedConvectiveHeatTransfer_H - -#include "heatTransferModel.H" -#include "volFields.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace surfaceFilmModels -{ - -/*---------------------------------------------------------------------------*\ - Class mappedConvectiveHeatTransfer Declaration -\*---------------------------------------------------------------------------*/ - -class mappedConvectiveHeatTransfer -: - public heatTransferModel -{ -private: - - // Private data - - //- Heat transfer coefficient - primary region [W/m2/K] - volScalarField htcConvPrimary_; - - //- Heat transfer coefficient - film region [W/m2/K] - // Assumes that the primary regtion to film region boundaries are - // described as directMappedPushed types - volScalarField htcConvFilm_; - - - // Private member functions - - //- Disallow default bitwise copy construct - mappedConvectiveHeatTransfer(const mappedConvectiveHeatTransfer&); - - //- Disallow default bitwise assignment - void operator=(const mappedConvectiveHeatTransfer&); - - -public: - - //- Runtime type information - TypeName("mappedConvectiveHeatTransfer"); - - - // Constructors - - //- Construct from surface film model and dictionary - mappedConvectiveHeatTransfer - ( - const surfaceFilmModel& owner, - const dictionary& dict - ); - - - //- Destructor - virtual ~mappedConvectiveHeatTransfer(); - - - // Member Functions - - // Evolution - - //- Correct - virtual void correct(); - - //- Return the heat transfer coefficient [W/m2/K] - virtual tmp<volScalarField> h() const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace surfaceFilmModels -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/noPhaseChange/noPhaseChange.C b/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/noPhaseChange/noPhaseChange.C deleted file mode 100644 index 99691237dc5ecdbfc0fc6e12875359d285281962..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/noPhaseChange/noPhaseChange.C +++ /dev/null @@ -1,78 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. - \\/ 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 "noPhaseChange.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - namespace surfaceFilmModels - { - defineTypeNameAndDebug(noPhaseChange, 0); - addToRunTimeSelectionTable(phaseChangeModel, noPhaseChange, dictionary); - } -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::surfaceFilmModels::noPhaseChange::noPhaseChange -( - const surfaceFilmModel& owner, - const dictionary& -) -: - phaseChangeModel(owner) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::surfaceFilmModels::noPhaseChange::~noPhaseChange() -{} - - -// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // - -void Foam::surfaceFilmModels::noPhaseChange::correct -( - const scalar, - scalarField&, - scalarField& -) -{ - // do nothing -} - - -void Foam::surfaceFilmModels::noPhaseChange::info() const -{ - // do nothing -} - - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/noPhaseChange/noPhaseChange.H b/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/noPhaseChange/noPhaseChange.H deleted file mode 100644 index e29cc4df4ae5ba3ef6ec4240611361bd9681accd..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/noPhaseChange/noPhaseChange.H +++ /dev/null @@ -1,111 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. - \\/ 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::noPhaseChange - -Description - Dummy phase change model for 'none' - -SourceFiles - noPhaseChange.C - -\*---------------------------------------------------------------------------*/ - -#ifndef noPhaseChange_H -#define noPhaseChange_H - -#include "phaseChangeModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace surfaceFilmModels -{ - -/*---------------------------------------------------------------------------*\ - Class noPhaseChange Declaration -\*---------------------------------------------------------------------------*/ - -class noPhaseChange -: - public phaseChangeModel -{ -private: - - // Private member functions - - //- Disallow default bitwise copy construct - noPhaseChange(const noPhaseChange&); - - //- Disallow default bitwise assignment - void operator=(const noPhaseChange&); - - -public: - - //- Runtime type information - TypeName("none"); - - - // Constructors - - //- Construct from surface film model - noPhaseChange(const surfaceFilmModel& owner, const dictionary& dict); - - - //- Destructor - virtual ~noPhaseChange(); - - - // Member Functions - - // Evolution - - //- Correct - virtual void correct - ( - const scalar dt, - scalarField& dMass, - scalarField& dEnergy - ); - - - // Input/output - - //- Output model statistics - virtual void info() const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace surfaceFilmModels -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModel.C b/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModel.C deleted file mode 100644 index 7e7e310d611c83bdf4b5cdad432f3a924dbd3d21..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModel.C +++ /dev/null @@ -1,70 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. - \\/ 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 "phaseChangeModel.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - namespace surfaceFilmModels - { - defineTypeNameAndDebug(phaseChangeModel, 0); - defineRunTimeSelectionTable(phaseChangeModel, dictionary); - } -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::surfaceFilmModels::phaseChangeModel::phaseChangeModel -( - const surfaceFilmModel& owner -) -: - owner_(owner), - coeffs_(dictionary::null) -{} - - -Foam::surfaceFilmModels::phaseChangeModel::phaseChangeModel -( - const word& type, - const surfaceFilmModel& owner, - const dictionary& dict -) -: - owner_(owner), - coeffs_(dict.subDict(type + "Coeffs")) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::surfaceFilmModels::phaseChangeModel::~phaseChangeModel() -{} - - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModel.H b/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModel.H deleted file mode 100644 index 716f010e10dd9cc57c5580a770a255a3b1a4926a..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModel.H +++ /dev/null @@ -1,168 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. - \\/ 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::phaseChangeModel - -Description - Phase change model for surface film modelling. - -SourceFiles - phaseChangeModelI.H - phaseChangeModel.C - -\*---------------------------------------------------------------------------*/ - -#ifndef phaseChangeModel_H -#define phaseChangeModel_H - -#include "surfaceFilmModel.H" -#include "runTimeSelectionTables.H" -#include "scalarField.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace surfaceFilmModels -{ - -/*---------------------------------------------------------------------------*\ - Class phaseChangeModel Declaration -\*---------------------------------------------------------------------------*/ - -class phaseChangeModel -{ -private: - - // Private Member Functions - - //- Disallow default bitwise copy construct - phaseChangeModel(const phaseChangeModel&); - - //- Disallow default bitwise assignment - void operator=(const phaseChangeModel&); - - -protected: - - // Protected data - - //- Reference to the owner surface film model - const surfaceFilmModel& owner_; - - //- Model coefficients dictionary - dictionary coeffs_; - - -public: - - //- Runtime type information - TypeName("phaseChangeModel"); - - - // Declare runtime constructor selection table - - declareRunTimeSelectionTable - ( - autoPtr, - phaseChangeModel, - dictionary, - ( - const surfaceFilmModel& owner, - const dictionary& dict - ), - (owner, dict) - ); - - // Constructors - - //- Construct null - phaseChangeModel(const surfaceFilmModel& owner); - - //- Construct from type name, dictionary and surface film model - phaseChangeModel - ( - const word& type, - const surfaceFilmModel& owner, - const dictionary& dict - ); - - - // Selectors - - //- Return a reference to the selected phase change model - static autoPtr<phaseChangeModel> New - ( - const surfaceFilmModel& owner, - const dictionary& dict - ); - - - //- Destructor - virtual ~phaseChangeModel(); - - - // Member Functions - - // Access - - //- Return the reference to the owner surface film model - inline const surfaceFilmModel& owner() const; - - //- Return the model coefficients dictionary - inline const dictionary& coeffs() const; - - - // Evolution - - //- Correct - virtual void correct - ( - const scalar dt, - scalarField& dMass, - scalarField& dEnergy - ) = 0; - - - // Input/output - - //- Output model statistics - virtual void info() const = 0; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace surfaceFilmModels -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "phaseChangeModelI.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModelI.H b/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModelI.H deleted file mode 100644 index f893bbbfa7e69cf843b25a49af897dd19dff7980..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModelI.H +++ /dev/null @@ -1,44 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. - \\/ 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 "phaseChangeModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -inline const Foam::surfaceFilmModels::surfaceFilmModel& -Foam::surfaceFilmModels::phaseChangeModel::owner() const -{ - return owner_; -} - - -inline const Foam::dictionary& -Foam::surfaceFilmModels::phaseChangeModel::coeffs() const -{ - return coeffs_; -} - - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModelNew.C b/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModelNew.C deleted file mode 100644 index 7cc04c0027d1bb732a3575fec82a51753d0f4c54..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModelNew.C +++ /dev/null @@ -1,59 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. - \\/ 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 "phaseChangeModel.H" - -// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // - -Foam::autoPtr<Foam::surfaceFilmModels::phaseChangeModel> -Foam::surfaceFilmModels::phaseChangeModel::New -( - const surfaceFilmModel& model, - const dictionary& dict -) -{ - word modelType(dict.lookup("phaseChangeModel")); - - Info<< " Selecting phaseChangeModel " << modelType << endl; - - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); - - if (cstrIter == dictionaryConstructorTablePtr_->end()) - { - FatalErrorIn - ( - "phaseChangeModel::New(const surfaceFilmModel&, const dictionary&)" - ) << "Unknown phaseChangeModel type " << modelType - << nl << nl << "Valid phaseChangeModel types are:" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << exit(FatalError); - } - - return autoPtr<phaseChangeModel>(cstrIter()(model, dict)); -} - - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/standardPhaseChange/standardPhaseChange.C b/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/standardPhaseChange/standardPhaseChange.C deleted file mode 100644 index 29ae7ce8ea6a90f6496b68d3d791bf41a4efb133..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/standardPhaseChange/standardPhaseChange.C +++ /dev/null @@ -1,218 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. - \\/ 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 "standardPhaseChange.H" -#include "addToRunTimeSelectionTable.H" -#include "thermoSingleLayer.H" -#include "specie.H" -#include "heatTransferModel.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - namespace surfaceFilmModels - { - defineTypeNameAndDebug(standardPhaseChange, 0); - addToRunTimeSelectionTable - ( - phaseChangeModel, - standardPhaseChange, - dictionary - ); - } -} - - -// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // - -Foam::scalar Foam::surfaceFilmModels::standardPhaseChange::Sh -( - const scalar Re, - const scalar Sc -) const -{ - if (Re < 5.0E+05) - { - return 0.664*sqrt(Re)*cbrt(Sc); - } - else - { - return 0.037*pow(Re, 0.8)*cbrt(Sc); - } -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::surfaceFilmModels::standardPhaseChange::standardPhaseChange -( - const surfaceFilmModel& owner, - const dictionary& dict -) -: - phaseChangeModel(typeName, owner, dict), - Tb_(readScalar(coeffs_.lookup("Tb"))), - deltaMin_(readScalar(coeffs_.lookup("deltaMin"))), - L_(readScalar(coeffs_.lookup("L"))), - TbFactor_(coeffs_.lookupOrDefault<scalar>("TbFactor", 1.1)), - totalMass_(0.0), - vapourRate_(0.0) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::surfaceFilmModels::standardPhaseChange::~standardPhaseChange() -{} - - -// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // - -void Foam::surfaceFilmModels::standardPhaseChange::correct -( - const scalar dt, - scalarField& dMass, - scalarField& dEnergy -) -{ - dMass = 0.0; - dEnergy = 0.0; - - const thermoSingleLayer& film = refCast<const thermoSingleLayer>(owner_); - - // set local thermo properties - const SLGThermo& thermo = film.thermo(); - const label liqId = film.liquidId(); - const liquid& liq = thermo.liquids().properties()[liqId]; - const label vapId = thermo.carrierId(thermo.liquids().components()[liqId]); - - // retrieve fields from film model - const scalarField& delta = film.delta(); - const scalarField& YInf = film.YPrimary()[vapId]; - const scalarField& pInf = film.pPrimary(); - const scalarField& T = film.T(); - const scalarField& Tw = film.Tw(); - const scalarField& rho = film.rho(); - const scalarField& TInf = film.TPrimary(); - const scalarField& rhoInf = film.rhoPrimary(); - const scalarField& muInf = film.muPrimary(); - const scalarField& magSf = film.magSf(); - const scalarField hInf(film.htcs().h()); - const scalarField hFilm(film.htcw().h()); - const vectorField dU(film.UPrimary() - film.Us()); - const scalarField availableMass((delta - deltaMin_)*rho*magSf); - - - forAll(dMass, cellI) - { - if (delta[cellI] > deltaMin_) - { - // cell pressure [Pa] - const scalar pc = pInf[cellI]; - - // local temperature - impose lower limit of 200 K for stability - const scalar Tloc = min(TbFactor_*Tb_, max(200.0, T[cellI])); - - // saturation pressure [Pa] - const scalar pSat = liq.pv(pc, Tloc); - - // latent heat [J/kg] - const scalar hVap = liq.hl(pc, Tloc); - - // calculate mass transfer - if (pSat >= 0.95*pc) - { - // boiling - const scalar qDotInf = hInf[cellI]*(TInf[cellI] - T[cellI]); - const scalar qDotFilm = hFilm[cellI]*(T[cellI] - Tw[cellI]); - - const scalar Cp = liq.Cp(pc, Tloc); - const scalar Tcorr = max(0.0, T[cellI] - Tb_); - const scalar qCorr = availableMass[cellI]*Cp*(Tcorr); - - dMass[cellI] = - dt*magSf[cellI]/hVap*(qDotInf + qDotFilm) - + qCorr/hVap; - - } - else - { - // Primary region density [kg/m3] - const scalar rhoInfc = rhoInf[cellI]; - - // Primary region viscosity [Pa.s] - const scalar muInfc = muInf[cellI]; - - // Reynolds number - const scalar Re = rhoInfc*mag(dU[cellI])*L_/muInfc; - - // molecular weight of vapour [kg/kmol] - const scalar Wvap = thermo.carrier().W(vapId); - - // molecular weight of liquid [kg/kmol] - const scalar Wliq = liq.W(); - - // vapour mass fraction at interface - const scalar Ys = Wliq*pSat/(Wliq*pSat + Wvap*(pc - pSat)); - - // vapour diffusivity [m2/s] - const scalar Dab = liq.D(pc, Tloc); - - // Schmidt number - const scalar Sc = muInfc/(rhoInfc*(Dab + ROOTVSMALL)); - - // Sherwood number - const scalar Sh = this->Sh(Re, Sc); - - // mass transfer coefficient [m/s] - const scalar hm = Sh*Dab/(L_ + ROOTVSMALL); - - // add mass contribution to source - dMass[cellI] = - dt*magSf[cellI]*rhoInfc*hm*(Ys - YInf[cellI])/(1.0 - Ys); - } - - dMass[cellI] = min(availableMass[cellI], max(0.0, dMass[cellI])); - dEnergy[cellI] = dMass[cellI]*hVap; - } - } - - const scalar sumdMass = sum(dMass); - totalMass_ += sumdMass; - vapourRate_ = sumdMass/owner().time().deltaTValue(); -} - - -void Foam::surfaceFilmModels::standardPhaseChange::info() const -{ - Info<< indent << "mass phase change = " - << returnReduce(totalMass_, sumOp<scalar>()) << nl - << indent << "vapourisation rate = " - << returnReduce(vapourRate_, sumOp<scalar>()) << nl; -} - - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/standardPhaseChange/standardPhaseChange.H b/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/standardPhaseChange/standardPhaseChange.H deleted file mode 100644 index 17138974c4921dd30f7dc083828313da6f5160be..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/standardPhaseChange/standardPhaseChange.H +++ /dev/null @@ -1,145 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. - \\/ 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::standardPhaseChange - -Description - - -SourceFiles - standardPhaseChange.C - -\*---------------------------------------------------------------------------*/ - -#ifndef standardPhaseChange_H -#define standardPhaseChange_H - -#include "phaseChangeModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace surfaceFilmModels -{ - -/*---------------------------------------------------------------------------*\ - Class standardPhaseChange Declaration -\*---------------------------------------------------------------------------*/ - -class standardPhaseChange -: - public phaseChangeModel -{ -private: - - // Private member functions - - //- Disallow default bitwise copy construct - standardPhaseChange(const standardPhaseChange&); - - //- Disallow default bitwise assignment - void operator=(const standardPhaseChange&); - - -protected: - - // Protected data - - //- Boiling temperature / [K] - const scalar Tb_; - - //- Minimum film height for model to be active - const scalar deltaMin_; - - //- Length scale / [m] - const scalar L_; - - //- Boiling temperature factor / [] - // Used to set max limit on temperature to Tb*TbFactor - const scalar TbFactor_; - - //- Total mass evolved / [kg] - scalar totalMass_; - - //- Vapouristaion rate / kg/s - scalar vapourRate_; - - - // Protected member functions - - //- Return Sherwood number as a function of Reynolds and Schmidt numbers - scalar Sh(const scalar Re, const scalar Sc) const; - - -public: - - //- Runtime type information - TypeName("standardPhaseChange"); - - - // Constructors - - //- Construct from surface film model - standardPhaseChange - ( - const surfaceFilmModel& owner, - const dictionary& dict - ); - - - //- Destructor - virtual ~standardPhaseChange(); - - - // Member Functions - - // Evolution - - //- Correct - virtual void correct - ( - const scalar dt, - scalarField& dMass, - scalarField& dEnergy - ); - - - // Input/output - - //- Output model statistics - virtual void info() const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace surfaceFilmModels -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/surfaceFilmModel/kinematicSingleLayer/kinematicSingleLayer.C b/src/surfaceFilmModels/surfaceFilmModel/kinematicSingleLayer/kinematicSingleLayer.C deleted file mode 100644 index 903cf1bda1abd1628b5b223313a77103924b40df..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/surfaceFilmModel/kinematicSingleLayer/kinematicSingleLayer.C +++ /dev/null @@ -1,1257 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. - \\/ 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 "kinematicSingleLayer.H" -#include "fvm.H" -#include "fvcDiv.H" -#include "fvcLaplacian.H" -#include "fvcSnGrad.H" -#include "fvcReconstruct.H" -#include "fvcVolumeIntegrate.H" -#include "addToRunTimeSelectionTable.H" -#include "directMappedWallPolyPatch.H" - -// Sub-models -#include "injectionModel.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - namespace surfaceFilmModels - { - defineTypeNameAndDebug(kinematicSingleLayer, 0); - addToRunTimeSelectionTable - ( - surfaceFilmModel, - kinematicSingleLayer, - mesh - ); - } -} - - -// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // - -bool Foam::surfaceFilmModels::kinematicSingleLayer::read() -{ - if (surfaceFilmModel::read()) - { - solution().lookup("momentumPredictor") >> momentumPredictor_; - solution().lookup("nOuterCorr") >> nOuterCorr_; - solution().lookup("nCorr") >> nCorr_; - solution().lookup("nNonOrthCorr") >> nNonOrthCorr_; - - coeffs_.lookup("Cf") >> Cf_; - - return true; - } - else - { - return false; - } -} - - -void Foam::surfaceFilmModels::kinematicSingleLayer::initialise() -{ - if (debug) - { - Pout<< "kinematicSingleLayer::initialise()" << endl; - } - - label nBoundaryFaces = 0; - DynamicList<label> primaryPatchIDs; - DynamicList<label> filmBottomPatchIDs; - const polyBoundaryMesh& bm = filmRegion_.boundaryMesh(); - forAll(bm, patchI) - { - const polyPatch& pp = bm[patchI]; - if (isA<directMappedWallPolyPatch>(pp)) - { - if (debug) - { - Pout<< "found " << directMappedWallPolyPatch::typeName - << " " << pp.name() << endl; - } - - filmBottomPatchIDs.append(patchI); - const directMappedWallPolyPatch& dwpp = - refCast<const directMappedWallPolyPatch>(pp); - - primaryPatchIDs.append - ( - mesh_.boundaryMesh().findPatchID(dwpp.samplePatch()) - ); - - const labelList& fCells = pp.faceCells(); - nBoundaryFaces += fCells.size(); - - // Cache patch normals - UIndirectList<vector>(nHat_, fCells) = pp.faceNormals(); - - // Cache mesh face areas - UIndirectList<scalar>(magSf_, fCells) = mag(pp.faceAreas()); - } - } - nHat_.correctBoundaryConditions(); - magSf_.correctBoundaryConditions(); - - primaryPatchIDs_.transfer(primaryPatchIDs); - filmBottomPatchIDs_.transfer(filmBottomPatchIDs); - - if (nBoundaryFaces == 0) - { - WarningIn("kinematicSingleLayer::initialise()") - << "Film model being applied without direct mapped boundary " - << "conditions" << endl; - } - - if (nBoundaryFaces != filmRegion_.nCells()) - { - FatalErrorIn("kinematicSingleLayer::initialise()") - << "Number of primary region coupled boundary faces not equal to " - << "the number of cells in the film region" << nl - << abort(FatalError); - } - - scalarField topMagSf(magSf_.size(), 0.0); - filmTopPatchIDs_.setSize(filmBottomPatchIDs_.size(), -1); - forAll(filmBottomPatchIDs_, i) - { - const label patchI = filmBottomPatchIDs_[i]; - const polyPatch& ppBottom = bm[patchI]; - if (ppBottom.size() > 0) - { - label cellId = bm[patchI].faceCells()[0]; - const cell& cFaces = filmRegion_.cells()[cellId]; - - label faceBottom = ppBottom.start(); - label faceTop = - cFaces.opposingFaceLabel(faceBottom, filmRegion_.faces()); - - label topPatchI = bm.whichPatch(faceTop); - filmTopPatchIDs_[i] = topPatchI; - const polyPatch& ppTop = bm[topPatchI]; - UIndirectList<scalar>(topMagSf, ppTop.faceCells()) = - mag(ppTop.faceAreas()); - } - } - - Pstream::listCombineGather(filmTopPatchIDs_, maxEqOp<label>()); - Pstream::listCombineScatter(filmTopPatchIDs_); - - magSf_.field() = 0.5*(magSf_ + topMagSf); - magSf_.correctBoundaryConditions(); -} - - -void Foam::surfaceFilmModels::kinematicSingleLayer::correctThermoFields() -{ - if (thermoModel_ == tmConstant) - { - rho_ == dimensionedScalar(coeffs_.lookup("rho0")); - mu_ == dimensionedScalar(coeffs_.lookup("mu0")); - sigma_ == dimensionedScalar(coeffs_.lookup("sigma0")); - } - else - { - FatalErrorIn - ( - "void Foam::surfaceFilmModels::kinematicSingleLayer::" - "correctThermoFields()" - ) << "Kinematic surface film must use " - << thermoModelTypeNames_[thermoModel_] << "thermodynamics" << endl; - } -} - - -void Foam::surfaceFilmModels::kinematicSingleLayer:: -resetPrimaryRegionSourceTerms() -{ - rhoSpPrimary_ == dimensionedScalar("zero", rhoSp_.dimensions(), 0.0); - USpPrimary_ == dimensionedVector("zero", USp_.dimensions(), vector::zero); - pSpPrimary_ == dimensionedScalar("zero", pSp_.dimensions(), 0.0); -} - - -void Foam::surfaceFilmModels::kinematicSingleLayer:: -transferPrimaryRegionFields() -{ - // Update fields from primary region via direct mapped - // (coupled) boundary conditions - UPrimary_.correctBoundaryConditions(); - pPrimary_.correctBoundaryConditions(); - rhoPrimary_.correctBoundaryConditions(); - muPrimary_.correctBoundaryConditions(); - - // Retrieve the source fields from the primary region via direct mapped - // (coupled) boundary conditions - // - fields require transfer of values for both patch AND to push the - // values into the first layer of internal cells - rhoSp_.correctBoundaryConditions(); - USp_.correctBoundaryConditions(); - pSp_.correctBoundaryConditions(); - - // Convert accummulated source terms into per unit area per unit time - // Note: boundary values will still have original (neat) values - const scalar deltaT = time_.deltaTValue(); - rhoSp_.field() /= magSf_*deltaT; - USp_.field() /= magSf_*deltaT; - pSp_.field() /= magSf_*deltaT; -} - - -Foam::tmp<Foam::volScalarField> -Foam::surfaceFilmModels::kinematicSingleLayer::pu() -{ - return tmp<volScalarField> - ( - new volScalarField - ( - IOobject - ( - "pu", - time_.timeName(), - filmRegion_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - pPrimary_ // pressure (mapped from primary region) - + pSp_ // accumulated particle impingement - - fvc::laplacian(sigma_, delta_) // surface tension - ) - ); -} - - -Foam::tmp<Foam::volScalarField> -Foam::surfaceFilmModels::kinematicSingleLayer::pp() -{ - return tmp<volScalarField> - ( - new volScalarField - ( - IOobject - ( - "pp", - time_.timeName(), - filmRegion_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - -rho_*gNormClipped() // hydrostatic effect only - ) - ); -} - - -void Foam::surfaceFilmModels::kinematicSingleLayer::updateSubmodels() -{ - // Update injection model - mass returned is actual mass injected - injection_->correct(massForPrimary_, diametersForPrimary_); - - // Update source fields - const dimensionedScalar deltaT = time_.deltaT(); - rhoSp_ -= (massForPrimary_ + massPhaseChangeForPrimary_)/magSf_/deltaT; -} - - -Foam::scalar -Foam::surfaceFilmModels::kinematicSingleLayer::CourantNumber() const -{ - scalar CoNum = 0.0; - scalar meanCoNum = 0.0; - - if (filmRegion_.nInternalFaces()) - { - const scalar deltaT = time_.deltaTValue(); - - surfaceScalarField SfUfbyDelta - ( - filmRegion_.surfaceInterpolation::deltaCoeffs()*mag(phi_) - /fvc::interpolate - ( - rho_*(delta_ + dimensionedScalar("SMALL", dimLength, SMALL)) - ) - ); - - CoNum = max(SfUfbyDelta/filmRegion_.magSf()).value()*deltaT; - - meanCoNum = (sum(SfUfbyDelta)/sum(filmRegion_.magSf())).value()*deltaT; - } - - Info<< " Courant number mean: " << meanCoNum << " max: " << CoNum - << endl; - - return CoNum; -} - - -void Foam::surfaceFilmModels::kinematicSingleLayer::continuityCheck() -{ - const volScalarField deltaRho0(deltaRho_); - - solveContinuity(); - - if (debug) - { - volScalarField mass(deltaRho_*magSf_); - dimensionedScalar totalMass = - fvc::domainIntegrate(mass) - + dimensionedScalar("SMALL", dimMass*dimVolume, ROOTVSMALL); - - scalar sumLocalContErr = - ( - fvc::domainIntegrate(mag(mass - magSf_*deltaRho0))/totalMass - ).value(); - - scalar globalContErr = - ( - fvc::domainIntegrate(mass - magSf_*deltaRho0)/totalMass - ).value(); - - cumulativeContErr_ += globalContErr; - - Info<< "Surface film: " << type() << nl - << " time step continuity errors: sum local = " - << sumLocalContErr << ", global = " << globalContErr - << ", cumulative = " << cumulativeContErr_ << endl; - } -} - - -void Foam::surfaceFilmModels::kinematicSingleLayer::solveContinuity() -{ - if (debug) - { - Info<< "kinematicSingleLayer::solveContinuity()" << endl; - } - - solve - ( - fvm::ddt(deltaRho_) - + fvc::div(phi_) - == - rhoSp_ - ); -} - - -void Foam::surfaceFilmModels::kinematicSingleLayer::updateSurfaceVelocities() -{ - // Push boundary film velocity values into internal field - for (label i=0; i<filmBottomPatchIDs_.size(); i++) - { - label patchI = filmBottomPatchIDs_[i]; - const polyPatch& pp = filmRegion_.boundaryMesh()[patchI]; - UIndirectList<vector>(Uw_, pp.faceCells()) = - U_.boundaryField()[patchI]; - } - Uw_ -= nHat_*(Uw_ & nHat_); - Uw_.correctBoundaryConditions(); - - // TODO: apply quadratic profile to determine surface velocity - Us_ = U_; - Us_.correctBoundaryConditions(); -} - - -Foam::tmp<Foam::fvVectorMatrix> -Foam::surfaceFilmModels::kinematicSingleLayer::tau -( - volVectorField& U -) const -{ - // Calculate shear stress - volScalarField Cs("Cs", rho_*Cf_*mag(Us_ - U)); - volScalarField Cw - ( - "Cw", - mu_/(0.3333*(delta_ + dimensionedScalar("SMALL", dimLength, SMALL))) - ); - Cw.min(1.0e+06); - - return - ( - - fvm::Sp(Cs, U) + Cs*Us_ - - fvm::Sp(Cw, U) + Cw*Uw_ - ); -} - - -Foam::tmp<Foam::fvVectorMatrix> -Foam::surfaceFilmModels::kinematicSingleLayer::solveMomentum -( - const volScalarField& pu, - const volScalarField& pp -) -{ - if (debug) - { - Info<< "kinematicSingleLayer::solveMomentum()" << endl; - } - - updateSurfaceVelocities(); - - volScalarField mLossCoeff - ( - "mLossCoeff", - (massForPrimary_ + massPhaseChangeForPrimary_)/magSf_/time_.deltaT() - ); - - // Momentum - tmp<fvVectorMatrix> tUEqn - ( - fvm::ddt(deltaRho_, U_) - + fvm::div(phi_, U_) - == - USp_ - + tau(U_) - + fvc::grad(sigma_) - + fvm::SuSp(-mLossCoeff, U_) - ); - - fvVectorMatrix& UEqn = tUEqn(); - - UEqn.relax(); - - if (momentumPredictor_) - { - solve - ( - UEqn - == - fvc::reconstruct - ( - - fvc::interpolate(delta_) - * ( - filmRegion_.magSf() - * ( - fvc::snGrad(pu, "snGrad(p)") - + fvc::snGrad(pp, "snGrad(p)")*fvc::interpolate(delta_) - + fvc::snGrad(delta_)*fvc::interpolate(pp) - ) - - (fvc::interpolate(rho_*gTan()) & filmRegion_.Sf()) - ) - ) - ); - - // Remove any patch-normal components of velocity - U_ -= nHat_*(nHat_ & U_); - U_.correctBoundaryConditions(); - } - - return tUEqn; -} - - -void Foam::surfaceFilmModels::kinematicSingleLayer::solveThickness -( - const volScalarField& pu, - const volScalarField& pp, - const fvVectorMatrix& UEqn -) -{ - if (debug) - { - Info<< "kinematicSingleLayer::solveThickness()" << endl; - } - - volScalarField rAU(1.0/UEqn.A()); - U_ = rAU*UEqn.H(); - - surfaceScalarField deltarAUf(fvc::interpolate(delta_*rAU)); - surfaceScalarField rhof(fvc::interpolate(rho_)); - - surfaceScalarField phiAdd - ( - "phiAdd", - filmRegion_.magSf() - * ( - fvc::snGrad(pu, "snGrad(p)") - + fvc::snGrad(pp, "snGrad(p)")*fvc::interpolate(delta_) - ) - - (fvc::interpolate(rho_*gTan()) & filmRegion_.Sf()) - ); - constrainFilmField(phiAdd, 0.0); - - surfaceScalarField phid - ( - "phid", - (fvc::interpolate(U_*rho_) & filmRegion_.Sf()) - - deltarAUf*phiAdd*rhof - ); - constrainFilmField(phid, 0.0); - - surfaceScalarField ddrhorAUppf - ( - fvc::interpolate(delta_)*deltarAUf*rhof*fvc::interpolate(pp) - ); -// constrainFilmField(ddrhorAUppf, 0.0); - - for (int nonOrth=0; nonOrth<=nNonOrthCorr_; nonOrth++) - { - // Film thickness equation - fvScalarMatrix deltaEqn - ( - fvm::ddt(rho_, delta_) - + fvm::div(phid, delta_) - - fvm::laplacian(ddrhorAUppf, delta_) - == - rhoSp_ - ); - - deltaEqn.solve(); - - if (nonOrth == nNonOrthCorr_) - { - phiAdd += - fvc::interpolate(pp) - * fvc::snGrad(delta_) - * filmRegion_.magSf(); - - phi_ == deltaEqn.flux(); - } - } - - // Bound film thickness by a minimum of zero - delta_.max(0.0); - - // Update U field - U_ -= fvc::reconstruct(deltarAUf*phiAdd); - - // Remove any patch-normal components of velocity - U_ -= nHat_*(nHat_ & U_); - - U_.correctBoundaryConditions(); - - // Continuity check - continuityCheck(); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::surfaceFilmModels::kinematicSingleLayer::kinematicSingleLayer -( - const word& modelType, - const fvMesh& mesh, - const dimensionedVector& g -) -: - surfaceFilmModel(modelType, mesh, g), - filmRegion_ - ( - IOobject - ( - filmRegionName_, - time_.timeName(), - time_, - IOobject::MUST_READ - ) - ), - nHat_ - ( - IOobject - ( - "nHat", - time_.timeName(), - filmRegion_, - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - filmRegion_, - dimensionedVector("zero", dimless, vector::zero), - zeroGradientFvPatchVectorField::typeName - ), - magSf_ - ( - IOobject - ( - "magSf", - time_.timeName(), - filmRegion_, - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - filmRegion_, - dimensionedScalar("zero", dimArea, 0.0), - zeroGradientFvPatchScalarField::typeName - ), - primaryPatchIDs_(0), - filmTopPatchIDs_(0), - filmBottomPatchIDs_(0), - - momentumPredictor_(solution().lookup("momentumPredictor")), - nOuterCorr_(readLabel(solution().lookup("nOuterCorr"))), - nCorr_(readLabel(solution().lookup("nCorr"))), - nNonOrthCorr_(readLabel(solution().lookup("nNonOrthCorr"))), - cumulativeContErr_(0.0), - - Cf_(readScalar(coeffs_.lookup("Cf"))), - - initialisedThermo_(false), - rho_ - ( - IOobject - ( - "rhof", - time_.timeName(), - filmRegion_, - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - filmRegion_, - dimensionedScalar("zero", dimDensity, 0.0), - zeroGradientFvPatchScalarField::typeName - ), - mu_ - ( - IOobject - ( - "muf", - time_.timeName(), - filmRegion_, - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - filmRegion_, - dimensionedScalar("zero", dimPressure*dimTime, 0.0), - zeroGradientFvPatchScalarField::typeName - ), - sigma_ - ( - IOobject - ( - "sigmaf", - time_.timeName(), - filmRegion_, - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - filmRegion_, - dimensionedScalar("zero", dimMass/sqr(dimTime), 0.0), - zeroGradientFvPatchScalarField::typeName - ), - - delta_ - ( - IOobject - ( - "deltaf", - time_.timeName(), - filmRegion_, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - filmRegion_ - ), - U_ - ( - IOobject - ( - "Uf", - time_.timeName(), - filmRegion_, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - filmRegion_ - ), - Us_ - ( - IOobject - ( - "Usf", - time_.timeName(), - filmRegion_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - U_, - zeroGradientFvPatchScalarField::typeName - ), - Uw_ - ( - IOobject - ( - "Uwf", - time_.timeName(), - filmRegion_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - U_, - zeroGradientFvPatchScalarField::typeName - ), - deltaRho_ - ( - IOobject - ( - delta_.name() + "*" + rho_.name(), - time_.timeName(), - filmRegion_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - filmRegion_, - dimensionedScalar("zero", delta_.dimensions()*rho_.dimensions(), 0.0), - zeroGradientFvPatchScalarField::typeName - ), - - phi_ - ( - IOobject - ( - "phi", - time_.timeName(), - filmRegion_, - IOobject::READ_IF_PRESENT, - IOobject::AUTO_WRITE - ), - filmRegion_, - dimLength*dimMass/dimTime - ), - - massForPrimary_ - ( - IOobject - ( - "massForPrimary", - time_.timeName(), - filmRegion_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - filmRegion_, - dimensionedScalar("zero", dimMass, 0.0), - zeroGradientFvPatchScalarField::typeName - ), - diametersForPrimary_ - ( - IOobject - ( - "diametersForPrimary", - time_.timeName(), - filmRegion_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - filmRegion_, - dimensionedScalar("zero", dimLength, -1.0), - zeroGradientFvPatchScalarField::typeName - ), - massPhaseChangeForPrimary_ - ( - IOobject - ( - "massPhaseChangeForPrimary", - time_.timeName(), - filmRegion_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - filmRegion_, - dimensionedScalar("zero", dimMass, 0.0), - zeroGradientFvPatchScalarField::typeName - ), - - USp_ - ( - IOobject - ( - "USpf", - time_.timeName(), - filmRegion_, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - filmRegion_ - ), - pSp_ - ( - IOobject - ( - "pSpf", - time_.timeName(), - filmRegion_, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - filmRegion_ - ), - rhoSp_ - ( - IOobject - ( - "rhoSpf", - time_.timeName(), - filmRegion_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - filmRegion_, - dimensionedScalar("zero", dimMass/dimTime/dimArea, 0.0), - pSp_.boundaryField().types() - ), - - USpPrimary_ - ( - IOobject - ( - USp_.name(), // must have same name as USp_ to enable mapping - time_.timeName(), - mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - mesh_, - dimensionedVector("zero", USp_.dimensions(), vector::zero) - ), - pSpPrimary_ - ( - IOobject - ( - pSp_.name(), // must have same name as pSp_ to enable mapping - time_.timeName(), - mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - mesh_, - dimensionedScalar("zero", pSp_.dimensions(), 0.0) - ), - rhoSpPrimary_ - ( - IOobject - ( - rhoSp_.name(), // must have same name as rhoSp_ to enable mapping - time_.timeName(), - mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - mesh_, - dimensionedScalar("zero", rhoSp_.dimensions(), 0.0) - ), - - UPrimary_ - ( - IOobject - ( - "U", // must have same name as U to enable mapping - time_.timeName(), - filmRegion_, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - filmRegion_ - ), - pPrimary_ - ( - IOobject - ( - "p", // must have same name as p to enable mapping - time_.timeName(), - filmRegion_, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - filmRegion_ - ), - rhoPrimary_ - ( - IOobject - ( - "rho", // must have same name as rho to enable mapping - time_.timeName(), - filmRegion_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - filmRegion_, - dimensionedScalar("zero", dimDensity, 0.0), - pPrimary_.boundaryField().types() - ), - muPrimary_ - ( - IOobject - ( - "mu", // must have same name as mu to enable mapping - time_.timeName(), - filmRegion_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - filmRegion_, - dimensionedScalar("zero", dimPressure*dimTime, 0.0), - pPrimary_.boundaryField().types() - ), - - injection_(injectionModel::New(*this, coeffs_)), - - addedMass_(0.0) -{ - initialise(); -} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::surfaceFilmModels::kinematicSingleLayer::~kinematicSingleLayer() -{} - - -// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // - -inline const Foam::fvMesh& -Foam::surfaceFilmModels::kinematicSingleLayer::film() const -{ - return filmRegion_; -} - - -const Foam::labelList& -Foam::surfaceFilmModels::kinematicSingleLayer::filmBottomPatchIDs() const -{ - return filmBottomPatchIDs_; -} - - -const Foam::labelList& -Foam::surfaceFilmModels::kinematicSingleLayer::filmTopPatchIDs() const -{ - return filmTopPatchIDs_; -} - - -const Foam::labelList& -Foam::surfaceFilmModels::kinematicSingleLayer::primaryPatchIDs() const -{ - return primaryPatchIDs_; -} - - -bool Foam::surfaceFilmModels::kinematicSingleLayer::isFilmPatch -( - const label patchI -) const -{ - if (!active_) - { - return false; - } - - forAll(primaryPatchIDs_, i) - { - if (primaryPatchIDs_[i] == patchI) - { - return true; - } - } - - return false; -} - - -void Foam::surfaceFilmModels::kinematicSingleLayer::addSources -( - const label patchI, - const label faceI, - const scalar massSource, - const vector& momentumSource, - const scalar pressureSource, - const scalar energySource -) -{ - if (debug) - { - Info<< "\nSurface film: " << type() << ": adding to film source:" << nl - << " mass = " << massSource << nl - << " momentum = " << momentumSource << nl - << " pressure = " << pressureSource << endl; - } - - rhoSpPrimary_.boundaryField()[patchI][faceI] += massSource; - USpPrimary_.boundaryField()[patchI][faceI] += momentumSource; - pSpPrimary_.boundaryField()[patchI][faceI] += pressureSource; - - addedMass_ += massSource; -} - - -void Foam::surfaceFilmModels::kinematicSingleLayer::preEvolveFilm() -{ - if (!initialisedThermo_) - { - correctThermoFields(); - - deltaRho_ == delta_*rho_; - phi_ = fvc::interpolate(deltaRho_*U_) & filmRegion_.Sf(); - initialisedThermo_ = true; - } -} - - -void Foam::surfaceFilmModels::kinematicSingleLayer::evolveFilm() -{ - transferPrimaryRegionFields(); - - updateSubmodels(); - - // Solve continuity for deltaRho_ - solveContinuity(); - - for (int oCorr=0; oCorr<nOuterCorr_; oCorr++) - { - // Explicit pressure source contribution - tmp<volScalarField> tpu = this->pu(); - - // Implicit pressure source coefficient - tmp<volScalarField> tpp = this->pp(); - - // Solve for momentum for U_ - tmp<fvVectorMatrix> UEqn = solveMomentum(tpu(), tpp()); - - // Film thickness correction loop - for (int corr=1; corr<=nCorr_; corr++) - { - // Solve thickness for delta_ - solveThickness(tpu(), tpp(), UEqn()); - } - } - - // Update deltaRho_ with new delta_ - deltaRho_ == delta_*rho_; - - // Update film wall and surface velocities - updateSurfaceVelocities(); - - // Reset source terms for next time integration - resetPrimaryRegionSourceTerms(); -} - - -const Foam::volVectorField& -Foam::surfaceFilmModels::kinematicSingleLayer::U() const -{ - return U_; -} - - -const Foam::volVectorField& -Foam::surfaceFilmModels::kinematicSingleLayer::Us() const -{ - return Us_; -} - - -const Foam::volVectorField& -Foam::surfaceFilmModels::kinematicSingleLayer::Uw() const -{ - return Uw_; -} - - -const Foam::volScalarField& -Foam::surfaceFilmModels::kinematicSingleLayer::rho() const -{ - return rho_; -} - - -const Foam::volScalarField& -Foam::surfaceFilmModels::kinematicSingleLayer::T() const -{ - FatalErrorIn - ( - "const volScalarField& kinematicSingleLayer::T() const" - ) << "T field not available for " << type() << abort(FatalError); - - return volScalarField::null(); -} - - -const Foam::volScalarField& -Foam::surfaceFilmModels::kinematicSingleLayer::Ts() const -{ - FatalErrorIn - ( - "const volScalarField& kinematicSingleLayer::Ts() const" - ) << "Ts field not available for " << type() << abort(FatalError); - - return volScalarField::null(); -} - - -const Foam::volScalarField& -Foam::surfaceFilmModels::kinematicSingleLayer::Tw() const -{ - FatalErrorIn - ( - "const volScalarField& kinematicSingleLayer::Tw() const" - ) << "Tw field not available for " << type() << abort(FatalError); - - return volScalarField::null(); -} - - -const Foam::volScalarField& -Foam::surfaceFilmModels::kinematicSingleLayer::Cp() const -{ - FatalErrorIn - ( - "const volScalarField& kinematicSingleLayer::Cp() const" - ) << "Cp field not available for " << type() << abort(FatalError); - - return volScalarField::null(); -} - - -const Foam::volScalarField& -Foam::surfaceFilmModels::kinematicSingleLayer::kappa() const -{ - FatalErrorIn - ( - "const volScalarField& kinematicSingleLayer::kappa() const" - ) << "kappa field not available for " << type() << abort(FatalError); - - return volScalarField::null(); -} - - -const Foam::volScalarField& -Foam::surfaceFilmModels::kinematicSingleLayer::massForPrimary() const -{ - return massForPrimary_; -} - - -const Foam::volScalarField& -Foam::surfaceFilmModels::kinematicSingleLayer::diametersForPrimary() const -{ - return diametersForPrimary_; -} - - -const Foam::volScalarField& -Foam::surfaceFilmModels::kinematicSingleLayer::massPhaseChangeForPrimary() -const -{ - return massPhaseChangeForPrimary_; -} - - -void Foam::surfaceFilmModels::kinematicSingleLayer::info() const -{ - Info<< "\nSurface film: " << type() << endl; - - // Output Courant number for info only - does not change time step - CourantNumber(); - - Info<< indent << "added mass = " - << returnReduce<scalar>(addedMass_, sumOp<scalar>()) << nl - << indent << "current mass = " - << gSum((deltaRho_*magSf_)()) << nl - << indent << "min/max(mag(U)) = " << min(mag(U_)).value() << ", " - << max(mag(U_)).value() << nl - << indent << "min/max(delta) = " << min(delta_).value() << ", " - << max(delta_).value() << nl; - - injection_->info(); -} - - -Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh> > -Foam::surfaceFilmModels::kinematicSingleLayer::Srho() const -{ - return tmp<DimensionedField<scalar, volMesh> > - ( - new DimensionedField<scalar, volMesh> - ( - IOobject - ( - "kinematicSingleLayer::Srho", - time_.timeName(), - mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - mesh_, - dimensionedScalar("zero", dimMass/dimVolume/dimTime, 0.0) - ) - ); -} - - -Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh> > -Foam::surfaceFilmModels::kinematicSingleLayer::Srho(const label) const -{ - return tmp<DimensionedField<scalar, volMesh> > - ( - new DimensionedField<scalar, volMesh> - ( - IOobject - ( - "kinematicSingleLayer::Srho(i)", - time_.timeName(), - mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - mesh_, - dimensionedScalar("zero", dimMass/dimVolume/dimTime, 0.0) - ) - ); -} - - -Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh> > -Foam::surfaceFilmModels::kinematicSingleLayer::Sh() const -{ - return tmp<DimensionedField<scalar, volMesh> > - ( - new DimensionedField<scalar, volMesh> - ( - IOobject - ( - "kinematicSingleLayer::Sh", - time_.timeName(), - mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - mesh_, - dimensionedScalar("zero", dimEnergy/dimVolume/dimTime, 0.0) - ) - ); -} - - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/surfaceFilmModel/kinematicSingleLayer/kinematicSingleLayer.H b/src/surfaceFilmModels/surfaceFilmModel/kinematicSingleLayer/kinematicSingleLayer.H deleted file mode 100644 index 4e33708c2581c26bdd23f276cd182c7f9a1caea4..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/surfaceFilmModel/kinematicSingleLayer/kinematicSingleLayer.H +++ /dev/null @@ -1,561 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. - \\/ 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::kinematicSingleLayer - -Description - Kinematic form of single-cell layer surface film model - -SourceFiles - kinematicSingleLayer.C - -\*---------------------------------------------------------------------------*/ - -#ifndef kinematicSingleLayer_H -#define kinematicSingleLayer_H - -#include "surfaceFilmModel.H" -#include "fvMesh.H" -#include "volFields.H" -#include "surfaceFields.H" -#include "fvMatrices.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace surfaceFilmModels -{ - -// Forward declaration of classes -class injectionModel; - -/*---------------------------------------------------------------------------*\ - Class kinematicSingleLayer Declaration -\*---------------------------------------------------------------------------*/ - -class kinematicSingleLayer -: - public surfaceFilmModel -{ -private: - - // Private member functions - - //- Disallow default bitwise copy construct - kinematicSingleLayer(const kinematicSingleLayer&); - - //- Disallow default bitwise assignment - void operator=(const kinematicSingleLayer&); - - -protected: - - // Protected data - - // Mesh databases - - //- Film region mesh database - fvMesh filmRegion_; - - //- Patch normal vectors - volVectorField nHat_; - - //- Face area magnitudes / [m2] - volScalarField magSf_; - - //- List of patch IDs on the primary region coupled with the film - // region - labelList primaryPatchIDs_; - - //- List of patch IDs on oppositte side of the film region - labelList filmTopPatchIDs_; - - //- List of patch IDs on the film region coupled with the primary - // region - labelList filmBottomPatchIDs_; - - - // Solution parameters - - //- Momentum predictor - Switch momentumPredictor_; - - //- Number of outer correctors - label nOuterCorr_; - - //- Number of PISO-like correctors - label nCorr_; - - //- Number of non-orthogonal correctors - label nNonOrthCorr_; - - //- Cumulative continuity error - scalar cumulativeContErr_; - - - // Model parameters - - //- Skin frition coefficient for film/primary region interface - scalar Cf_; - - - // Thermo properties - - // Fields - - //- Initiliased thermo flag - bool initialisedThermo_; - - //- Density / [kg/m3] - volScalarField rho_; - - //- Dynamic viscosity / [Pa.s] - volScalarField mu_; - - //- Surface tension / [m/s2] - volScalarField sigma_; - - - // Fields - - //- Film thickness / [m] - volScalarField delta_; - - //- Velocity - mean / [m/s] - volVectorField U_; - - //- Velocity - surface / [m/s] - volVectorField Us_; - - //- Velocity - wall / [m/s] - volVectorField Uw_; - - //- Film thickness*density (helper field) / [kg/m2] - volScalarField deltaRho_; - - //- Mass flux (includes film thickness) / [kg.m/s] - surfaceScalarField phi_; - - - // Transfer fields - to the primary region - - //- Film mass available for transfer - volScalarField massForPrimary_; - - //- Parcel diameters originating from film - volScalarField diametersForPrimary_; - - //- Film mass evolved via phase change - volScalarField massPhaseChangeForPrimary_; - - - // Source term fields - - // Film region - registered to the film region mesh - // Note: need boundary value mapped from primary region, and then - // pushed into the patch internal field - - //- Momementum / [kg/m/s2] - volVectorField USp_; - - //- Pressure / [Pa] - volScalarField pSp_; - - //- Mass / [kg/m2/s] - volScalarField rhoSp_; - - - // Primary region - registered to the primary region mesh - // Internal use only - not read-in - - //- Momementum / [kg/m/s2] - volVectorField USpPrimary_; - - //- Pressure / [Pa] - volScalarField pSpPrimary_; - - //- Mass / [kg/m2/s] - volScalarField rhoSpPrimary_; - - - // Fields mapped from primary region - registered to the film region - // Note: need both boundary AND patch internal fields to be mapped - - //- Velocity / [m/s] - volVectorField UPrimary_; - - //- Pressure / [Pa] - volScalarField pPrimary_; - - //- Density / [kg/m3] - volScalarField rhoPrimary_; - - //- Viscosity / [Pa.s] - volScalarField muPrimary_; - - - // Sub-models - - //- Injection - autoPtr<injectionModel> injection_; - - - // Checks - - //- Cumulative mass added via sources [kg] - scalar addedMass_; - - - // Protected member functions - - //- Initialise the film model - called on construction - void initialise(); - - //- Read control parameters from dictionary - virtual bool read(); - - //- Correct the thermo fields - virtual void correctThermoFields(); - - //- Reset source term fields - virtual void resetPrimaryRegionSourceTerms(); - - //- Transfer fields from the primary region to the film region - virtual void transferPrimaryRegionFields(); - - // Explicit pressure source contribution - virtual tmp<volScalarField> pu(); - - // Implicit pressure source coefficient - virtual tmp<volScalarField> pp(); - - //- Update the film sub-models - virtual void updateSubmodels(); - - //- Courant number evaluation - virtual scalar CourantNumber() const; - - //- Continuity check - virtual void continuityCheck(); - - //- Update film surface velocities - virtual void updateSurfaceVelocities(); - - //- Return the stress term for the momentum equation - virtual tmp<fvVectorMatrix> tau(volVectorField& dU) const; - - //- Constrain a film region master/slave boundaries of a field to a - // given value - template<class Type> - void constrainFilmField - ( - Type& field, - const typename Type::cmptType& value - ); - - - // Equations - - //- Solve continuity equation - virtual void solveContinuity(); - - //- Solve for film velocity - virtual tmp<fvVectorMatrix> solveMomentum - ( - const volScalarField& pu, - const volScalarField& pp - ); - - //- Solve coupled velocity-thickness equations - virtual void solveThickness - ( - const volScalarField& pu, - const volScalarField& pp, - const fvVectorMatrix& UEqn - ); - - -public: - - //- Runtime type information - TypeName("kinematicSingleLayer"); - - - // Constructors - - //- Construct from components - kinematicSingleLayer - ( - const word& modelType, - const fvMesh& mesh, - const dimensionedVector& g - ); - - - //- Destructor - virtual ~kinematicSingleLayer(); - - - // Member Functions - - // Access - - //- Return the film mesh database - virtual const fvMesh& film() const; - - //- Return the patch normal vectors - inline const volVectorField& nHat() const; - - //- Return the face area magnitudes / [m2] - inline const volScalarField& magSf() const; - - //- Return the list of coupled patches on the film region - virtual const labelList& filmBottomPatchIDs() const; - - //- Return the list of patches oppositte coupled patches - virtual const labelList& filmTopPatchIDs() const; - - //- Return the list of coupled patches on the primary region - virtual const labelList& primaryPatchIDs() const; - - - // Solution parameters - - //- Return the film region solution dictionary - inline const dictionary& solution() const; - - //- Return the momentum predictor - inline const Switch& momentumPredictor() const; - - //- Return the number of outer correctors - inline label nOuterCorr() const; - - //- Return the number of PISO correctors - inline label nCorr() const; - - //- Return the number of non-orthogonal correctors - inline label nNonOrthCorr() const; - - - // Model parameters - - //- Return the skin friction coefficient - inline scalar Cf() const; - - - // Thermo properties - - //- Return const access to the dynamic viscosity / [Pa.s] - inline const volScalarField& mu() const; - - //- Return const access to the surface tension / [m/s2] - inline const volScalarField& sigma() const; - - - // Fields - - //- Return const access to the film thickness / [m] - inline const volScalarField& delta() const; - - //- Return the film velocity [m/s] - virtual const volVectorField& U() const; - - //- Return the film surface velocity [m/s] - virtual const volVectorField& Us() const; - - //- Return the film wall velocity [m/s] - virtual const volVectorField& Uw() const; - - //- Return the film density [kg/m3] - virtual const volScalarField& rho() const; - - //- Return the film mean temperature [K] - virtual const volScalarField& T() const; - - //- Return the film surface temperature [K] - virtual const volScalarField& Ts() const; - - //- Return the film wall temperature [K] - virtual const volScalarField& Tw() const; - - //- Return the film specific heat capacity [J/kg/K] - virtual const volScalarField& Cp() const; - - //- Return the film thermal conductivity [W/m/K] - virtual const volScalarField& kappa() const; - - - // Transfer fields - to the primary region - - //- Return the film mass available for transfer - virtual const volScalarField& massForPrimary() const; - - //- Return the parcel diameters originating from film - virtual const volScalarField& diametersForPrimary() const; - - //- Return the film mass evolved via phase change - virtual const volScalarField& massPhaseChangeForPrimary() const; - - - // External helper functions - - //- Return true if patchI on the primary region is a coupled patch - // to the film region - virtual bool isFilmPatch(const label patchI) const; - - //- External hook to add sources to the film - virtual void addSources - ( - const label patchI, // patchI on primary region - const label faceI, // faceI of patchI - const scalar massSource, // [kg] - const vector& momentumSource, // [kg.m/s] (tang'l momentum) - const scalar pressureSource, // [kg.m/s] (normal momentum) - const scalar energySource = 0 // [J] - ); - - - // Source fields (read/write access) - - // Primary region - - //- Momementum / [kg/m/s2] - inline volVectorField& USpPrimary(); - - //- Pressure / [Pa] - inline volScalarField& pSpPrimary(); - - //- Mass / [kg/m2/s] - inline volScalarField& rhoSpPrimary(); - - - // Film region - - //- Momentum / [kg/m/s2] - inline volVectorField& USp(); - - //- Pressure / [Pa] - inline volScalarField& pSp(); - - //- Mass / [kg/m2/s] - inline volScalarField& rhoSp(); - - //- Momentum / [kg/m/s2] - inline const volVectorField& USp() const; - - //- Pressure / [Pa] - inline const volScalarField& pSp() const; - - //- Mass / [kg/m2/s] - inline const volScalarField& rhoSp() const; - - - // Fields mapped from primary region - - //- Velocity / [m/s] - inline const volVectorField& UPrimary() const; - - //- Pressure / [Pa] - inline const volScalarField& pPrimary() const; - - //- Density / [kg/m3] - inline const volScalarField& rhoPrimary() const; - - //- Viscosity / [Pa.s] - inline const volScalarField& muPrimary() const; - - - // Sub-models - - //- Injection - inline injectionModel& injection(); - - - // Helper functions - - //- Return the gravity tangential component contributions - inline tmp<volVectorField> gTan() const; - - //- Return the gravity normal-to-patch component contribution - inline tmp<volScalarField> gNorm() const; - - //- Return the gravity normal-to-patch component contribution - // Clipped so that only non-zero if g & nHat_ < 0 - inline tmp<volScalarField> gNormClipped() const; - - - // Evolution - - //- Pre-evolve film hook - virtual void preEvolveFilm(); - - //- Evolve the film equations - virtual void evolveFilm(); - - - // Source fields - - // Mapped into primary region - - //- Return total mass source - Eulerian phase only - virtual tmp<DimensionedField<scalar, volMesh> > Srho() const; - - //- Return mass source for specie i - Eulerian phase only - virtual tmp<DimensionedField<scalar, volMesh> > Srho - ( - const label i - ) const; - - //- Return enthalpy source - Eulerian phase only - virtual tmp<DimensionedField<scalar, volMesh> > Sh() const; - - - // I-O - - //- Provide some feedback - virtual void info() const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace surfaceFilmModels -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#ifdef NoRepository -# include "kinematicSingleLayerTemplates.C" -#endif - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "kinematicSingleLayerI.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/surfaceFilmModel/kinematicSingleLayer/kinematicSingleLayerI.H b/src/surfaceFilmModels/surfaceFilmModel/kinematicSingleLayer/kinematicSingleLayerI.H deleted file mode 100644 index 765cdc0d790b7c7a032e667ac99cdaa0511eda23..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/surfaceFilmModel/kinematicSingleLayer/kinematicSingleLayerI.H +++ /dev/null @@ -1,277 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. - \\/ 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 "kinematicSingleLayer.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -inline const Foam::volVectorField& -Foam::surfaceFilmModels::kinematicSingleLayer::nHat() const -{ - return nHat_; -} - - -inline const Foam::volScalarField& -Foam::surfaceFilmModels::kinematicSingleLayer::magSf() const -{ - return magSf_; -} - - -inline const Foam::dictionary& -Foam::surfaceFilmModels::kinematicSingleLayer::solution() const -{ - return filmRegion_.solutionDict().subDict("PISO"); -} - - -inline const Foam::Switch& -Foam::surfaceFilmModels::kinematicSingleLayer::momentumPredictor() const -{ - return momentumPredictor_; -} - - -inline Foam::label -Foam::surfaceFilmModels::kinematicSingleLayer::nOuterCorr() const -{ - return nOuterCorr_; -} - - -inline Foam::label Foam::surfaceFilmModels::kinematicSingleLayer::nCorr() const -{ - return nCorr_; -} - - -inline Foam::label -Foam::surfaceFilmModels::kinematicSingleLayer::nNonOrthCorr() const -{ - return nNonOrthCorr_; -} - - -inline Foam::scalar Foam::surfaceFilmModels::kinematicSingleLayer::Cf() const -{ - return Cf_; -} - - -inline const Foam::volScalarField& -Foam::surfaceFilmModels::kinematicSingleLayer::mu() const -{ - return mu_; -} - - -inline const Foam::volScalarField& -Foam::surfaceFilmModels::kinematicSingleLayer::sigma() const -{ - return sigma_; -} - - -inline const Foam::volScalarField& -Foam::surfaceFilmModels::kinematicSingleLayer::delta() const -{ - return delta_; -} - -inline Foam::volVectorField& -Foam::surfaceFilmModels::kinematicSingleLayer::USpPrimary() -{ - return USpPrimary_; -} - - -inline Foam::volScalarField& -Foam::surfaceFilmModels::kinematicSingleLayer::pSpPrimary() -{ - return pSpPrimary_; -} - - -inline Foam::volScalarField& -Foam::surfaceFilmModels::kinematicSingleLayer::rhoSpPrimary() -{ - return rhoSpPrimary_; -} - - -inline Foam::volVectorField& -Foam::surfaceFilmModels::kinematicSingleLayer::USp() -{ - return USp_; -} - - -inline Foam::volScalarField& -Foam::surfaceFilmModels::kinematicSingleLayer::pSp() -{ - return pSp_; -} - - -inline Foam::volScalarField& -Foam::surfaceFilmModels::kinematicSingleLayer::rhoSp() -{ - return rhoSp_; -} - - -inline const Foam::volVectorField& -Foam::surfaceFilmModels::kinematicSingleLayer::USp() const -{ - return USp_; -} - - -inline const Foam::volScalarField& -Foam::surfaceFilmModels::kinematicSingleLayer::pSp() const -{ - return pSp_; -} - - -inline const Foam::volScalarField& -Foam::surfaceFilmModels::kinematicSingleLayer::rhoSp() const -{ - return rhoSp_; -} - - -inline const Foam::volVectorField& -Foam::surfaceFilmModels::kinematicSingleLayer::UPrimary() const -{ - return UPrimary_; -} - - -inline const Foam::volScalarField& -Foam::surfaceFilmModels::kinematicSingleLayer::pPrimary() const -{ - return pPrimary_; -} - - -inline const Foam::volScalarField& -Foam::surfaceFilmModels::kinematicSingleLayer::rhoPrimary() const -{ - return rhoPrimary_; -} - - -inline const Foam::volScalarField& -Foam::surfaceFilmModels::kinematicSingleLayer::muPrimary() const -{ - return muPrimary_; -} - - -inline Foam::surfaceFilmModels::injectionModel& -Foam::surfaceFilmModels::kinematicSingleLayer::injection() -{ - return injection_(); -} - - -inline Foam::tmp<Foam::volScalarField> -Foam::surfaceFilmModels::kinematicSingleLayer::gNorm() const -{ - tmp<volScalarField> tgNorm - ( - new volScalarField - ( - IOobject - ( - "gNorm", - filmRegion_.time().timeName(), - filmRegion_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - g_ & nHat_, - zeroGradientFvPatchScalarField::typeName - ) - ); - - return tgNorm; -} - - -inline Foam::tmp<Foam::volScalarField> -Foam::surfaceFilmModels::kinematicSingleLayer::gNormClipped() const -{ - tmp<volScalarField> tgNormClipped - ( - new volScalarField - ( - IOobject - ( - "gNormClipped", - filmRegion_.time().timeName(), - filmRegion_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - g_ & nHat_, - zeroGradientFvPatchScalarField::typeName - ) - ); - - volScalarField& gNormClipped = tgNormClipped(); - gNormClipped.min(0.0); - - return tgNormClipped; -} - - -inline Foam::tmp<Foam::volVectorField> -Foam::surfaceFilmModels::kinematicSingleLayer::gTan() const -{ - tmp<volVectorField> tgTan - ( - new volVectorField - ( - IOobject - ( - "gTan", - filmRegion_.time().timeName(), - filmRegion_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - g_ - nHat_*gNorm(), - zeroGradientFvPatchVectorField::typeName - ) - ); - - return tgTan; -} - - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/surfaceFilmModel/kinematicSingleLayer/kinematicSingleLayerTemplates.C b/src/surfaceFilmModels/surfaceFilmModel/kinematicSingleLayer/kinematicSingleLayerTemplates.C deleted file mode 100644 index de8a93b2708f59b6f70b955f581451f47810bdc7..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/surfaceFilmModel/kinematicSingleLayer/kinematicSingleLayerTemplates.C +++ /dev/null @@ -1,62 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. - \\/ 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 "kinematicSingleLayer.H" - -// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // - -template<class Type> -void Foam::surfaceFilmModels::kinematicSingleLayer::constrainFilmField -( - Type& field, - const typename Type::cmptType& value -) -{ - forAll(filmBottomPatchIDs_, i) - { - label patchI = filmBottomPatchIDs_[i]; - field.boundaryField()[patchI] = value; - if (debug) - { - Info<< "Constraining " << field.name() - << " boundary " << field.boundaryField()[patchI].patch().name() - << " to " << value << endl; - } - } - forAll(filmTopPatchIDs_, i) - { - label patchI = filmTopPatchIDs_[i]; - field.boundaryField()[patchI] = value; - if (debug) - { - Info<< "Constraining " << field.name() - << " boundary " << field.boundaryField()[patchI].patch().name() - << " to " << value << endl; - } - } -} - - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/surfaceFilmModel/noFilm/noFilm.C b/src/surfaceFilmModels/surfaceFilmModel/noFilm/noFilm.C deleted file mode 100644 index 63ea47880d65439b57aee75ca12a946bdfb5d87f..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/surfaceFilmModel/noFilm/noFilm.C +++ /dev/null @@ -1,338 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. - \\/ 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 "noFilm.H" -#include "addToRunTimeSelectionTable.H" -#include "volFields.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - namespace surfaceFilmModels - { - defineTypeNameAndDebug(noFilm, 0); - addToRunTimeSelectionTable(surfaceFilmModel, noFilm, mesh); - } -} - - -// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // - -bool Foam::surfaceFilmModels::noFilm::read() -{ - if (surfaceFilmModel::read()) - { - // no additional info to read - return true; - } - else - { - return false; - } -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::surfaceFilmModels::noFilm::noFilm -( - const word& modelType, - const fvMesh& mesh, - const dimensionedVector& g -) -: - surfaceFilmModel(modelType, mesh, g) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::surfaceFilmModels::noFilm::~noFilm() -{} - - -// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // - -void Foam::surfaceFilmModels::noFilm::preEvolveFilm() -{ - // do nothing -} - - -void Foam::surfaceFilmModels::noFilm::evolveFilm() -{ - // do nothing -} - - -const Foam::fvMesh& Foam::surfaceFilmModels::noFilm::film() const -{ - FatalErrorIn("const fvMesh& noFilm::film() const") - << "Cannot return film for noFilm model" << abort(FatalError); - - return mesh(); -} - - -const Foam::labelList& -Foam::surfaceFilmModels::noFilm::filmBottomPatchIDs() const -{ - return labelList::null(); -} - - -const Foam::labelList& Foam::surfaceFilmModels::noFilm::filmTopPatchIDs() const -{ - return labelList::null(); -} - - -const Foam::labelList& Foam::surfaceFilmModels::noFilm::primaryPatchIDs() const -{ - return labelList::null(); -} - - -bool Foam::surfaceFilmModels::noFilm::isFilmPatch(const label) const -{ - return false; -} - - -void Foam::surfaceFilmModels::noFilm::addSources -( - const label, - const label, - const scalar, - const vector&, - const scalar, - const scalar -) -{ - // do nothing -} - - -const Foam::volScalarField& Foam::surfaceFilmModels::noFilm::delta() const -{ - FatalErrorIn("const volScalarField& noFilm::delta() const") - << "delta field not available for " << type() << abort(FatalError); - - return volScalarField::null(); -} - -const Foam::volVectorField& Foam::surfaceFilmModels::noFilm::U() const -{ - FatalErrorIn("const volVectorField& noFilm::U() const") - << "U field not available for " << type() << abort(FatalError); - - return volVectorField::null(); -} - - -const Foam::volVectorField& Foam::surfaceFilmModels::noFilm::Us() const -{ - FatalErrorIn("const volVectorField& noFilm::Us() const") - << "Us field not available for " << type() << abort(FatalError); - - return volVectorField::null(); -} - - -const Foam::volVectorField& Foam::surfaceFilmModels::noFilm::Uw() const -{ - FatalErrorIn("const volVectorField& noFilm::Uw() const") - << "Uw field not available for " << type() << abort(FatalError); - - return volVectorField::null(); -} - - -const Foam::volScalarField& Foam::surfaceFilmModels::noFilm::rho() const -{ - FatalErrorIn("const volScalarField& noFilm::rho() const") - << "rho field not available for " << type() << abort(FatalError); - - return volScalarField::null(); -} - - -const Foam::volScalarField& Foam::surfaceFilmModels::noFilm::T() const -{ - FatalErrorIn("const Foam::volScalarField& Foam::noFilm::T() const") - << "T field not available for " << type() << abort(FatalError); - - return volScalarField::null(); -} - - -const Foam::volScalarField& Foam::surfaceFilmModels::noFilm::Ts() const -{ - FatalErrorIn("const Foam::volScalarField& Foam::noFilm::Ts() const") - << "Ts field not available for " << type() << abort(FatalError); - - return volScalarField::null(); -} - - -const Foam::volScalarField& Foam::surfaceFilmModels::noFilm::Tw() const -{ - FatalErrorIn("const Foam::volScalarField& Foam::noFilm::Tw() const") - << "Tw field not available for " << type() << abort(FatalError); - - return volScalarField::null(); -} - - -const Foam::volScalarField& Foam::surfaceFilmModels::noFilm::Cp() const -{ - FatalErrorIn("const volScalarField& noFilm::Cp() const") - << "Cp field not available for " << type() << abort(FatalError); - - return volScalarField::null(); -} - - -const Foam::volScalarField& Foam::surfaceFilmModels::noFilm::kappa() const -{ - FatalErrorIn("const volScalarField& noFilm::kappa() const") - << "kappa field not available for " << type() << abort(FatalError); - - return volScalarField::null(); -} - - -const Foam::volScalarField& -Foam::surfaceFilmModels::noFilm::massForPrimary() const -{ - FatalErrorIn("const volScalarField& noFilm::massForPrimary() const") - << "massForPrimary field not available for " << type() - << abort(FatalError); - - return volScalarField::null(); -} - - -const Foam::volScalarField& -Foam::surfaceFilmModels::noFilm::diametersForPrimary() const -{ - FatalErrorIn("const volScalarField& noFilm::diametersForPrimary() const") - << "diametersForPrimary field not available for " << type() - << abort(FatalError); - - return volScalarField::null(); -} - - -const Foam::volScalarField& -Foam::surfaceFilmModels::noFilm::massPhaseChangeForPrimary() const -{ - FatalErrorIn - ( - "const volScalarField& noFilm::massPhaseChangeForPrimary() const" - ) << "massPhaseChange field not available for " << type() - << abort(FatalError); - - return volScalarField::null(); -} - - -Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh> > -Foam::surfaceFilmModels::noFilm::Srho() const -{ - return tmp<DimensionedField<scalar, volMesh> > - ( - new DimensionedField<scalar, volMesh> - ( - IOobject - ( - "noFilm::Srho", - time_.timeName(), - mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - mesh_, - dimensionedScalar("zero", dimMass/dimVolume/dimTime, 0.0) - ) - ); -} - - -Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh> > -Foam::surfaceFilmModels::noFilm::Srho(const label) const -{ - return tmp<DimensionedField<scalar, volMesh> > - ( - new DimensionedField<scalar, volMesh> - ( - IOobject - ( - "kinematicSingleLayer::Srho(i)", - time_.timeName(), - mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - mesh_, - dimensionedScalar("zero", dimMass/dimVolume/dimTime, 0.0) - ) - ); -} - - -Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh> > -Foam::surfaceFilmModels::noFilm::Sh() const -{ - return tmp<DimensionedField<scalar, volMesh> > - ( - new DimensionedField<scalar, volMesh> - ( - IOobject - ( - "kinematicSingleLayer::Sh", - time_.timeName(), - mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - mesh_, - dimensionedScalar("zero", dimEnergy/dimVolume/dimTime, 0.0) - ) - ); -} - - -void Foam::surfaceFilmModels::noFilm::info() const -{ - // do nothing -} - - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/surfaceFilmModel/noFilm/noFilm.H b/src/surfaceFilmModels/surfaceFilmModel/noFilm/noFilm.H deleted file mode 100644 index 40726066ac0be26b29bb344c097e0427eb41236e..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/surfaceFilmModel/noFilm/noFilm.H +++ /dev/null @@ -1,214 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. - \\/ 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::noFilm - -Description - Dummy surface film model for 'none' - -SourceFiles - noFilm.C - -\*---------------------------------------------------------------------------*/ - -#ifndef noFilm_H -#define noFilm_H - -#include "surfaceFilmModel.H" -#include "volFieldsFwd.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace surfaceFilmModels -{ - -/*---------------------------------------------------------------------------*\ - Class noFilm Declaration -\*---------------------------------------------------------------------------*/ - -class noFilm -: - public surfaceFilmModel -{ -private: - - // Private member functions - - //- Disallow default bitwise copy construct - noFilm(const noFilm&); - - //- Disallow default bitwise assignment - void operator=(const noFilm&); - - -protected: - - // Protected member functions - - //- Read control parameters from dictionary - virtual bool read(); - - -public: - - //- Runtime type information - TypeName("none"); - - - // Constructors - - //- Construct from components - noFilm - ( - const word& modelType, - const fvMesh& mesh, - const dimensionedVector& g - ); - - - //- Destructor - virtual ~noFilm(); - - - // Member Functions - - // Access - - //- Return the film mesh database - virtual const fvMesh& film() const; - - //- Return the list of coupled patches on the film region - virtual const labelList& filmBottomPatchIDs() const; - - //- Return the list of patches oppositte coupled patches - virtual const labelList& filmTopPatchIDs() const; - - //- Return the list of coupled patches on the primary region - virtual const labelList& primaryPatchIDs() const; - - //- Return true if patchI is a coupled patch to the film region - virtual bool isFilmPatch(const label patchI) const; - - //- External hook to add sources to the film - virtual void addSources - ( - const label patchI, - const label faceI, - const scalar massSource, - const vector& momentumSource, - const scalar pressureSource, - const scalar energySource - ); - - - // Fields - - //- Return the film thickness [m] - virtual const volScalarField& delta() const; - - //- Return the film velocity [m/s] - virtual const volVectorField& U() const; - - //- Return the film density [kg/m3] - virtual const volScalarField& rho() const; - - //- Return the film surface velocity [m/s] - virtual const volVectorField& Us() const; - - //- Return the film wall velocity [m/s] - virtual const volVectorField& Uw() const; - - //- Return the film mean temperature [K] - virtual const volScalarField& T() const; - - //- Return the film surface temperature [K] - virtual const volScalarField& Ts() const; - - //- Return the film wall temperature [K] - virtual const volScalarField& Tw() const; - - //- Return the film specific heat capacity [J/kg/K] - virtual const volScalarField& Cp() const; - - //- Return the film thermal conductivity [W/m/K] - virtual const volScalarField& kappa() const; - - - // Transfer fields - to the primary region - - //- Return the film mass available for transfer - virtual const volScalarField& massForPrimary() const; - - //- Return the parcel diameters originating from film - virtual const volScalarField& diametersForPrimary() const; - - //- Return the film mass evolved via phase change - virtual const volScalarField& massPhaseChangeForPrimary() const; - - - // Evolution - - //- Pre-evolve film hook - virtual void preEvolveFilm(); - - //- Evolve the film equations - virtual void evolveFilm(); - - - // Source fields - - // Mapped into primary region - - //- Return total mass source - Eulerian phase only - virtual tmp<DimensionedField<scalar, volMesh> > Srho() const; - - //- Return mass source for specie i - Eulerian phase only - virtual tmp<DimensionedField<scalar, volMesh> > Srho - ( - const label i - ) const; - - //- Return enthalpy source - Eulerian phase only - virtual tmp<DimensionedField<scalar, volMesh> > Sh() const; - - - // I-O - - //- Provide some feedback - virtual void info() const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace surfaceFilmModels -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/surfaceFilmModel/surfaceFilmModel/surfaceFilmModel.C b/src/surfaceFilmModels/surfaceFilmModel/surfaceFilmModel/surfaceFilmModel.C deleted file mode 100644 index 65e97c62dc77f152e0218913f46bf96a62ed60a6..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/surfaceFilmModel/surfaceFilmModel/surfaceFilmModel.C +++ /dev/null @@ -1,233 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. - \\/ 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 "surfaceFilmModel.H" -#include "volMesh.H" -#include "fvMesh.H" -#include "Time.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - namespace surfaceFilmModels - { - defineTypeNameAndDebug(surfaceFilmModel, 0); - defineRunTimeSelectionTable(surfaceFilmModel, mesh); - } - - template<> - const char* Foam::NamedEnum - < - Foam::surfaceFilmModels::surfaceFilmModel::thermoModelType, - 2 - >::names[] = - { - "constant", - "singleComponent" - }; - -} - -const -Foam::NamedEnum<Foam::surfaceFilmModels::surfaceFilmModel::thermoModelType, 2> - Foam::surfaceFilmModels::surfaceFilmModel::thermoModelTypeNames_; - - -// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // - -bool Foam::surfaceFilmModels::surfaceFilmModel::read() -{ - if (regIOobject::read()) - { - active_.readIfPresent("active", *this); - if (const dictionary* dictPtr = subDictPtr(type() + "Coeffs")) - { - coeffs_ <<= *dictPtr; - } - - return true; - } - else - { - return false; - } -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::surfaceFilmModels::surfaceFilmModel::surfaceFilmModel -( - const fvMesh& mesh, - const dimensionedVector& g -) -: - IOdictionary - ( - IOobject - ( - "surfaceFilmProperties", - mesh.time().constant(), - mesh, - IOobject::MUST_READ_IF_MODIFIED, - IOobject::NO_WRITE - ) - ), - mesh_(mesh), - time_(mesh.time()), - active_(false), - g_(g), - filmRegionName_("none"), - coeffs_(dictionary::null), - thermoModel_(tmConstant) -{} - - -Foam::surfaceFilmModels::surfaceFilmModel::surfaceFilmModel -( - const word& type, - const fvMesh& mesh, - const dimensionedVector& g -) -: - IOdictionary - ( - IOobject - ( - "surfaceFilmProperties", - mesh.time().constant(), - mesh, - IOobject::MUST_READ_IF_MODIFIED, - IOobject::NO_WRITE - ) - ), - mesh_(mesh), - time_(mesh.time()), - - active_(lookup("active")), - g_(g), - filmRegionName_("none"), - coeffs_(dictionary::null), - thermoModel_(tmConstant) -{ - if (active_) - { - lookup("filmRegionName") >> filmRegionName_; - coeffs_ = subDict(type + "Coeffs"); - thermoModel_ = - thermoModelTypeNames_.read(coeffs_.lookup("thermoModel")); - } -} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::surfaceFilmModels::surfaceFilmModel::~surfaceFilmModel() -{} - - -// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // - -const Foam::fvMesh& Foam::surfaceFilmModels::surfaceFilmModel::mesh() const -{ - return mesh_; -} - - -const Foam::Time& Foam::surfaceFilmModels::surfaceFilmModel::time() const -{ - return time_; -} - - -void Foam::surfaceFilmModels::surfaceFilmModel::evolve() -{ - if (active_) - { - if (mesh_.changing()) - { - FatalErrorIn("surfaceFilmModel::evolveFilm()") - << "Currently not possible to apply surface film model to " - << "moving mesh cases" << nl << abort(FatalError); - } - - Info<< "\nEvolving surface film for region " << filmRegionName_ - << endl; - - // Update any input information - read(); - - // Pre-evolve - preEvolveFilm(); - - // Increment the film equations up to the new time level - evolveFilm(); - - // Provide some feedback - Info<< incrIndent; - info(); - Info<< endl << decrIndent; - } -} - - -Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh> > -Foam::surfaceFilmModels::surfaceFilmModel::Srho() const -{ - notImplemented - ( - "Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh> > " - "Foam::surfaceFilmModels::surfaceFilmModel::Srho() const" - ) - return tmp<DimensionedField<scalar, volMesh> >(NULL); -} - - -Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh> > -Foam::surfaceFilmModels::surfaceFilmModel::Srho(const label) const -{ - notImplemented - ( - "Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh> > " - "Foam::surfaceFilmModels::surfaceFilmModel::Srho(const label) const" - ) - return tmp<DimensionedField<scalar, volMesh> >(NULL); -} - - -Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh> > -Foam::surfaceFilmModels::surfaceFilmModel::Sh() const -{ - notImplemented - ( - "Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh> > " - "Foam::surfaceFilmModels::surfaceFilmModel::Sh() const" - ) - return tmp<DimensionedField<scalar, volMesh> >(NULL); -} - - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/surfaceFilmModel/surfaceFilmModel/surfaceFilmModel.H b/src/surfaceFilmModels/surfaceFilmModel/surfaceFilmModel/surfaceFilmModel.H deleted file mode 100644 index 079f538c833d24d4b9ae20930437a4a3a071ca3f..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/surfaceFilmModel/surfaceFilmModel/surfaceFilmModel.H +++ /dev/null @@ -1,316 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. - \\/ 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::surfaceFilmModel - -Description - Top level class that provides surface film modelling functionality - -SourceFiles - surfaceFilmModelI.H - surfaceFilmModel.C - -\*---------------------------------------------------------------------------*/ - -#ifndef surfaceFilmModel_H -#define surfaceFilmModel_H - -#include "IOdictionary.H" -#include "Switch.H" -#include "dimensionedVector.H" -#include "runTimeSelectionTables.H" -#include "volFieldsFwd.H" -#include "DimensionedField.H" -#include "labelList.H" -#include "NamedEnum.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// Forward declaration of classes -class fvMesh; -class Time; - -namespace surfaceFilmModels -{ - -/*---------------------------------------------------------------------------*\ - Class surfaceFilmModel Declaration -\*---------------------------------------------------------------------------*/ - -class surfaceFilmModel -: - public IOdictionary -{ -public: - - // Data types - - //- Enumeration listing the possible thermo types - enum thermoModelType - { - tmConstant, - tmSingleComponent - }; - - //- Named enumeration for the thermoType - static const NamedEnum<thermoModelType, 2> thermoModelTypeNames_; - - -private: - - // Private Member Functions - - //- Disallow default bitwise copy construct - surfaceFilmModel(const surfaceFilmModel&); - - //- Disallow default bitwise assignment - void operator=(const surfaceFilmModel&); - - -protected: - - // Protected data - - //- Reference to the mesh database - const fvMesh& mesh_; - - //- Reference to the time database - const Time& time_; - - //- Active flag - Switch active_; - - //- Acceleration due to gravity [m/s2] - const dimensionedVector& g_; - - //- Name of film region - word filmRegionName_; - - //- Model coefficients dictionary - dictionary coeffs_; - - //- Thermo type - thermoModelType thermoModel_; - - - // Protected member functions - - //- Read control parameters from dictionary - virtual bool read(); - - -public: - - //- Runtime type information - TypeName("surfaceFilmModel"); - - - // Declare runtime constructor selection table - - declareRunTimeSelectionTable - ( - autoPtr, - surfaceFilmModel, - mesh, - ( - const word& type, - const fvMesh& mesh, - const dimensionedVector& g - ), - (type, mesh, g) - ); - - // Constructors - - //- Construct null - surfaceFilmModel(const fvMesh& mesh, const dimensionedVector& g); - - //- Construct from type name and fvMesh - surfaceFilmModel - ( - const word& type, - const fvMesh& mesh, - const dimensionedVector& g - ); - - - // Selectors - - //- Return a reference to the selected surface film model - static autoPtr<surfaceFilmModel> New - ( - const fvMesh& mesh, - const dimensionedVector& g - ); - - - //- Destructor - virtual ~surfaceFilmModel(); - - - // Member Functions - - // Access - - //- Return the reference to the primary mesh database - const fvMesh& mesh() const; - - //- Return the reference to the time database - const Time& time() const; - - //- Return the active flag - inline const Switch& active() const; - - //- Return the model coefficients dictionary - inline const dictionary& coeffs() const; - - //- Return the thermo type - inline const thermoModelType& thermoModel() const; - - //- Return the film mesh database - virtual const fvMesh& film() const = 0; - - //- Return the list of coupled patches on the film region - virtual const labelList& filmBottomPatchIDs() const = 0; - - //- Return the list of patches oppositte coupled patches - virtual const labelList& filmTopPatchIDs() const = 0; - - //- Return the list of coupled patches on the primary region - virtual const labelList& primaryPatchIDs() const = 0; - - //- Return true if primary patchI is coupled to the film region - virtual bool isFilmPatch(const label patchI) const = 0; - - //- External hook to add sources to the film - virtual void addSources - ( - const label patchI, - const label faceI, - const scalar massSource, - const vector& momentumSource, - const scalar pressureSource, - const scalar energySource - ) = 0; - - - // Fields - - //- Return the film thickness [m] - virtual const volScalarField& delta() const = 0; - - //- Return the film velocity [m/s] - virtual const volVectorField& U() const = 0; - - //- Return the film surface velocity [m/s] - virtual const volVectorField& Us() const = 0; - - //- Return the film wall velocity [m/s] - virtual const volVectorField& Uw() const = 0; - - //- Return the film density [kg/m3] - virtual const volScalarField& rho() const = 0; - - //- Return the film mean temperature [K] - virtual const volScalarField& T() const = 0; - - //- Return the film surface temperature [K] - virtual const volScalarField& Ts() const = 0; - - //- Return the film wall temperature [K] - virtual const volScalarField& Tw() const = 0; - - //- Return the film specific heat capacity [J/kg/K] - virtual const volScalarField& Cp() const = 0; - - //- Return the film thermal conductivity [W/m/K] - virtual const volScalarField& kappa() const = 0; - - - // Transfer fields - to the primary region - - //- Return the film mass available for transfer - virtual const volScalarField& massForPrimary() const = 0; - - //- Return the parcel diameters originating from film - virtual const volScalarField& diametersForPrimary() const = 0; - - //- Return the film mass evolved via phase change - virtual const volScalarField& massPhaseChangeForPrimary() - const = 0; - - - // Evolution - - //- Evolve the film - virtual void evolve(); - - //- Pre-evolve film hook - virtual void preEvolveFilm() = 0; - - //- Evolve the film - virtual void evolveFilm() = 0; - - - // Source fields - - // Mapped into primary region - - //- Return total mass source - Eulerian phase only - virtual tmp<DimensionedField<scalar, volMesh> > Srho() const; - - //- Return mass source for specie i - Eulerian phase only - virtual tmp<DimensionedField<scalar, volMesh> > Srho - ( - const label i - ) const; - - //- Return enthalpy source - Eulerian phase only - virtual tmp<DimensionedField<scalar, volMesh> > Sh() const; - - - // I-O - - //- Provide some feedback - virtual void info() const = 0; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace surfaceFilmModels -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "surfaceFilmModelI.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/surfaceFilmModel/surfaceFilmModel/surfaceFilmModelI.H b/src/surfaceFilmModels/surfaceFilmModel/surfaceFilmModel/surfaceFilmModelI.H deleted file mode 100644 index 0585867dc01d0c56ca7e1d76580509a7321aeb28..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/surfaceFilmModel/surfaceFilmModel/surfaceFilmModelI.H +++ /dev/null @@ -1,51 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. - \\/ 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 "surfaceFilmModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -inline const Foam::Switch& -Foam::surfaceFilmModels::surfaceFilmModel::active() const -{ - return active_; -} - - -inline const Foam::dictionary& -Foam::surfaceFilmModels::surfaceFilmModel::coeffs() const -{ - return coeffs_; -} - - -inline const Foam::surfaceFilmModels::surfaceFilmModel::thermoModelType& -Foam::surfaceFilmModels::surfaceFilmModel::thermoModel() const -{ - return thermoModel_; -} - - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/surfaceFilmModel/surfaceFilmModel/surfaceFilmModelNew.C b/src/surfaceFilmModels/surfaceFilmModel/surfaceFilmModel/surfaceFilmModelNew.C deleted file mode 100644 index c04aee0727241f013df7b51df6d23d5a00e4e652..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/surfaceFilmModel/surfaceFilmModel/surfaceFilmModelNew.C +++ /dev/null @@ -1,78 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. - \\/ 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 "surfaceFilmModel.H" -#include "fvMesh.H" -#include "Time.H" - -// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // - -Foam::autoPtr<Foam::surfaceFilmModels::surfaceFilmModel> -Foam::surfaceFilmModels::surfaceFilmModel::New -( - const fvMesh& mesh, - const dimensionedVector& g -) -{ - word modelType; - - { - IOdictionary surfaceFilmPropertiesDict - ( - IOobject - ( - "surfaceFilmProperties", - mesh.time().constant(), - mesh, - IOobject::MUST_READ_IF_MODIFIED, - IOobject::NO_WRITE, - false - ) - ); - - surfaceFilmPropertiesDict.lookup("surfaceFilmModel") >> modelType; - } - - Info<< "Selecting surfaceFilmModel " << modelType << endl; - - meshConstructorTable::iterator cstrIter = - meshConstructorTablePtr_->find(modelType); - - if (cstrIter == meshConstructorTablePtr_->end()) - { - FatalErrorIn - ( - "surfaceFilmModel::New(const fvMesh&, const dimensionedVector&)" - ) << "Unknown surfaceFilmModel type " << modelType - << nl << nl << "Valid surfaceFilmModel types are:" << nl - << meshConstructorTablePtr_->toc() - << exit(FatalError); - } - - return autoPtr<surfaceFilmModel>(cstrIter()(modelType, mesh, g)); -} - - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/surfaceFilmModel/thermoSingleLayer/thermoSingleLayer.C b/src/surfaceFilmModels/surfaceFilmModel/thermoSingleLayer/thermoSingleLayer.C deleted file mode 100644 index 1723c09f711ba96227ad2697675eb9f5de3572c9..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/surfaceFilmModel/thermoSingleLayer/thermoSingleLayer.C +++ /dev/null @@ -1,762 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. - \\/ 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 "thermoSingleLayer.H" -#include "fvcDiv.H" -#include "fvcLaplacian.H" -#include "fvm.H" -#include "addToRunTimeSelectionTable.H" -#include "zeroGradientFvPatchFields.H" -#include "directMappedWallPolyPatch.H" -#include "specie.H" - -// Sub-models -#include "heatTransferModel.H" -#include "phaseChangeModel.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - namespace surfaceFilmModels - { - defineTypeNameAndDebug(thermoSingleLayer, 0); - addToRunTimeSelectionTable(surfaceFilmModel, thermoSingleLayer, mesh); - } -} - - -// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // - -bool Foam::surfaceFilmModels::thermoSingleLayer::read() -{ - // no additional properties to read - return kinematicSingleLayer::read(); -} - - -void Foam::surfaceFilmModels::thermoSingleLayer::resetPrimaryRegionSourceTerms() -{ - kinematicSingleLayer::resetPrimaryRegionSourceTerms(); - - hsSpPrimary_ == dimensionedScalar("zero", hsSp_.dimensions(), 0.0); -} - - -void Foam::surfaceFilmModels::thermoSingleLayer::correctThermoFields() -{ - switch (thermoModel_) - { - case tmConstant: - { - rho_ == dimensionedScalar(coeffs_.lookup("rho0")); - mu_ == dimensionedScalar(coeffs_.lookup("mu0")); - sigma_ == dimensionedScalar(coeffs_.lookup("sigma0")); - Cp_ == dimensionedScalar(coeffs_.lookup("Cp0")); - kappa_ == dimensionedScalar(coeffs_.lookup("kappa0")); - - break; - } - case tmSingleComponent: - { - const liquid& liq = thermo_.liquids().properties()[liquidId_]; - forAll(rho_, cellI) - { - const scalar T = T_[cellI]; - const scalar p = pPrimary_[cellI]; - rho_[cellI] = liq.rho(p, T); - mu_[cellI] = liq.mu(p, T); - sigma_[cellI] = liq.sigma(p, T); - Cp_[cellI] = liq.Cp(p, T); - kappa_[cellI] = liq.K(p, T); - } - - rho_.correctBoundaryConditions(); - mu_.correctBoundaryConditions(); - sigma_.correctBoundaryConditions(); - Cp_.correctBoundaryConditions(); - kappa_.correctBoundaryConditions(); - - break; - } - default: - { - FatalErrorIn - ( - "void Foam::surfaceFilmModels::thermoSingleLayer::" - "correctThermoFields()" - ) << "Unknown thermoType enumeration" << abort(FatalError); - } - } -} - - -void Foam::surfaceFilmModels::thermoSingleLayer::updateSurfaceTemperatures() -{ - // Push boundary film temperature values into internal field - for (label i=0; i<filmBottomPatchIDs_.size(); i++) - { - label patchI = filmBottomPatchIDs_[i]; - const polyPatch& pp = filmRegion_.boundaryMesh()[patchI]; - UIndirectList<scalar>(Tw_, pp.faceCells()) = - T_.boundaryField()[patchI]; - } - Tw_.correctBoundaryConditions(); - - // Update film surface temperature - Ts_ = T_; - Ts_.correctBoundaryConditions(); -} - - -void Foam::surfaceFilmModels::thermoSingleLayer::transferPrimaryRegionFields() -{ - kinematicSingleLayer::transferPrimaryRegionFields(); - - // Update primary region fileds via direct mapped (coupled) - // boundary conditions - TPrimary_.correctBoundaryConditions(); - forAll(YPrimary_, i) - { - YPrimary_[i].correctBoundaryConditions(); - } - - // Retrieve the source fields from the primary region via direct mapped - // (coupled) boundary conditions - // - fields require transfer of values for both patch AND to push the - // values into the first layer of internal cells - hsSp_.correctBoundaryConditions(); - - // Convert accummulated source terms into per unit area per unit time - // Note: boundary values will still have original (neat) values - const scalar deltaT = time_.deltaTValue(); - hsSp_.field() /= magSf_*deltaT; -} - - -void Foam::surfaceFilmModels::thermoSingleLayer::updateSubmodels() -{ - // Update heat transfer coefficient sub-models - htcs_->correct(); - htcw_->correct(); - - // Update phase change - phaseChange_->correct - ( - time_.deltaTValue(), - massPhaseChangeForPrimary_, - energyPhaseChangeForPrimary_ - ); - massPhaseChangeForPrimary_.correctBoundaryConditions(); - - // Update kinematic sub-models - kinematicSingleLayer::updateSubmodels(); - - // Update source fields - hsSp_ -= energyPhaseChangeForPrimary_/magSf_/time_.deltaT(); -} - - -Foam::tmp<Foam::fvScalarMatrix> Foam::surfaceFilmModels::thermoSingleLayer::q -( - volScalarField& hs -) const -{ - const dimensionedScalar Tstd("Tstd", dimTemperature, specie::Tstd); - - return - ( - - fvm::Sp(htcs_->h()/Cp_, hs) - htcs_->h()*(Tstd - TPrimary_) - - fvm::Sp(htcw_->h()/Cp_, hs) - htcw_->h()*(Tstd - Tw_) - ); -} - - -void Foam::surfaceFilmModels::thermoSingleLayer::solveEnergy() -{ - if (debug) - { - Info<< "thermoSingleLayer::solveEnergy()" << endl; - } - - updateSurfaceTemperatures(); - - volScalarField mLossCoeff - ( - "mLossCoeff", - massForPrimary_/magSf_/time_.deltaT() - ); - -// dimensionedScalar hs0("SMALL", hs_.dimensions(), SMALL); - - solve - ( - fvm::ddt(deltaRho_, hs_) - + fvm::div(phi_, hs_) - == -// fvm::Sp(hsSp_/(hs_ + hs0), hs_) - hsSp_ - + q(hs_) - - fvm::Sp(mLossCoeff, hs_) - ); - - correctThermoFields(); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::surfaceFilmModels::thermoSingleLayer::thermoSingleLayer -( - const word& modelType, - const fvMesh& mesh, - const dimensionedVector& g -) -: - kinematicSingleLayer(modelType, mesh, g), - thermo_(mesh.lookupObject<SLGThermo>("SLGThermo")), - liquidId_(thermo_.liquidId(coeffs_.lookup("liquid"))), - Cp_ - ( - IOobject - ( - "Cp", - time_.timeName(), - filmRegion_, - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - filmRegion_, - dimensionedScalar("Cp", dimEnergy/dimMass/dimTemperature, 0.0), - zeroGradientFvPatchScalarField::typeName - ), - kappa_ - ( - IOobject - ( - "kappa", - time_.timeName(), - filmRegion_, - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - filmRegion_, - dimensionedScalar - ( - "kappa", - dimEnergy/dimTime/dimLength/dimTemperature, - 0.0 - ), - zeroGradientFvPatchScalarField::typeName - ), - - T_ - ( - IOobject - ( - "Tf", - time_.timeName(), - filmRegion_, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - filmRegion_ - ), - Ts_ - ( - IOobject - ( - "Tsf", - time_.timeName(), - filmRegion_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - T_, - zeroGradientFvPatchScalarField::typeName - ), - Tw_ - ( - IOobject - ( - "Twf", - time_.timeName(), - filmRegion_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - T_, - zeroGradientFvPatchScalarField::typeName - ), - hs_ - ( - IOobject - ( - "hsf", - time_.timeName(), - filmRegion_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - filmRegion_, - dimensionedScalar("zero", dimEnergy/dimMass, 0.0), - T_.boundaryField().types() - ), - - hsSp_ - ( - IOobject - ( - "hsSp", - time_.timeName(), - filmRegion_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - filmRegion_, - dimensionedScalar("zero", dimEnergy/dimArea/dimTime, 0.0), - pSp_.boundaryField().types() - ), - - hsSpPrimary_ - ( - IOobject - ( - hsSp_.name(), // must have same name as hSp_ to enable mapping - time_.timeName(), - mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - mesh_, - dimensionedScalar("zero", hsSp_.dimensions(), 0.0) - ), - - TPrimary_ - ( - IOobject - ( - "T", // must have same name as T on primary region to enable mapping - time_.timeName(), - filmRegion_, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - filmRegion_ - ), - - YPrimary_(), - - htcs_ - ( - heatTransferModel::New(*this, coeffs_.subDict("upperSurfaceModels")) - ), - htcw_ - ( - heatTransferModel::New(*this, coeffs_.subDict("lowerSurfaceModels")) - ), - phaseChange_(phaseChangeModel::New(*this, coeffs_)), - energyPhaseChangeForPrimary_ - ( - IOobject - ( - "energyPhaseChangeForPrimary", - time_.timeName(), - filmRegion_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - filmRegion_, - dimensionedScalar("zero", dimEnergy, 0), - zeroGradientFvPatchScalarField::typeName - ) -{ - if (thermo_.hasMultiComponentCarrier()) - { - YPrimary_.setSize(thermo_.carrier().species().size()); - - forAll(thermo_.carrier().species(), i) - { - YPrimary_.set - ( - i, - new volScalarField - ( - IOobject - ( - thermo_.carrier().species()[i], - time_.timeName(), - filmRegion_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - filmRegion_, - dimensionedScalar("zero", dimless, 0.0), - pSp_.boundaryField().types() - ) - ); - } - } - -} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::surfaceFilmModels::thermoSingleLayer::~thermoSingleLayer() -{} - - -// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // - -void Foam::surfaceFilmModels::thermoSingleLayer::addSources -( - const label patchI, - const label faceI, - const scalar massSource, - const vector& momentumSource, - const scalar pressureSource, - const scalar energySource -) -{ - kinematicSingleLayer::addSources - ( - patchI, - faceI, - massSource, - momentumSource, - pressureSource, - energySource - ); - - if (debug) - { - Info<< " energy = " << energySource << nl << endl; - } - - hsSpPrimary_.boundaryField()[patchI][faceI] += energySource; -} - - -void Foam::surfaceFilmModels::thermoSingleLayer::preEvolveFilm() -{ - if (!initialisedThermo_) - { - // Retreive pressure from primary region - pPrimary_.correctBoundaryConditions(); - - // Correct (temperature dependent) thermo fields - correctThermoFields(); - - // Update derived fields - hs_ == hs(T_); - deltaRho_ == delta_*rho_; - phi_ = fvc::interpolate(deltaRho_*U_) & filmRegion_.Sf(); - initialisedThermo_ = true; - } -} - - -void Foam::surfaceFilmModels::thermoSingleLayer::evolveFilm() -{ - transferPrimaryRegionFields(); - - updateSubmodels(); - - // Solve continuity for deltaRho_ - solveContinuity(); - - for (int oCorr=0; oCorr<nOuterCorr_; oCorr++) - { - // Explicit pressure source contribution - tmp<volScalarField> tpu = this->pu(); - - // Implicit pressure source coefficient - tmp<volScalarField> tpp = this->pp(); - - // Solve for momentum for U_ - tmp<fvVectorMatrix> UEqn = solveMomentum(tpu(), tpp()); - - // Solve energy for hs_ - solveEnergy(); - - // Film thickness correction loop - for (int corr=1; corr<=nCorr_; corr++) - { - // Solve thickness for delta_ - solveThickness(tpu(), tpp(), UEqn()); - } - } - - // Update deltaRho_ with new delta_ - deltaRho_ == delta_*rho_; - - // Update temperature using latest hs_ - T_ == T(hs_); - - // Update film wall and surface velocities - updateSurfaceVelocities(); - - // Update film wall and surface temperatures - updateSurfaceTemperatures(); - - // Reset source terms for next time integration - resetPrimaryRegionSourceTerms(); -} - - -const Foam::volScalarField& -Foam::surfaceFilmModels::thermoSingleLayer::Cp() const -{ - return Cp_; -} - - -const Foam::volScalarField& -Foam::surfaceFilmModels::thermoSingleLayer::kappa() const -{ - return kappa_; -} - - -const Foam::volScalarField& -Foam::surfaceFilmModels::thermoSingleLayer::T() const -{ - return T_; -} - - -const Foam::volScalarField& -Foam::surfaceFilmModels::thermoSingleLayer::Ts() const -{ - return Ts_; -} - - -const Foam::volScalarField& -Foam::surfaceFilmModels::thermoSingleLayer::Tw() const -{ - return Tw_; -} - - -const Foam::volScalarField& -Foam::surfaceFilmModels::thermoSingleLayer::hs() const -{ - return hs_; -} - - -void Foam::surfaceFilmModels::thermoSingleLayer::info() const -{ - kinematicSingleLayer::info(); - - Info<< indent << "min/max(T) = " << min(T_).value() << ", " - << max(T_).value() << nl; - - phaseChange_->info(); -} - - -Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh> > -Foam::surfaceFilmModels::thermoSingleLayer::Srho() const -{ - tmp<DimensionedField<scalar, volMesh> > tSrho - ( - new DimensionedField<scalar, volMesh> - ( - IOobject - ( - "thermoSingleLayer::Srho", - time_.timeName(), - mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - mesh_, - dimensionedScalar("zero", dimMass/dimVolume/dimTime, 0.0) - ) - ); - - scalarField& Srho = tSrho(); - const scalarField& V = mesh_.V(); - const scalar dt = time_.deltaTValue(); - - forAll(filmBottomPatchIDs_, i) - { - const label primaryPatchI = primaryPatchIDs_[i]; - const directMappedWallPolyPatch& wpp = - refCast<const directMappedWallPolyPatch> - ( - mesh_.boundaryMesh()[primaryPatchI] - ); - - const mapDistribute& distMap = wpp.map(); - - const label filmPatchI = filmBottomPatchIDs_[i]; - - scalarField patchMass - ( - massPhaseChangeForPrimary_.boundaryField()[filmPatchI] - ); - - distMap.distribute(patchMass); - - const labelUList& cells = wpp.faceCells(); - - forAll(patchMass, j) - { - Srho[cells[j]] = patchMass[j]/(V[cells[j]]*dt); - } - } - - return tSrho; -} - - -Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh> > -Foam::surfaceFilmModels::thermoSingleLayer::Srho(const label i) const -{ - const label vapId = - thermo_.carrierId(thermo_.liquids().components()[liquidId_]); - - tmp<DimensionedField<scalar, volMesh> > tSrho - ( - new DimensionedField<scalar, volMesh> - ( - IOobject - ( - "thermoSingleLayer::Srho(i)", - time_.timeName(), - mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - mesh_, - dimensionedScalar("zero", dimMass/dimVolume/dimTime, 0.0) - ) - ); - - if (vapId == i) - { - scalarField& Srho = tSrho(); - const scalarField& V = mesh_.V(); - const scalar dt = time_.deltaTValue(); - - forAll(filmBottomPatchIDs_, i) - { - const label primaryPatchI = primaryPatchIDs_[i]; - const directMappedWallPolyPatch& wpp = - refCast<const directMappedWallPolyPatch> - ( - mesh_.boundaryMesh()[primaryPatchI] - ); - - const mapDistribute& distMap = wpp.map(); - - const label filmPatchI = filmBottomPatchIDs_[i]; - - scalarField patchMass - ( - massPhaseChangeForPrimary_.boundaryField()[filmPatchI] - ); - - distMap.distribute(patchMass); - - const labelUList& cells = wpp.faceCells(); - - forAll(patchMass, j) - { - Srho[cells[j]] = patchMass[j]/(V[cells[j]]*dt); - } - } - } - - return tSrho; -} - - -Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh> > -Foam::surfaceFilmModels::thermoSingleLayer::Sh() const -{ - tmp<DimensionedField<scalar, volMesh> > tSh - ( - new DimensionedField<scalar, volMesh> - ( - IOobject - ( - "thermoSingleLayer::Sh", - time_.timeName(), - mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - mesh_, - dimensionedScalar("zero", dimEnergy/dimVolume/dimTime, 0.0) - ) - ); - - // All of enthalpy change due to phase change added to film energy equation - -/* - scalarField& Sh = tSh(); - const scalarField& V = mesh_.V(); - const scalar dt = time_.deltaTValue(); - - forAll(filmBottomPatchIDs_, i) - { - const label primaryPatchI = primaryPatchIDs_[i]; - const directMappedWallPolyPatch& wpp = - refCast<const directMappedWallPolyPatch> - ( - mesh_.boundaryMesh()[primaryPatchI] - ); - - const mapDistribute& distMap = wpp.map(); - - const label filmPatchI = filmBottomPatchIDs_[i]; - - scalarField patchEnergy - ( - energyPhaseChangeForPrimary_.boundaryField()[filmPatchI] - ); - distMap.distribute(patchEnergy); - - const labelUList& cells = wpp.faceCells(); - - forAll(patchMass, j) - { - Sh[cells[j]] += patchEnergy[j]/(V[cells[j]]*dt); - } - } -*/ - return tSh; -} - - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/surfaceFilmModel/thermoSingleLayer/thermoSingleLayer.H b/src/surfaceFilmModels/surfaceFilmModel/thermoSingleLayer/thermoSingleLayer.H deleted file mode 100644 index 5ee8d0de521c8e528e578f77449d64c0c7c79d5d..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/surfaceFilmModel/thermoSingleLayer/thermoSingleLayer.H +++ /dev/null @@ -1,350 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. - \\/ 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::thermoSingleLayer - -Description - Thermodynamic form of single-cell layer surface film model - - Note: defining enthalpy as Cp(T - Tstd) - when using liquids from the - thermophysical library, their enthalpies are calculated similarly, where - Tstd = 298.15 K - -SourceFiles - thermoSingleLayer.C - -\*---------------------------------------------------------------------------*/ - -#ifndef thermoSingleLayer_H -#define thermoSingleLayer_H - -#include "kinematicSingleLayer.H" -#include "SLGThermo.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace surfaceFilmModels -{ - -// Forward declaration of classes -class heatTransferModel; -class phaseChangeModel; - -/*---------------------------------------------------------------------------*\ - Class thermoSingleLayer Declaration -\*---------------------------------------------------------------------------*/ - -class thermoSingleLayer -: - public kinematicSingleLayer -{ -private: - - // Private member functions - - //- Disallow default bitwise copy construct - thermoSingleLayer(const thermoSingleLayer&); - - //- Disallow default bitwise assignment - void operator=(const thermoSingleLayer&); - - -protected: - - // Protected data - - // Thermo properties - - //- Reference to the SLGThermo - const SLGThermo& thermo_; - - // Single component - - //- Id of component in thermo database - label liquidId_; - - - // Fields - - //- Specific heat capacity / [J/kg/K] - volScalarField Cp_; - - //- Thermal conductivity / [W/m/K] - volScalarField kappa_; - - //- Temperature - mean / [K] - volScalarField T_; - - //- Temperature - surface / [K] - volScalarField Ts_; - - //- Temperature - wall / [K] - volScalarField Tw_; - - //- Sensible enthalpy / [J/kg] - volScalarField hs_; - - - // Source term fields - - // Film region - registered to the film region mesh - // Note: need boundary value mapped from primary region, and then - // pushed into the patch internal field - - //- Energy / [J/m2/s] - volScalarField hsSp_; - - - // Primary region - registered to the primary region mesh - // Internal use only - not read-in - - //- Energy / [J/m2/s] - volScalarField hsSpPrimary_; - - - // Fields mapped from primary region - registered to the film region - // Note: need both boundary AND patch internal fields to be mapped - - //- Temperature / [K] - volScalarField TPrimary_; - - //- List of specie mass fractions / [0-1] - PtrList<volScalarField> YPrimary_; - - - // Sub-models - - //- Heat transfer coefficient bewteen film surface and primary - // region [W/m2/K] - autoPtr<heatTransferModel> htcs_; - - //- Heat transfer coefficient bewteen wall and film [W/m2/K] - autoPtr<heatTransferModel> htcw_; - - //- Phase change - autoPtr<phaseChangeModel> phaseChange_; - - //- Film energy evolved via phase change - volScalarField energyPhaseChangeForPrimary_; - - - // Protected member functions - - //- Read control parameters from dictionary - virtual bool read(); - - //- Correct the thermo fields - virtual void correctThermoFields(); - - //- Correct the film surface and wall temperatures - virtual void updateSurfaceTemperatures(); - - //- Reset source term fields - virtual void resetPrimaryRegionSourceTerms(); - - //- Transfer fields from the primary region to the film region - virtual void transferPrimaryRegionFields(); - - //- Update the film sub-models - virtual void updateSubmodels(); - - //- Return the wall/surface heat transfer term for the enthalpy equation - virtual tmp<fvScalarMatrix> q(volScalarField& h) const; - - - // Equations - - //- Solve energy equation - virtual void solveEnergy(); - - -public: - - //- Runtime type information - TypeName("thermoSingleLayer"); - - - // Constructors - - //- Construct from components - thermoSingleLayer - ( - const word& modelType, - const fvMesh& mesh, - const dimensionedVector& g - ); - - - //- Destructor - virtual ~thermoSingleLayer(); - - - // Member Functions - - // Thermo properties - - //- Return const reference to the SLGThermo object - inline const SLGThermo& thermo() const; - - // Single component - - //- Return the Id of component in thermo database - inline label liquidId() const; - - - // Fields - - //- Return the film specific heat capacity [J/kg/K] - virtual const volScalarField& Cp() const; - - //- Return the film thermal conductivity [W/m/K] - virtual const volScalarField& kappa() const; - - //- Return the film mean temperature [K] - virtual const volScalarField& T() const; - - //- Return the film surface temperature [K] - virtual const volScalarField& Ts() const; - - //- Return the film wall temperature [K] - virtual const volScalarField& Tw() const; - - //- Return the film sensible enthalpy [J/kg] - virtual const volScalarField& hs() const; - - - // Helper functions - - //- Return sensible enthalpy as a function of temperature - inline tmp<Foam::volScalarField> hs - ( - const volScalarField& T - ) const; - - //- Return temperature as a function of sensible enthalpy - inline tmp<Foam::volScalarField> T - ( - const volScalarField& hs - ) const; - - - // Source fields (read/write access) - - //- External hook to add sources to the film - virtual void addSources - ( - const label patchI, // patchI on primary region - const label faceI, // faceI of patchI - const scalar massSource, // [kg] - const vector& momentumSource, // [kg.m/s] (tangential momentum) - const scalar pressureSource, // [kg.m/s] (normal momentum) - const scalar energySource // [J] - ); - - - // Source term fields - - // Film region - - //- Energy / [J/m2/s] - inline const volScalarField& hsSp() const; - - - // Primary region - - //- Energy / [J/m2/s] - inline const volScalarField& hsSpPrimary() const; - - - // Fields mapped from the primary region - - //- Temperature / [K] - inline const volScalarField& TPrimary() const; - - //- Specie mass fractions / [0-1] - inline const PtrList<volScalarField>& YPrimary() const; - - - - // Sub-models - - //- Return const access to the (surface) heat transfer model - inline const heatTransferModel& htcs() const; - - //- Return const access to the (wall) heat transfer model - inline const heatTransferModel& htcw() const; - - //- Return const access to the phawse change model - inline const phaseChangeModel& phaseChange() const; - - - // Evolution - - //- Pre-evolve film hook - virtual void preEvolveFilm(); - - //- Evolve the film equations - virtual void evolveFilm(); - - - // Source fields - - // Mapped into primary region - - //- Return total mass source - Eulerian phase only - virtual tmp<DimensionedField<scalar, volMesh> > Srho() const; - - //- Return mass source for specie i - Eulerian phase only - virtual tmp<DimensionedField<scalar, volMesh> > Srho - ( - const label i - ) const; - - //- Return enthalpy source - Eulerian phase only - virtual tmp<DimensionedField<scalar, volMesh> > Sh() const; - - - // I-O - - //- Provide some feedback - virtual void info() const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace surfaceFilmModels -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "thermoSingleLayerI.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/surfaceFilmModels/surfaceFilmModel/thermoSingleLayer/thermoSingleLayerI.H b/src/surfaceFilmModels/surfaceFilmModel/thermoSingleLayer/thermoSingleLayerI.H deleted file mode 100644 index 3d0138ad622f7d027f9ff1cfcd263ca4ea10e66b..0000000000000000000000000000000000000000 --- a/src/surfaceFilmModels/surfaceFilmModel/thermoSingleLayer/thermoSingleLayerI.H +++ /dev/null @@ -1,147 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. - \\/ 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 "thermoSingleLayer.H" -#include "specie.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -inline const Foam::SLGThermo& -Foam::surfaceFilmModels::thermoSingleLayer::thermo() const -{ - return thermo_; -} - - -inline Foam::label Foam::surfaceFilmModels::thermoSingleLayer::liquidId() const -{ - return liquidId_; -} - - -inline Foam::tmp<Foam::volScalarField> -Foam::surfaceFilmModels::thermoSingleLayer::hs -( - const volScalarField& T -) const -{ - const dimensionedScalar Tstd("Tstd", dimTemperature, specie::Tstd); - - return tmp<volScalarField> - ( - new volScalarField - ( - IOobject - ( - "hs(" + T.name() + ")", - filmRegion_.time().timeName(), - filmRegion_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - Cp_*(T - Tstd), - zeroGradientFvPatchScalarField::typeName - ) - ); -} - - -inline Foam::tmp<Foam::volScalarField> -Foam::surfaceFilmModels::thermoSingleLayer::T -( - const volScalarField& hs -) const -{ - const dimensionedScalar Tstd("Tstd", dimTemperature, specie::Tstd); - - return tmp<volScalarField> - ( - new volScalarField - ( - IOobject - ( - "T(" + hs.name() + ")", - filmRegion_.time().timeName(), - filmRegion_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - hs/Cp_ + Tstd, - zeroGradientFvPatchScalarField::typeName - ) - ); -} - - -inline const Foam::volScalarField& -Foam::surfaceFilmModels::thermoSingleLayer::hsSp() const -{ - return hsSp_; -} - - -inline const Foam::volScalarField& -Foam::surfaceFilmModels::thermoSingleLayer::hsSpPrimary() const -{ - return hsSpPrimary_; -} - - -inline const Foam::volScalarField& -Foam::surfaceFilmModels::thermoSingleLayer::TPrimary() const -{ - return TPrimary_; -} - - -inline const Foam::PtrList<Foam::volScalarField>& -Foam::surfaceFilmModels::thermoSingleLayer::YPrimary() const -{ - return YPrimary_; -} - - -inline const Foam::surfaceFilmModels::heatTransferModel& -Foam::surfaceFilmModels::thermoSingleLayer::htcs() const -{ - return htcs_(); -} - - -inline const Foam::surfaceFilmModels::heatTransferModel& -Foam::surfaceFilmModels::thermoSingleLayer::htcw() const -{ - return htcw_(); -} - - -inline const Foam::surfaceFilmModels::phaseChangeModel& -Foam::surfaceFilmModels::thermoSingleLayer::phaseChange() const -{ - return phaseChange_(); -} - - -// ************************************************************************* //