From 8218923b8cc7d2a58c1a25d2ccd084905e4e45ac Mon Sep 17 00:00:00 2001 From: sergio Date: Tue, 21 Jan 2020 14:25:01 -0800 Subject: [PATCH 1/3] ENH: Adding support for two phases Euler solver to heatTransferModel FO --- src/functionObjects/field/Make/options | 6 ++-- .../heatTransferCoeffModel.C | 23 ++++++++++++ .../solidQuenching2D/system/controlDict | 35 +++++++++++++++++++ 3 files changed, 62 insertions(+), 2 deletions(-) diff --git a/src/functionObjects/field/Make/options b/src/functionObjects/field/Make/options index 57ea31c1cf..1146a65d49 100644 --- a/src/functionObjects/field/Make/options +++ b/src/functionObjects/field/Make/options @@ -18,7 +18,8 @@ EXE_INC = \ -I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ - -I$(LIB_SRC)/fvAgglomerationMethods/pairPatchAgglomeration/lnInclude + -I$(LIB_SRC)/fvAgglomerationMethods/pairPatchAgglomeration/lnInclude \ + -I$(LIB_SRC)/phaseSystemModels/reactingEulerFoam/phaseSystems/lnInclude LIB_LIBS = \ -lfiniteVolume \ @@ -37,4 +38,5 @@ LIB_LIBS = \ -lcompressibleTurbulenceModels \ -lchemistryModel \ -lreactionThermophysicalModels \ - -lpairPatchAgglomeration + -lpairPatchAgglomeration \ + -lreactingPhaseSystem diff --git a/src/functionObjects/field/heatTransferCoeff/heatTransferCoeffModels/heatTransferCoeffModel/heatTransferCoeffModel.C b/src/functionObjects/field/heatTransferCoeff/heatTransferCoeffModels/heatTransferCoeffModel/heatTransferCoeffModel.C index c72aefc0bd..38abbd3ba6 100644 --- a/src/functionObjects/field/heatTransferCoeff/heatTransferCoeffModels/heatTransferCoeffModel/heatTransferCoeffModel.C +++ b/src/functionObjects/field/heatTransferCoeff/heatTransferCoeffModels/heatTransferCoeffModel/heatTransferCoeffModel.C @@ -30,6 +30,7 @@ License #include "fluidThermo.H" #include "turbulentTransportModel.H" #include "turbulentFluidThermoModel.H" +#include "phaseSystem.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -90,6 +91,28 @@ Foam::heatTransferCoeffModel::q() const q[patchi] = alphabf[patchi]*hebf[patchi].snGrad(); } } + else if (mesh_.foundObject("phaseProperties")) + { + const phaseSystem& fluid = + ( + mesh_.lookupObject("phaseProperties") + ); + + for (label patchi : patchSet_) + { + forAll(fluid.phases(), phasei) + { + const phaseModel& phase = fluid.phases()[phasei]; + const fvPatchScalarField& alpha = + phase.boundaryField()[patchi]; + const volScalarField& he = phase.thermo().he(); + const volScalarField::Boundary& hebf = he.boundaryField(); + + q[patchi] += + alpha*phase.alphaEff(patchi)()*hebf[patchi].snGrad(); + } + } + } else { FatalErrorInFunction diff --git a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/controlDict b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/controlDict index cde3e6c6d7..84de3e466e 100644 --- a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/controlDict +++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/controlDict @@ -61,6 +61,41 @@ adjustTimeStep yes; functions { + htc + { + type heatTransferCoeff; + libs ("libfieldFunctionObjects.so"); + region water; + field T.liquid; + writeControl outputTime; + writeInterval 1; + htcModel fixedReferenceTemperature; + patches (water_to_solid); + TRef 373; + } + + htcSurfaceFieldValue + { + type surfaceFieldValue; + libs (fieldFunctionObjects); + log on; + enabled true; + + writeControl outputTime; + writeInterval 1; + + writeFields false; + surfaceFormat none; + writeArea false; + + region water; + regionType patch; + name water_to_solid; + + operation areaAverage; + + fields ( heatTransferCoeff(T.liquid) ); + } } // ************************************************************************* // From dc04980d5cec501f9cda3ecf901443de8cdca24e Mon Sep 17 00:00:00 2001 From: OpenFOAM bot <> Date: Wed, 22 Jan 2020 10:00:03 +0100 Subject: [PATCH 2/3] STYLE: remove trailing space, tabs --- .../heatTransferCoeffModel/heatTransferCoeffModel.C | 8 ++++---- .../solidQuenching2D/system/controlDict | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/functionObjects/field/heatTransferCoeff/heatTransferCoeffModels/heatTransferCoeffModel/heatTransferCoeffModel.C b/src/functionObjects/field/heatTransferCoeff/heatTransferCoeffModels/heatTransferCoeffModel/heatTransferCoeffModel.C index 38abbd3ba6..0e078a8d78 100644 --- a/src/functionObjects/field/heatTransferCoeff/heatTransferCoeffModels/heatTransferCoeffModel/heatTransferCoeffModel.C +++ b/src/functionObjects/field/heatTransferCoeff/heatTransferCoeffModels/heatTransferCoeffModel/heatTransferCoeffModel.C @@ -97,18 +97,18 @@ Foam::heatTransferCoeffModel::q() const ( mesh_.lookupObject("phaseProperties") ); - + for (label patchi : patchSet_) { forAll(fluid.phases(), phasei) { const phaseModel& phase = fluid.phases()[phasei]; - const fvPatchScalarField& alpha = + const fvPatchScalarField& alpha = phase.boundaryField()[patchi]; const volScalarField& he = phase.thermo().he(); const volScalarField::Boundary& hebf = he.boundaryField(); - - q[patchi] += + + q[patchi] += alpha*phase.alphaEff(patchi)()*hebf[patchi].snGrad(); } } diff --git a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/controlDict b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/controlDict index 84de3e466e..9434d196ca 100644 --- a/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/controlDict +++ b/tutorials/heatTransfer/chtMultiRegionTwoPhaseEulerFoam/solidQuenching2D/system/controlDict @@ -61,10 +61,10 @@ adjustTimeStep yes; functions { - htc + htc { type heatTransferCoeff; - libs ("libfieldFunctionObjects.so"); + libs (fieldFunctionObjects); region water; field T.liquid; writeControl outputTime; @@ -73,7 +73,7 @@ functions patches (water_to_solid); TRef 373; } - + htcSurfaceFieldValue { type surfaceFieldValue; From 486df96fbcb4aa009ae120622950cf4eaf63f455 Mon Sep 17 00:00:00 2001 From: sergio Date: Thu, 23 Jan 2020 14:26:16 -0800 Subject: [PATCH 3/3] ENH: Re-ordering compilation phaseSystemModels --- .../chtMultiRegionTwoPhaseEulerFoam/Make/options | 5 +++-- src/phaseSystemModels/Allwmake | 7 +++---- .../reactingEulerFoam/derivedFvPatchFields/Make/options | 1 - .../reactingEulerFoam/interfacialModels/Make/options | 1 - .../reactingEulerFoam/phaseSystems/Make/options | 7 ++++++- .../multiphaseCompressibleTurbulenceModels/Make/options | 1 - .../multiphaseSystem/Make/options | 3 +-- .../twoPhaseCompressibleTurbulenceModels/Make/options | 1 - .../reactingTwoPhaseEulerFoam/twoPhaseSystem/Make/options | 1 - 9 files changed, 13 insertions(+), 14 deletions(-) diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionTwoPhaseEulerFoam/Make/options b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionTwoPhaseEulerFoam/Make/options index ced67af4db..7ecfb0fa3e 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionTwoPhaseEulerFoam/Make/options +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionTwoPhaseEulerFoam/Make/options @@ -36,5 +36,6 @@ EXE_LIBS = \ -lradiationModels \ -lregionModels \ -lsampling \ - -lreactingPhaseSystem \ - -lreactingTwoPhaseSystem + -lreactingTwoPhaseSystem \ + -lreactingPhaseSystem + diff --git a/src/phaseSystemModels/Allwmake b/src/phaseSystemModels/Allwmake index 5e5d00632b..686604a701 100755 --- a/src/phaseSystemModels/Allwmake +++ b/src/phaseSystemModels/Allwmake @@ -4,9 +4,7 @@ cd "${0%/*}" || exit # Run from this directory #------------------------------------------------------------------------------ -wmakeLnInclude reactingEulerFoam/interfacialCompositionModels -wmakeLnInclude reactingEulerFoam/interfacialModels -wmakeLnInclude reactingEulerFoam/derivedFvPatchFields +wmakeLnInclude reactingEulerFoam/phaseSystems case "$WM_COMPILER" in Mingw*) @@ -18,7 +16,6 @@ esac #------------------------------------------------------------------------------ -wmake $targetType reactingEulerFoam/phaseSystems wmake $targetType reactingEulerFoam/interfacialModels wmake $targetType reactingEulerFoam/interfacialCompositionModels wmake $targetType reactingEulerFoam/derivedFvPatchFields @@ -29,4 +26,6 @@ wmake $targetType reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseCompr wmake $targetType reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem wmake $targetType reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels +wmake $targetType reactingEulerFoam/phaseSystems + #------------------------------------------------------------------------------ diff --git a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/Make/options b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/Make/options index 9ba3e3ab4f..24fb0f28dc 100644 --- a/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/Make/options +++ b/src/phaseSystemModels/reactingEulerFoam/derivedFvPatchFields/Make/options @@ -15,7 +15,6 @@ LIB_LIBS = \ -lfiniteVolume \ -lfvOptions \ -lmeshTools \ - -lreactingPhaseSystem \ -lreactingEulerianInterfacialModels \ -lreactingEulerianInterfacialCompositionModels \ -lturbulenceModels \ diff --git a/src/phaseSystemModels/reactingEulerFoam/interfacialModels/Make/options b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/Make/options index 9af2da489d..2a0f82bd25 100644 --- a/src/phaseSystemModels/reactingEulerFoam/interfacialModels/Make/options +++ b/src/phaseSystemModels/reactingEulerFoam/interfacialModels/Make/options @@ -15,6 +15,5 @@ LIB_LIBS = \ -lfluidThermophysicalModels \ -lcompressibleTransportModels \ -lspecie \ - -lreactingPhaseSystem \ -lturbulenceModels \ -lcompressibleTurbulenceModels diff --git a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/Make/options b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/Make/options index 8d823cafb9..1e1eaf3f1d 100644 --- a/src/phaseSystemModels/reactingEulerFoam/phaseSystems/Make/options +++ b/src/phaseSystemModels/reactingEulerFoam/phaseSystems/Make/options @@ -24,4 +24,9 @@ LIB_LIBS = \ -lcompressibleTransportModels \ -lturbulenceModels \ -lcompressibleTurbulenceModels \ - -lcombustionModels + -lcombustionModels \ + -lreactingEulerianInterfacialCompositionModels \ + -lreactingEulerianInterfacialModels \ + -lreactingEulerianFvPatchFields \ + -lmultiphaseReactingTurbulenceModels \ + -ltwoPhaseReactingTurbulenceModels diff --git a/src/phaseSystemModels/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseCompressibleTurbulenceModels/Make/options b/src/phaseSystemModels/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseCompressibleTurbulenceModels/Make/options index b032af9139..7033569050 100644 --- a/src/phaseSystemModels/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseCompressibleTurbulenceModels/Make/options +++ b/src/phaseSystemModels/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseCompressibleTurbulenceModels/Make/options @@ -19,7 +19,6 @@ LIB_LIBS = \ -lfiniteVolume \ -lfvOptions \ -lmeshTools \ - -lreactingPhaseSystem \ -lreactingMultiphaseSystem \ -lreactingEulerianInterfacialModels \ -lreactingEulerianInterfacialCompositionModels \ diff --git a/src/phaseSystemModels/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/Make/options b/src/phaseSystemModels/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/Make/options index 500708f45a..06b3f1356c 100644 --- a/src/phaseSystemModels/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/Make/options +++ b/src/phaseSystemModels/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/Make/options @@ -22,5 +22,4 @@ LIB_LIBS = \ -lfvOptions \ -lmeshTools \ -lsampling \ - -lcombustionModels \ - -lreactingPhaseSystem + -lcombustionModels diff --git a/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/Make/options b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/Make/options index f0f539eeed..c4ed27c34f 100644 --- a/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/Make/options +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/Make/options @@ -17,7 +17,6 @@ LIB_LIBS = \ -lfiniteVolume \ -lfvOptions \ -lmeshTools \ - -lreactingPhaseSystem \ -lreactingTwoPhaseSystem \ -lreactingEulerianInterfacialModels \ -lreactingEulerianInterfacialCompositionModels \ diff --git a/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/Make/options b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/Make/options index 650650dab1..a19dce92ba 100644 --- a/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/Make/options +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/Make/options @@ -21,6 +21,5 @@ LIB_LIBS = \ -lmeshTools \ -lsampling \ -lcombustionModels \ - -lreactingPhaseSystem \ -lturbulenceModels \ -lcompressibleTurbulenceModels