From 04791650240a62a0876d94f7f582e7ed69a0ae5b Mon Sep 17 00:00:00 2001 From: henry <Henry Weller h.weller@opencfd.co.uk> Date: Thu, 20 Nov 2008 20:33:06 +0000 Subject: [PATCH] Added generic turbulenceModel base class to incompressible turbulence models. --- .../incompressible/channelFoam/Make/files | 3 + .../incompressible/channelFoam/Make/options | 14 + .../incompressible/channelFoam/channelFoam.C | 155 + .../incompressible/channelFoam/createFields.H | 43 + .../incompressible/channelFoam/createGradP.H | 24 + .../channelFoam/readTransportProperties.H | 28 + .../incompressible/channelFoam/writeGradP.H | 19 + .../incompressible/pimpleDyMFoam/Make/files | 3 + .../incompressible/pimpleDyMFoam/Make/options | 17 + .../incompressible/pimpleDyMFoam/UEqn.H | 16 + .../incompressible/pimpleDyMFoam/correctPhi.H | 44 + .../pimpleDyMFoam/createFields.H | 59 + .../pimpleDyMFoam/pimpleDyMFoam.C | 172 + .../pimpleDyMFoam/readControls.H | 14 + .../incompressible/pisoFoam/Make/files | 3 + .../incompressible/pisoFoam/Make/options | 12 + .../incompressible/pisoFoam/createFields.H | 42 + .../incompressible/pisoFoam/pisoFoam.C | 131 + .../multiphase/cavitatingFoam/CourantNo.H | 59 + .../multiphase/cavitatingFoam/Make/files | 3 + .../multiphase/cavitatingFoam/Make/options | 14 + .../solvers/multiphase/cavitatingFoam/UEqn.H | 22 + .../cavitatingFoam/cavitatingFoam.C | 96 + .../cavitatingFoam/continuityErrs.H | 22 + .../multiphase/cavitatingFoam/createFields.H | 85 + .../multiphase/cavitatingFoam/gammaPsi.H | 10 + .../solvers/multiphase/cavitatingFoam/pEqn.H | 80 + .../multiphase/cavitatingFoam/readControls.H | 9 + .../readThermodynamicProperties.H | 27 + .../cavitatingFoam/resetPhiPatches.H | 15 + .../cavitatingFoam/resetPhivPatches.H | 14 + .../multiphase/cavitatingFoam/rhoEqn.H | 16 + .../multiphase/cavitatingFoam/setDeltaT.H | 54 + .../cavitatingFoam/setInitialDeltaT.H | 54 + .../compressibleInterDyMFoam/Make/files | 3 + .../compressibleInterDyMFoam/Make/options | 22 + .../compressibleInterDyMFoam/UEqn.H | 31 + .../compressibleInterDyMFoam/alphaEqns.H | 76 + .../alphaEqnsSubCycle.H | 43 + .../compressibleInterDyMFoam.C | 138 + .../compressibleInterDyMFoam/createFields.H | 152 + .../compressibleInterDyMFoam/pEqn.H | 77 + .../compressibleInterDyMFoam/readControls.H | 32 + .../compressibleInterFoam/Make/files | 3 + .../compressibleInterFoam/Make/options | 15 + .../multiphase/compressibleInterFoam/UEqn.H | 34 + .../compressibleInterFoam/alphaEqns.H | 76 + .../compressibleInterFoam/alphaEqnsSubCycle.H | 43 + .../compressibleInterFoam.C | 106 + .../compressibleInterFoam/createFields.H | 152 + .../multiphase/compressibleInterFoam/pEqn.H | 74 + .../compressibleInterFoam/readControls.H | 20 + .../solvers/multiphase/interFoam/alphaEqn.H | 35 + .../multiphase/interFoam/alphaEqnSubCycle.H | 35 + .../interPhaseChangeFoam/alphaEqn.H | 67 + .../interPhaseChangeFoam/alphaEqnSubCycle.H | 53 + .../multiphase/twoLiquidMixingFoam/alphaEqn.H | 19 + .../alphaContactAngleFvPatchScalarField.C | 96 + .../alphaContactAngleFvPatchScalarField.H | 125 + ...stantAlphaContactAngleFvPatchScalarField.C | 133 + ...stantAlphaContactAngleFvPatchScalarField.H | 152 + ...namicAlphaContactAngleFvPatchScalarField.C | 170 + ...namicAlphaContactAngleFvPatchScalarField.H | 161 + ...ryingAlphaContactAngleFvPatchScalarField.C | 154 + ...ryingAlphaContactAngleFvPatchScalarField.H | 148 + .../alphaFixedPressureFvPatchScalarField.C | 179 + .../alphaFixedPressureFvPatchScalarField.H | 180 + src/turbulenceModels/compressible/Allwmake | 9 + .../DeardorffDiffStress/DeardorffDiffStress.C | 150 + .../DeardorffDiffStress/DeardorffDiffStress.H | 141 + .../LES/GenEddyVisc/GenEddyVisc.C | 144 + .../LES/GenEddyVisc/GenEddyVisc.H | 155 + .../LES/GenSGSStress/GenSGSStress.C | 159 + .../LES/GenSGSStress/GenSGSStress.H | 160 + .../compressible/LES/LESModel/LESModel.C | 133 + .../compressible/LES/LESModel/LESModel.H | 293 + .../compressible/LES/LESModel/newLESModel.C | 94 + .../compressible/LES/Make/files | 19 + .../compressible/LES/Make/options | 11 + .../LES/Smagorinsky/Smagorinsky.C | 112 + .../LES/Smagorinsky/Smagorinsky.H | 127 + .../LES/SpalartAllmaras/SpalartAllmaras.C | 329 + .../LES/SpalartAllmaras/SpalartAllmaras.H | 175 + ...rtAllmarasWallFunctionFvPatchScalarField.C | 205 + ...rtAllmarasWallFunctionFvPatchScalarField.H | 165 + .../LES/dynOneEqEddy/dynOneEqEddy.C | 155 + .../LES/dynOneEqEddy/dynOneEqEddy.H | 146 + .../LES/lowReOneEqEddy/lowReOneEqEddy.C | 137 + .../LES/lowReOneEqEddy/lowReOneEqEddy.H | 138 + .../compressible/LES/oneEqEddy/oneEqEddy.C | 124 + .../compressible/LES/oneEqEddy/oneEqEddy.H | 141 + .../compressible/RAS/LRR/LRR.C | 476 + .../compressible/RAS/LRR/LRR.H | 202 + .../RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C | 514 + .../RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.H | 211 + .../RAS/LaunderSharmaKE/LaunderSharmaKE.C | 331 + .../RAS/LaunderSharmaKE/LaunderSharmaKE.H | 191 + .../compressible/RAS/Make/files | 43 + .../compressible/RAS/Make/options | 8 + .../compressible/RAS/RASModel/RASModel.C | 228 + .../compressible/RAS/RASModel/RASModel.H | 339 + .../compressible/RAS/RASModel/newRASModel.C | 99 + .../RAS/RNGkEpsilon/RNGkEpsilon.C | 368 + .../RAS/RNGkEpsilon/RNGkEpsilon.H | 189 + .../RAS/SpalartAllmaras/SpalartAllmaras.C | 353 + .../RAS/SpalartAllmaras/SpalartAllmaras.H | 245 + .../backwardsCompatibilityWallFunctions.C | 286 + .../backwardsCompatibilityWallFunctions.H | 123 + ...wardsCompatibilityWallFunctionsTemplates.C | 166 + ...entHeatFluxTemperatureFvPatchScalarField.C | 203 + ...entHeatFluxTemperatureFvPatchScalarField.H | 176 + ...thDissipationRateInletFvPatchScalarField.C | 152 + ...thDissipationRateInletFvPatchScalarField.H | 167 + ...ngLengthFrequencyInletFvPatchScalarField.C | 158 + ...ngLengthFrequencyInletFvPatchScalarField.H | 171 + .../alphatWallFunctionFvPatchScalarField.C | 132 + .../alphatWallFunctionFvPatchScalarField.H | 155 + .../epsilonWallFunctionFvPatchScalarField.C | 218 + .../epsilonWallFunctionFvPatchScalarField.H | 164 + .../kQRWallFunctionFvPatchField.C | 155 + .../kQRWallFunctionFvPatchField.H | 170 + .../kQRWallFunctionFvPatchFields.C | 51 + .../kQRWallFunctionFvPatchFields.H | 56 + .../mutRoughWallFunctionFvPatchScalarField.C | 248 + .../mutRoughWallFunctionFvPatchScalarField.H | 194 + ...ndardRoughWallFunctionFvPatchScalarField.C | 314 + ...ndardRoughWallFunctionFvPatchScalarField.H | 208 + ...asStandardWallFunctionFvPatchScalarField.C | 175 + ...asStandardWallFunctionFvPatchScalarField.H | 158 + ...rtAllmarasWallFunctionFvPatchScalarField.C | 187 + ...rtAllmarasWallFunctionFvPatchScalarField.H | 150 + .../mutWallFunctionFvPatchScalarField.C | 162 + .../mutWallFunctionFvPatchScalarField.H | 155 + .../omegaWallFunctionFvPatchScalarField.C | 209 + .../omegaWallFunctionFvPatchScalarField.H | 159 + .../RAS/include/wallDissipationI.H | 51 + .../compressible/RAS/include/wallFunctionsI.H | 128 + .../compressible/RAS/include/wallViscosityI.H | 73 + .../compressible/RAS/kEpsilon/kEpsilon.C | 341 + .../compressible/RAS/kEpsilon/kEpsilon.H | 190 + .../compressible/RAS/kOmegaSST/kOmegaSST.C | 467 + .../compressible/RAS/kOmegaSST/kOmegaSST.H | 303 + .../compressible/RAS/laminar/laminar.C | 195 + .../compressible/RAS/laminar/laminar.H | 135 + .../RAS/realizableKE/realizableKE.C | 380 + .../RAS/realizableKE/realizableKE.H | 204 + src/turbulenceModels/incompressible/Allwmake | 9 + .../DeardorffDiffStress/DeardorffDiffStress.C | 151 + .../DeardorffDiffStress/DeardorffDiffStress.H | 139 + .../LES/GenEddyVisc/GenEddyVisc.C | 126 + .../LES/GenEddyVisc/GenEddyVisc.H | 140 + .../LES/GenSGSStress/GenSGSStress.C | 192 + .../LES/GenSGSStress/GenSGSStress.H | 148 + .../incompressible/LES/LESModel/LESModel.C | 186 + .../incompressible/LES/LESModel/LESModel.H | 277 + .../LES/LRRDiffStress/LRRDiffStress.C | 162 + .../LES/LRRDiffStress/LRRDiffStress.H | 138 + .../incompressible/LES/Make/files | 38 + .../incompressible/LES/Make/options | 14 + .../LES/Smagorinsky/Smagorinsky.C | 100 + .../LES/Smagorinsky/Smagorinsky.H | 140 + .../LES/Smagorinsky2/Smagorinsky2.C | 124 + .../LES/Smagorinsky2/Smagorinsky2.H | 130 + .../LES/SpalartAllmaras/SpalartAllmaras.C | 371 + .../LES/SpalartAllmaras/SpalartAllmaras.H | 189 + .../SpalartAllmarasDDES/SpalartAllmarasDDES.C | 120 + .../SpalartAllmarasDDES/SpalartAllmarasDDES.H | 118 + .../IDDESDelta/IDDESDelta.C | 140 + .../IDDESDelta/IDDESDelta.H | 113 + .../SpalartAllmarasIDDES.C | 214 + .../SpalartAllmarasIDDES.H | 132 + ...rtAllmarasWallFunctionFvPatchScalarField.C | 186 + ...rtAllmarasWallFunctionFvPatchScalarField.H | 157 + .../dynMixedSmagorinsky/dynMixedSmagorinsky.C | 142 + .../dynMixedSmagorinsky/dynMixedSmagorinsky.H | 150 + .../LES/dynOneEqEddy/dynOneEqEddy.C | 184 + .../LES/dynOneEqEddy/dynOneEqEddy.H | 154 + .../LES/dynSmagorinsky/dynSmagorinsky.C | 161 + .../LES/dynSmagorinsky/dynSmagorinsky.H | 154 + .../LES/kOmegaSSTSAS/kOmegaSSTSAS.C | 454 + .../LES/kOmegaSSTSAS/kOmegaSSTSAS.H | 258 + .../incompressible/LES/laminar/laminar.C | 166 + .../incompressible/LES/laminar/laminar.H | 129 + .../LES/locDynOneEqEddy/locDynOneEqEddy.C | 175 + .../LES/locDynOneEqEddy/locDynOneEqEddy.H | 172 + .../LES/mixedSmagorinsky/mixedSmagorinsky.C | 145 + .../LES/mixedSmagorinsky/mixedSmagorinsky.H | 155 + .../incompressible/LES/oneEqEddy/oneEqEddy.C | 132 + .../incompressible/LES/oneEqEddy/oneEqEddy.H | 147 + .../LES/scaleSimilarity/scaleSimilarity.C | 124 + .../LES/scaleSimilarity/scaleSimilarity.H | 133 + .../LES/spectEddyVisc/spectEddyVisc.C | 167 + .../LES/spectEddyVisc/spectEddyVisc.H | 137 + .../LES/vanDriestDelta/vanDriestDelta.C | 151 + .../LES/vanDriestDelta/vanDriestDelta.H | 113 + .../incompressible/RAS/LRR/LRR.C | 430 + .../incompressible/RAS/LRR/LRR.H | 187 + .../RAS/LamBremhorstKE/LamBremhorstKE.C | 277 + .../RAS/LamBremhorstKE/LamBremhorstKE.H | 164 + .../RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C | 471 + .../RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.H | 195 + .../RAS/LaunderSharmaKE/LaunderSharmaKE.C | 273 + .../RAS/LaunderSharmaKE/LaunderSharmaKE.H | 179 + .../RAS/LienCubicKE/LienCubicKE.C | 420 + .../RAS/LienCubicKE/LienCubicKE.H | 172 + .../RAS/LienCubicKELowRe/LienCubicKELowRe.C | 492 + .../RAS/LienCubicKELowRe/LienCubicKELowRe.H | 197 + .../LienCubicKELowReSetWallDissipation.H | 71 + .../LienLeschzinerLowRe/LienLeschzinerLowRe.C | 275 + .../LienLeschzinerLowRe/LienLeschzinerLowRe.H | 167 + .../LienLeschzinerLowReSetWallDissipation.H | 71 + .../incompressible/RAS/Make/files | 47 + .../incompressible/RAS/Make/options | 10 + .../RAS/NonlinearKEShih/NonlinearKEShih.C | 374 + .../RAS/NonlinearKEShih/NonlinearKEShih.H | 171 + .../incompressible/RAS/QZeta/QZeta.C | 327 + .../incompressible/RAS/QZeta/QZeta.H | 178 + .../incompressible/RAS/RASModel/RASModel.C | 268 + .../incompressible/RAS/RASModel/RASModel.H | 298 + .../RAS/RNGkEpsilon/RNGkEpsilon.C | 309 + .../RAS/RNGkEpsilon/RNGkEpsilon.H | 175 + .../RAS/SpalartAllmaras/SpalartAllmaras.C | 388 + .../RAS/SpalartAllmaras/SpalartAllmaras.H | 191 + .../backwardsCompatibilityWallFunctions.C | 215 + .../backwardsCompatibilityWallFunctions.H | 116 + ...wardsCompatibilityWallFunctionsTemplates.C | 166 + ...entHeatFluxTemperatureFvPatchScalarField.C | 191 + ...entHeatFluxTemperatureFvPatchScalarField.H | 179 + ...thDissipationRateInletFvPatchScalarField.C | 152 + ...thDissipationRateInletFvPatchScalarField.H | 167 + ...ngLengthFrequencyInletFvPatchScalarField.C | 158 + ...ngLengthFrequencyInletFvPatchScalarField.H | 171 + .../epsilonWallFunctionFvPatchScalarField.C | 213 + .../epsilonWallFunctionFvPatchScalarField.H | 164 + .../kQRWallFunctionFvPatchField.C | 155 + .../kQRWallFunctionFvPatchField.H | 170 + .../kQRWallFunctionFvPatchFields.C | 51 + .../kQRWallFunctionFvPatchFields.H | 56 + .../nutRoughWallFunctionFvPatchScalarField.C | 245 + .../nutRoughWallFunctionFvPatchScalarField.H | 194 + ...ndardRoughWallFunctionFvPatchScalarField.C | 302 + ...ndardRoughWallFunctionFvPatchScalarField.H | 208 + ...asStandardWallFunctionFvPatchScalarField.C | 172 + ...asStandardWallFunctionFvPatchScalarField.H | 160 + ...rtAllmarasWallFunctionFvPatchScalarField.C | 180 + ...rtAllmarasWallFunctionFvPatchScalarField.H | 153 + .../nutWallFunctionFvPatchScalarField.C | 157 + .../nutWallFunctionFvPatchScalarField.H | 155 + .../omegaWallFunctionFvPatchScalarField.C | 204 + .../omegaWallFunctionFvPatchScalarField.H | 159 + .../RAS/include/nonLinearWallFunctionsI.H | 127 + .../RAS/include/wallDissipationI.H | 51 + .../RAS/include/wallFunctionsI.H.old | 126 + .../RAS/include/wallNonlinearViscosityI.H | 70 + .../RAS/include/wallViscosityI.H.old | 70 + .../incompressible/RAS/kEpsilon/kEpsilon.C | 273 + .../incompressible/RAS/kEpsilon/kEpsilon.H | 175 + .../incompressible/RAS/kOmega/kOmega.C | 285 + .../incompressible/RAS/kOmega/kOmega.H | 209 + .../incompressible/RAS/kOmegaSST/kOmegaSST.C | 423 + .../incompressible/RAS/kOmegaSST/kOmegaSST.H | 289 + .../incompressible/RAS/laminar/laminar.C | 203 + .../incompressible/RAS/laminar/laminar.H | 122 + .../RAS/realizableKE/realizableKE.C | 338 + .../RAS/realizableKE/realizableKE.H | 192 + .../incompressible/turbulenceModel/Make/files | 5 + .../turbulenceModel/Make/options | 7 + .../turbulenceModel/laminar/laminar.C | 219 + .../turbulenceModel/laminar/laminar.H | 130 + .../turbulenceModel/newTurbulenceModel.C | 96 + .../turbulenceModel/turbulenceModel.C | 79 + .../turbulenceModel/turbulenceModel.H | 197 + tutorials/buoyantSimpleFoam/hotRoom/0/alphat | 42 + .../buoyantSimpleFoam/hotRoom/0/epsilon.old | 39 + tutorials/buoyantSimpleFoam/hotRoom/0/k.old | 39 + tutorials/buoyantSimpleFoam/hotRoom/0/mut | 42 + tutorials/interFoam/damBreak/0/alpha1 | 51 + tutorials/interFoam/damBreak/0/alpha1.org | 51 + .../damBreak/constant/turbulenceProperties | 19 + tutorials/interFoam/nozzleFlow2D/0/B | 57 + tutorials/interFoam/nozzleFlow2D/0/U | 57 + tutorials/interFoam/nozzleFlow2D/0/alpha1 | 57 + tutorials/interFoam/nozzleFlow2D/0/data/Ubulk | 0 .../interFoam/nozzleFlow2D/0/data/ptrace | 0 tutorials/interFoam/nozzleFlow2D/0/k | 58 + tutorials/interFoam/nozzleFlow2D/0/nuSgs | 54 + tutorials/interFoam/nozzleFlow2D/0/nuTilda | 58 + tutorials/interFoam/nozzleFlow2D/0/pd | 61 + tutorials/interFoam/nozzleFlow2D/Allclean | 7 + tutorials/interFoam/nozzleFlow2D/Allrun | 33 + .../nozzleFlow2D/constant/LESProperties | 178 + .../constant/environmentalProperties | 19 + .../constant/polyMesh/blockMeshDict | 114 + .../nozzleFlow2D/constant/polyMesh/boundary | 68 + .../constant/polyMesh/boundary.org | 68 + .../nozzleFlow2D/constant/polyMesh/sets/c0 | 7092 ++++++++ .../constant/polyMesh/sets/c0_old | 23 + .../constant/polyMesh/sets/refinedCells | 14161 ++++++++++++++++ .../nozzleFlow2D/constant/transportProperties | 68 + .../constant/turbulenceProperties | 19 + .../interFoam/nozzleFlow2D/system/cellSetDict | 29 + .../nozzleFlow2D/system/cellSetDict.1 | 29 + .../nozzleFlow2D/system/cellSetDict.2 | 29 + .../interFoam/nozzleFlow2D/system/controlDict | 53 + .../interFoam/nozzleFlow2D/system/fvSchemes | 63 + .../interFoam/nozzleFlow2D/system/fvSolution | 121 + .../nozzleFlow2D/system/refineMeshDict | 44 + 307 files changed, 64527 insertions(+) create mode 100644 applications/solvers/incompressible/channelFoam/Make/files create mode 100644 applications/solvers/incompressible/channelFoam/Make/options create mode 100644 applications/solvers/incompressible/channelFoam/channelFoam.C create mode 100644 applications/solvers/incompressible/channelFoam/createFields.H create mode 100644 applications/solvers/incompressible/channelFoam/createGradP.H create mode 100644 applications/solvers/incompressible/channelFoam/readTransportProperties.H create mode 100644 applications/solvers/incompressible/channelFoam/writeGradP.H create mode 100644 applications/solvers/incompressible/pimpleDyMFoam/Make/files create mode 100644 applications/solvers/incompressible/pimpleDyMFoam/Make/options create mode 100644 applications/solvers/incompressible/pimpleDyMFoam/UEqn.H create mode 100644 applications/solvers/incompressible/pimpleDyMFoam/correctPhi.H create mode 100644 applications/solvers/incompressible/pimpleDyMFoam/createFields.H create mode 100644 applications/solvers/incompressible/pimpleDyMFoam/pimpleDyMFoam.C create mode 100644 applications/solvers/incompressible/pimpleDyMFoam/readControls.H create mode 100644 applications/solvers/incompressible/pisoFoam/Make/files create mode 100644 applications/solvers/incompressible/pisoFoam/Make/options create mode 100644 applications/solvers/incompressible/pisoFoam/createFields.H create mode 100644 applications/solvers/incompressible/pisoFoam/pisoFoam.C create mode 100644 applications/solvers/multiphase/cavitatingFoam/CourantNo.H create mode 100644 applications/solvers/multiphase/cavitatingFoam/Make/files create mode 100644 applications/solvers/multiphase/cavitatingFoam/Make/options create mode 100644 applications/solvers/multiphase/cavitatingFoam/UEqn.H create mode 100644 applications/solvers/multiphase/cavitatingFoam/cavitatingFoam.C create mode 100644 applications/solvers/multiphase/cavitatingFoam/continuityErrs.H create mode 100644 applications/solvers/multiphase/cavitatingFoam/createFields.H create mode 100644 applications/solvers/multiphase/cavitatingFoam/gammaPsi.H create mode 100644 applications/solvers/multiphase/cavitatingFoam/pEqn.H create mode 100644 applications/solvers/multiphase/cavitatingFoam/readControls.H create mode 100644 applications/solvers/multiphase/cavitatingFoam/readThermodynamicProperties.H create mode 100644 applications/solvers/multiphase/cavitatingFoam/resetPhiPatches.H create mode 100644 applications/solvers/multiphase/cavitatingFoam/resetPhivPatches.H create mode 100644 applications/solvers/multiphase/cavitatingFoam/rhoEqn.H create mode 100644 applications/solvers/multiphase/cavitatingFoam/setDeltaT.H create mode 100644 applications/solvers/multiphase/cavitatingFoam/setInitialDeltaT.H create mode 100644 applications/solvers/multiphase/compressibleInterDyMFoam/Make/files create mode 100644 applications/solvers/multiphase/compressibleInterDyMFoam/Make/options create mode 100644 applications/solvers/multiphase/compressibleInterDyMFoam/UEqn.H create mode 100644 applications/solvers/multiphase/compressibleInterDyMFoam/alphaEqns.H create mode 100644 applications/solvers/multiphase/compressibleInterDyMFoam/alphaEqnsSubCycle.H create mode 100644 applications/solvers/multiphase/compressibleInterDyMFoam/compressibleInterDyMFoam.C create mode 100644 applications/solvers/multiphase/compressibleInterDyMFoam/createFields.H create mode 100644 applications/solvers/multiphase/compressibleInterDyMFoam/pEqn.H create mode 100644 applications/solvers/multiphase/compressibleInterDyMFoam/readControls.H create mode 100644 applications/solvers/multiphase/compressibleInterFoam/Make/files create mode 100644 applications/solvers/multiphase/compressibleInterFoam/Make/options create mode 100644 applications/solvers/multiphase/compressibleInterFoam/UEqn.H create mode 100644 applications/solvers/multiphase/compressibleInterFoam/alphaEqns.H create mode 100644 applications/solvers/multiphase/compressibleInterFoam/alphaEqnsSubCycle.H create mode 100644 applications/solvers/multiphase/compressibleInterFoam/compressibleInterFoam.C create mode 100644 applications/solvers/multiphase/compressibleInterFoam/createFields.H create mode 100644 applications/solvers/multiphase/compressibleInterFoam/pEqn.H create mode 100644 applications/solvers/multiphase/compressibleInterFoam/readControls.H create mode 100644 applications/solvers/multiphase/interFoam/alphaEqn.H create mode 100644 applications/solvers/multiphase/interFoam/alphaEqnSubCycle.H create mode 100644 applications/solvers/multiphase/interPhaseChangeFoam/alphaEqn.H create mode 100644 applications/solvers/multiphase/interPhaseChangeFoam/alphaEqnSubCycle.H create mode 100644 applications/solvers/multiphase/twoLiquidMixingFoam/alphaEqn.H create mode 100644 src/transportModels/interfaceProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.C create mode 100644 src/transportModels/interfaceProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.H create mode 100644 src/transportModels/interfaceProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.C create mode 100644 src/transportModels/interfaceProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.H create mode 100644 src/transportModels/interfaceProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.C create mode 100644 src/transportModels/interfaceProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.H create mode 100644 src/transportModels/interfaceProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.C create mode 100644 src/transportModels/interfaceProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.H create mode 100644 src/transportModels/interfaceProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.C create mode 100644 src/transportModels/interfaceProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.H create mode 100755 src/turbulenceModels/compressible/Allwmake create mode 100644 src/turbulenceModels/compressible/LES/DeardorffDiffStress/DeardorffDiffStress.C create mode 100644 src/turbulenceModels/compressible/LES/DeardorffDiffStress/DeardorffDiffStress.H create mode 100644 src/turbulenceModels/compressible/LES/GenEddyVisc/GenEddyVisc.C create mode 100644 src/turbulenceModels/compressible/LES/GenEddyVisc/GenEddyVisc.H create mode 100644 src/turbulenceModels/compressible/LES/GenSGSStress/GenSGSStress.C create mode 100644 src/turbulenceModels/compressible/LES/GenSGSStress/GenSGSStress.H create mode 100644 src/turbulenceModels/compressible/LES/LESModel/LESModel.C create mode 100644 src/turbulenceModels/compressible/LES/LESModel/LESModel.H create mode 100644 src/turbulenceModels/compressible/LES/LESModel/newLESModel.C create mode 100644 src/turbulenceModels/compressible/LES/Make/files create mode 100644 src/turbulenceModels/compressible/LES/Make/options create mode 100644 src/turbulenceModels/compressible/LES/Smagorinsky/Smagorinsky.C create mode 100644 src/turbulenceModels/compressible/LES/Smagorinsky/Smagorinsky.H create mode 100644 src/turbulenceModels/compressible/LES/SpalartAllmaras/SpalartAllmaras.C create mode 100644 src/turbulenceModels/compressible/LES/SpalartAllmaras/SpalartAllmaras.H create mode 100644 src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsSpalartAllmarasWallFunction/muSgsSpalartAllmarasWallFunctionFvPatchScalarField.C create mode 100644 src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsSpalartAllmarasWallFunction/muSgsSpalartAllmarasWallFunctionFvPatchScalarField.H create mode 100644 src/turbulenceModels/compressible/LES/dynOneEqEddy/dynOneEqEddy.C create mode 100644 src/turbulenceModels/compressible/LES/dynOneEqEddy/dynOneEqEddy.H create mode 100644 src/turbulenceModels/compressible/LES/lowReOneEqEddy/lowReOneEqEddy.C create mode 100644 src/turbulenceModels/compressible/LES/lowReOneEqEddy/lowReOneEqEddy.H create mode 100644 src/turbulenceModels/compressible/LES/oneEqEddy/oneEqEddy.C create mode 100644 src/turbulenceModels/compressible/LES/oneEqEddy/oneEqEddy.H create mode 100644 src/turbulenceModels/compressible/RAS/LRR/LRR.C create mode 100644 src/turbulenceModels/compressible/RAS/LRR/LRR.H create mode 100644 src/turbulenceModels/compressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C create mode 100644 src/turbulenceModels/compressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.H create mode 100644 src/turbulenceModels/compressible/RAS/LaunderSharmaKE/LaunderSharmaKE.C create mode 100644 src/turbulenceModels/compressible/RAS/LaunderSharmaKE/LaunderSharmaKE.H create mode 100644 src/turbulenceModels/compressible/RAS/Make/files create mode 100644 src/turbulenceModels/compressible/RAS/Make/options create mode 100644 src/turbulenceModels/compressible/RAS/RASModel/RASModel.C create mode 100644 src/turbulenceModels/compressible/RAS/RASModel/RASModel.H create mode 100644 src/turbulenceModels/compressible/RAS/RASModel/newRASModel.C create mode 100644 src/turbulenceModels/compressible/RAS/RNGkEpsilon/RNGkEpsilon.C create mode 100644 src/turbulenceModels/compressible/RAS/RNGkEpsilon/RNGkEpsilon.H create mode 100644 src/turbulenceModels/compressible/RAS/SpalartAllmaras/SpalartAllmaras.C create mode 100644 src/turbulenceModels/compressible/RAS/SpalartAllmaras/SpalartAllmaras.H create mode 100644 src/turbulenceModels/compressible/RAS/backwardsCompatibilityWallFunctions/backwardsCompatibilityWallFunctions.C create mode 100644 src/turbulenceModels/compressible/RAS/backwardsCompatibilityWallFunctions/backwardsCompatibilityWallFunctions.H create mode 100644 src/turbulenceModels/compressible/RAS/backwardsCompatibilityWallFunctions/backwardsCompatibilityWallFunctionsTemplates.C create mode 100644 src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C create mode 100644 src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.H create mode 100644 src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C create mode 100644 src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.H create mode 100644 src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C create mode 100644 src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H create mode 100644 src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.C create mode 100644 src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.H create mode 100644 src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C create mode 100644 src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.H create mode 100644 src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kQRWallFunctions/kQRWallFunction/kQRWallFunctionFvPatchField.C create mode 100644 src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kQRWallFunctions/kQRWallFunction/kQRWallFunctionFvPatchField.H create mode 100644 src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kQRWallFunctions/kQRWallFunction/kQRWallFunctionFvPatchFields.C create mode 100644 src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kQRWallFunctions/kQRWallFunction/kQRWallFunctionFvPatchFields.H create mode 100644 src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutRoughWallFunction/mutRoughWallFunctionFvPatchScalarField.C create mode 100644 src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutRoughWallFunction/mutRoughWallFunctionFvPatchScalarField.H create mode 100644 src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardRoughWallFunction/mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.C create mode 100644 src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardRoughWallFunction/mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.H create mode 100644 src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardWallFunction/mutSpalartAllmarasStandardWallFunctionFvPatchScalarField.C create mode 100644 src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardWallFunction/mutSpalartAllmarasStandardWallFunctionFvPatchScalarField.H create mode 100644 src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasWallFunction/mutSpalartAllmarasWallFunctionFvPatchScalarField.C create mode 100644 src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasWallFunction/mutSpalartAllmarasWallFunctionFvPatchScalarField.H create mode 100644 src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutWallFunction/mutWallFunctionFvPatchScalarField.C create mode 100644 src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutWallFunction/mutWallFunctionFvPatchScalarField.H create mode 100644 src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C create mode 100644 src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.H create mode 100644 src/turbulenceModels/compressible/RAS/include/wallDissipationI.H create mode 100644 src/turbulenceModels/compressible/RAS/include/wallFunctionsI.H create mode 100644 src/turbulenceModels/compressible/RAS/include/wallViscosityI.H create mode 100644 src/turbulenceModels/compressible/RAS/kEpsilon/kEpsilon.C create mode 100644 src/turbulenceModels/compressible/RAS/kEpsilon/kEpsilon.H create mode 100644 src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.C create mode 100644 src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.H create mode 100644 src/turbulenceModels/compressible/RAS/laminar/laminar.C create mode 100644 src/turbulenceModels/compressible/RAS/laminar/laminar.H create mode 100644 src/turbulenceModels/compressible/RAS/realizableKE/realizableKE.C create mode 100644 src/turbulenceModels/compressible/RAS/realizableKE/realizableKE.H create mode 100755 src/turbulenceModels/incompressible/Allwmake create mode 100644 src/turbulenceModels/incompressible/LES/DeardorffDiffStress/DeardorffDiffStress.C create mode 100644 src/turbulenceModels/incompressible/LES/DeardorffDiffStress/DeardorffDiffStress.H create mode 100644 src/turbulenceModels/incompressible/LES/GenEddyVisc/GenEddyVisc.C create mode 100644 src/turbulenceModels/incompressible/LES/GenEddyVisc/GenEddyVisc.H create mode 100644 src/turbulenceModels/incompressible/LES/GenSGSStress/GenSGSStress.C create mode 100644 src/turbulenceModels/incompressible/LES/GenSGSStress/GenSGSStress.H create mode 100644 src/turbulenceModels/incompressible/LES/LESModel/LESModel.C create mode 100644 src/turbulenceModels/incompressible/LES/LESModel/LESModel.H create mode 100644 src/turbulenceModels/incompressible/LES/LRRDiffStress/LRRDiffStress.C create mode 100644 src/turbulenceModels/incompressible/LES/LRRDiffStress/LRRDiffStress.H create mode 100644 src/turbulenceModels/incompressible/LES/Make/files create mode 100644 src/turbulenceModels/incompressible/LES/Make/options create mode 100644 src/turbulenceModels/incompressible/LES/Smagorinsky/Smagorinsky.C create mode 100644 src/turbulenceModels/incompressible/LES/Smagorinsky/Smagorinsky.H create mode 100644 src/turbulenceModels/incompressible/LES/Smagorinsky2/Smagorinsky2.C create mode 100644 src/turbulenceModels/incompressible/LES/Smagorinsky2/Smagorinsky2.H create mode 100644 src/turbulenceModels/incompressible/LES/SpalartAllmaras/SpalartAllmaras.C create mode 100644 src/turbulenceModels/incompressible/LES/SpalartAllmaras/SpalartAllmaras.H create mode 100644 src/turbulenceModels/incompressible/LES/SpalartAllmarasDDES/SpalartAllmarasDDES.C create mode 100644 src/turbulenceModels/incompressible/LES/SpalartAllmarasDDES/SpalartAllmarasDDES.H create mode 100644 src/turbulenceModels/incompressible/LES/SpalartAllmarasIDDES/IDDESDelta/IDDESDelta.C create mode 100644 src/turbulenceModels/incompressible/LES/SpalartAllmarasIDDES/IDDESDelta/IDDESDelta.H create mode 100644 src/turbulenceModels/incompressible/LES/SpalartAllmarasIDDES/SpalartAllmarasIDDES.C create mode 100644 src/turbulenceModels/incompressible/LES/SpalartAllmarasIDDES/SpalartAllmarasIDDES.H create mode 100644 src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsSpalartAllmarasWallFunction/nuSgsSpalartAllmarasWallFunctionFvPatchScalarField.C create mode 100644 src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsSpalartAllmarasWallFunction/nuSgsSpalartAllmarasWallFunctionFvPatchScalarField.H create mode 100644 src/turbulenceModels/incompressible/LES/dynMixedSmagorinsky/dynMixedSmagorinsky.C create mode 100644 src/turbulenceModels/incompressible/LES/dynMixedSmagorinsky/dynMixedSmagorinsky.H create mode 100644 src/turbulenceModels/incompressible/LES/dynOneEqEddy/dynOneEqEddy.C create mode 100644 src/turbulenceModels/incompressible/LES/dynOneEqEddy/dynOneEqEddy.H create mode 100644 src/turbulenceModels/incompressible/LES/dynSmagorinsky/dynSmagorinsky.C create mode 100644 src/turbulenceModels/incompressible/LES/dynSmagorinsky/dynSmagorinsky.H create mode 100644 src/turbulenceModels/incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.C create mode 100644 src/turbulenceModels/incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.H create mode 100644 src/turbulenceModels/incompressible/LES/laminar/laminar.C create mode 100644 src/turbulenceModels/incompressible/LES/laminar/laminar.H create mode 100644 src/turbulenceModels/incompressible/LES/locDynOneEqEddy/locDynOneEqEddy.C create mode 100644 src/turbulenceModels/incompressible/LES/locDynOneEqEddy/locDynOneEqEddy.H create mode 100644 src/turbulenceModels/incompressible/LES/mixedSmagorinsky/mixedSmagorinsky.C create mode 100644 src/turbulenceModels/incompressible/LES/mixedSmagorinsky/mixedSmagorinsky.H create mode 100644 src/turbulenceModels/incompressible/LES/oneEqEddy/oneEqEddy.C create mode 100644 src/turbulenceModels/incompressible/LES/oneEqEddy/oneEqEddy.H create mode 100644 src/turbulenceModels/incompressible/LES/scaleSimilarity/scaleSimilarity.C create mode 100644 src/turbulenceModels/incompressible/LES/scaleSimilarity/scaleSimilarity.H create mode 100644 src/turbulenceModels/incompressible/LES/spectEddyVisc/spectEddyVisc.C create mode 100644 src/turbulenceModels/incompressible/LES/spectEddyVisc/spectEddyVisc.H create mode 100644 src/turbulenceModels/incompressible/LES/vanDriestDelta/vanDriestDelta.C create mode 100644 src/turbulenceModels/incompressible/LES/vanDriestDelta/vanDriestDelta.H create mode 100644 src/turbulenceModels/incompressible/RAS/LRR/LRR.C create mode 100644 src/turbulenceModels/incompressible/RAS/LRR/LRR.H create mode 100644 src/turbulenceModels/incompressible/RAS/LamBremhorstKE/LamBremhorstKE.C create mode 100644 src/turbulenceModels/incompressible/RAS/LamBremhorstKE/LamBremhorstKE.H create mode 100644 src/turbulenceModels/incompressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C create mode 100644 src/turbulenceModels/incompressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.H create mode 100644 src/turbulenceModels/incompressible/RAS/LaunderSharmaKE/LaunderSharmaKE.C create mode 100644 src/turbulenceModels/incompressible/RAS/LaunderSharmaKE/LaunderSharmaKE.H create mode 100644 src/turbulenceModels/incompressible/RAS/LienCubicKE/LienCubicKE.C create mode 100644 src/turbulenceModels/incompressible/RAS/LienCubicKE/LienCubicKE.H create mode 100644 src/turbulenceModels/incompressible/RAS/LienCubicKELowRe/LienCubicKELowRe.C create mode 100644 src/turbulenceModels/incompressible/RAS/LienCubicKELowRe/LienCubicKELowRe.H create mode 100644 src/turbulenceModels/incompressible/RAS/LienCubicKELowRe/LienCubicKELowReSetWallDissipation.H create mode 100644 src/turbulenceModels/incompressible/RAS/LienLeschzinerLowRe/LienLeschzinerLowRe.C create mode 100644 src/turbulenceModels/incompressible/RAS/LienLeschzinerLowRe/LienLeschzinerLowRe.H create mode 100644 src/turbulenceModels/incompressible/RAS/LienLeschzinerLowRe/LienLeschzinerLowReSetWallDissipation.H create mode 100644 src/turbulenceModels/incompressible/RAS/Make/files create mode 100644 src/turbulenceModels/incompressible/RAS/Make/options create mode 100644 src/turbulenceModels/incompressible/RAS/NonlinearKEShih/NonlinearKEShih.C create mode 100644 src/turbulenceModels/incompressible/RAS/NonlinearKEShih/NonlinearKEShih.H create mode 100644 src/turbulenceModels/incompressible/RAS/QZeta/QZeta.C create mode 100644 src/turbulenceModels/incompressible/RAS/QZeta/QZeta.H create mode 100644 src/turbulenceModels/incompressible/RAS/RASModel/RASModel.C create mode 100644 src/turbulenceModels/incompressible/RAS/RASModel/RASModel.H create mode 100644 src/turbulenceModels/incompressible/RAS/RNGkEpsilon/RNGkEpsilon.C create mode 100644 src/turbulenceModels/incompressible/RAS/RNGkEpsilon/RNGkEpsilon.H create mode 100644 src/turbulenceModels/incompressible/RAS/SpalartAllmaras/SpalartAllmaras.C create mode 100644 src/turbulenceModels/incompressible/RAS/SpalartAllmaras/SpalartAllmaras.H create mode 100644 src/turbulenceModels/incompressible/RAS/backwardsCompatibilityWallFunctions/backwardsCompatibilityWallFunctions.C create mode 100644 src/turbulenceModels/incompressible/RAS/backwardsCompatibilityWallFunctions/backwardsCompatibilityWallFunctions.H create mode 100644 src/turbulenceModels/incompressible/RAS/backwardsCompatibilityWallFunctions/backwardsCompatibilityWallFunctionsTemplates.C create mode 100644 src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C create mode 100644 src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.H create mode 100644 src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C create mode 100644 src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.H create mode 100644 src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C create mode 100644 src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H create mode 100644 src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C create mode 100644 src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.H create mode 100644 src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kQRWallFunctions/kQRWallFunction/kQRWallFunctionFvPatchField.C create mode 100644 src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kQRWallFunctions/kQRWallFunction/kQRWallFunctionFvPatchField.H create mode 100644 src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kQRWallFunctions/kQRWallFunction/kQRWallFunctionFvPatchFields.C create mode 100644 src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kQRWallFunctions/kQRWallFunction/kQRWallFunctionFvPatchFields.H create mode 100644 src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutRoughWallFunction/nutRoughWallFunctionFvPatchScalarField.C create mode 100644 src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutRoughWallFunction/nutRoughWallFunctionFvPatchScalarField.H create mode 100644 src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasStandardRoughWallFunction/nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.C create mode 100644 src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasStandardRoughWallFunction/nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.H create mode 100644 src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasStandardWallFunction/nutSpalartAllmarasStandardWallFunctionFvPatchScalarField.C create mode 100644 src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasStandardWallFunction/nutSpalartAllmarasStandardWallFunctionFvPatchScalarField.H create mode 100644 src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasWallFunction/nutSpalartAllmarasWallFunctionFvPatchScalarField.C create mode 100644 src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasWallFunction/nutSpalartAllmarasWallFunctionFvPatchScalarField.H create mode 100644 src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.C create mode 100644 src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.H create mode 100644 src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C create mode 100644 src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.H create mode 100644 src/turbulenceModels/incompressible/RAS/include/nonLinearWallFunctionsI.H create mode 100644 src/turbulenceModels/incompressible/RAS/include/wallDissipationI.H create mode 100644 src/turbulenceModels/incompressible/RAS/include/wallFunctionsI.H.old create mode 100644 src/turbulenceModels/incompressible/RAS/include/wallNonlinearViscosityI.H create mode 100644 src/turbulenceModels/incompressible/RAS/include/wallViscosityI.H.old create mode 100644 src/turbulenceModels/incompressible/RAS/kEpsilon/kEpsilon.C create mode 100644 src/turbulenceModels/incompressible/RAS/kEpsilon/kEpsilon.H create mode 100644 src/turbulenceModels/incompressible/RAS/kOmega/kOmega.C create mode 100644 src/turbulenceModels/incompressible/RAS/kOmega/kOmega.H create mode 100644 src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C create mode 100644 src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.H create mode 100644 src/turbulenceModels/incompressible/RAS/laminar/laminar.C create mode 100644 src/turbulenceModels/incompressible/RAS/laminar/laminar.H create mode 100644 src/turbulenceModels/incompressible/RAS/realizableKE/realizableKE.C create mode 100644 src/turbulenceModels/incompressible/RAS/realizableKE/realizableKE.H create mode 100644 src/turbulenceModels/incompressible/turbulenceModel/Make/files create mode 100644 src/turbulenceModels/incompressible/turbulenceModel/Make/options create mode 100644 src/turbulenceModels/incompressible/turbulenceModel/laminar/laminar.C create mode 100644 src/turbulenceModels/incompressible/turbulenceModel/laminar/laminar.H create mode 100644 src/turbulenceModels/incompressible/turbulenceModel/newTurbulenceModel.C create mode 100644 src/turbulenceModels/incompressible/turbulenceModel/turbulenceModel.C create mode 100644 src/turbulenceModels/incompressible/turbulenceModel/turbulenceModel.H create mode 100644 tutorials/buoyantSimpleFoam/hotRoom/0/alphat create mode 100644 tutorials/buoyantSimpleFoam/hotRoom/0/epsilon.old create mode 100644 tutorials/buoyantSimpleFoam/hotRoom/0/k.old create mode 100644 tutorials/buoyantSimpleFoam/hotRoom/0/mut create mode 100644 tutorials/interFoam/damBreak/0/alpha1 create mode 100644 tutorials/interFoam/damBreak/0/alpha1.org create mode 100644 tutorials/interFoam/damBreak/constant/turbulenceProperties create mode 100644 tutorials/interFoam/nozzleFlow2D/0/B create mode 100644 tutorials/interFoam/nozzleFlow2D/0/U create mode 100644 tutorials/interFoam/nozzleFlow2D/0/alpha1 create mode 100644 tutorials/interFoam/nozzleFlow2D/0/data/Ubulk create mode 100644 tutorials/interFoam/nozzleFlow2D/0/data/ptrace create mode 100644 tutorials/interFoam/nozzleFlow2D/0/k create mode 100644 tutorials/interFoam/nozzleFlow2D/0/nuSgs create mode 100644 tutorials/interFoam/nozzleFlow2D/0/nuTilda create mode 100644 tutorials/interFoam/nozzleFlow2D/0/pd create mode 100755 tutorials/interFoam/nozzleFlow2D/Allclean create mode 100755 tutorials/interFoam/nozzleFlow2D/Allrun create mode 100644 tutorials/interFoam/nozzleFlow2D/constant/LESProperties create mode 100644 tutorials/interFoam/nozzleFlow2D/constant/environmentalProperties create mode 100644 tutorials/interFoam/nozzleFlow2D/constant/polyMesh/blockMeshDict create mode 100644 tutorials/interFoam/nozzleFlow2D/constant/polyMesh/boundary create mode 100644 tutorials/interFoam/nozzleFlow2D/constant/polyMesh/boundary.org create mode 100644 tutorials/interFoam/nozzleFlow2D/constant/polyMesh/sets/c0 create mode 100644 tutorials/interFoam/nozzleFlow2D/constant/polyMesh/sets/c0_old create mode 100644 tutorials/interFoam/nozzleFlow2D/constant/polyMesh/sets/refinedCells create mode 100644 tutorials/interFoam/nozzleFlow2D/constant/transportProperties create mode 100644 tutorials/interFoam/nozzleFlow2D/constant/turbulenceProperties create mode 100644 tutorials/interFoam/nozzleFlow2D/system/cellSetDict create mode 100644 tutorials/interFoam/nozzleFlow2D/system/cellSetDict.1 create mode 100644 tutorials/interFoam/nozzleFlow2D/system/cellSetDict.2 create mode 100644 tutorials/interFoam/nozzleFlow2D/system/controlDict create mode 100644 tutorials/interFoam/nozzleFlow2D/system/fvSchemes create mode 100644 tutorials/interFoam/nozzleFlow2D/system/fvSolution create mode 100644 tutorials/interFoam/nozzleFlow2D/system/refineMeshDict diff --git a/applications/solvers/incompressible/channelFoam/Make/files b/applications/solvers/incompressible/channelFoam/Make/files new file mode 100644 index 00000000000..35d5b4e617b --- /dev/null +++ b/applications/solvers/incompressible/channelFoam/Make/files @@ -0,0 +1,3 @@ +channelFoam.C + +EXE = $(FOAM_APPBIN)/channelFoam diff --git a/applications/solvers/incompressible/channelFoam/Make/options b/applications/solvers/incompressible/channelFoam/Make/options new file mode 100644 index 00000000000..594493ce211 --- /dev/null +++ b/applications/solvers/incompressible/channelFoam/Make/options @@ -0,0 +1,14 @@ +EXE_INC = \ + -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \ + -I$(LIB_SRC)/turbulenceModels/incompressible/LES/LESModel \ + -I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \ + -I$(LIB_SRC)/transportModels \ + -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/sampling/lnInclude + +EXE_LIBS = \ + -lincompressibleLESModels \ + -lincompressibleTransportModels \ + -lfiniteVolume \ + -lmeshTools diff --git a/applications/solvers/incompressible/channelFoam/channelFoam.C b/applications/solvers/incompressible/channelFoam/channelFoam.C new file mode 100644 index 00000000000..d21267b350a --- /dev/null +++ b/applications/solvers/incompressible/channelFoam/channelFoam.C @@ -0,0 +1,155 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Application + channelFoam + +Description + Incompressible LES solver for flow in a channel. + +\*---------------------------------------------------------------------------*/ + +#include "fvCFD.H" +#include "singlePhaseTransportModel.H" +#include "LESModel.H" +#include "IFstream.H" +#include "OFstream.H" +#include "Random.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ + #include "setRootCase.H" + #include "createTime.H" + #include "createMesh.H" + #include "readTransportProperties.H" + #include "createFields.H" + #include "initContinuityErrs.H" + #include "createGradP.H" + + Info<< "\nStarting time loop\n" << endl; + + for(runTime++; !runTime.end(); runTime++) + { + Info<< "Time = " << runTime.timeName() << nl << endl; + + #include "readPISOControls.H" + + #include "CourantNo.H" + + sgsModel->correct(); + + fvVectorMatrix UEqn + ( + fvm::ddt(U) + + fvm::div(phi, U) + + sgsModel->divDevBeff(U) + == + flowDirection*gradP + ); + + if (momentumPredictor) + { + solve(UEqn == -fvc::grad(p)); + } + + + // --- PISO loop + + volScalarField rUA = 1.0/UEqn.A(); + + for (int corr=0; corr<nCorr; corr++) + { + U = rUA*UEqn.H(); + phi = (fvc::interpolate(U) & mesh.Sf()) + + fvc::ddtPhiCorr(rUA, U, phi); + + adjustPhi(phi, U, p); + + for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + { + fvScalarMatrix pEqn + ( + fvm::laplacian(rUA, p) == fvc::div(phi) + ); + + pEqn.setReference(pRefCell, pRefValue); + + if (corr == nCorr-1 && nonOrth == nNonOrthCorr) + { + pEqn.solve(mesh.solver(p.name() + "Final")); + } + else + { + pEqn.solve(mesh.solver(p.name())); + } + + if (nonOrth == nNonOrthCorr) + { + phi -= pEqn.flux(); + } + } + + #include "continuityErrs.H" + + U -= rUA*fvc::grad(p); + U.correctBoundaryConditions(); + } + + + // Correct driving force for a constant mass flow rate + + // Extract the velocity in the flow direction + dimensionedScalar magUbarStar = + (flowDirection & U)().weightedAverage(mesh.V()); + + // Calculate the pressure gradient increment needed to + // adjust the average flow-rate to the correct value + dimensionedScalar gragPplus = + (magUbar - magUbarStar)/rUA.weightedAverage(mesh.V()); + + U += flowDirection*rUA*gragPplus; + + gradP += gragPplus; + + Info<< "Uncorrected Ubar = " << magUbarStar.value() << tab + << "pressure gradient = " << gradP.value() << endl; + + runTime.write(); + + #include "writeGradP.H" + + Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" + << " ClockTime = " << runTime.elapsedClockTime() << " s" + << nl << endl; + } + + Info<< "End\n" << endl; + + return(0); +} + + +// ************************************************************************* // diff --git a/applications/solvers/incompressible/channelFoam/createFields.H b/applications/solvers/incompressible/channelFoam/createFields.H new file mode 100644 index 00000000000..7099762cc2f --- /dev/null +++ b/applications/solvers/incompressible/channelFoam/createFields.H @@ -0,0 +1,43 @@ + Info<< "Reading field p\n" << endl; + volScalarField p + ( + IOobject + ( + "p", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + + + Info<< "Reading field U\n" << endl; + volVectorField U + ( + IOobject + ( + "U", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + +# include "createPhi.H" + + + label pRefCell = 0; + scalar pRefValue = 0.0; + setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue); + + + singlePhaseTransportModel laminarTransport(U, phi); + + autoPtr<incompressible::LESModel> sgsModel + ( + incompressible::LESModel::New(U, phi, laminarTransport) + ); diff --git a/applications/solvers/incompressible/channelFoam/createGradP.H b/applications/solvers/incompressible/channelFoam/createGradP.H new file mode 100644 index 00000000000..9bb9bb0ba28 --- /dev/null +++ b/applications/solvers/incompressible/channelFoam/createGradP.H @@ -0,0 +1,24 @@ + dimensionedScalar gradP + ( + "gradP", + dimensionSet(0, 1, -2, 0, 0), + 0.0 + ); + + + IFstream gradPFile + ( + runTime.path()/runTime.timeName()/"uniform"/"gradP.raw" + ); + + if(gradPFile.good()) + { + gradPFile >> gradP; + Info<< "Reading average pressure gradient" <<endl + << endl; + } + else + { + Info<< "Initializing with 0 pressure gradient" <<endl + << endl; + }; diff --git a/applications/solvers/incompressible/channelFoam/readTransportProperties.H b/applications/solvers/incompressible/channelFoam/readTransportProperties.H new file mode 100644 index 00000000000..c99d0ae4b5b --- /dev/null +++ b/applications/solvers/incompressible/channelFoam/readTransportProperties.H @@ -0,0 +1,28 @@ + Info<< "\nReading transportProperties\n" << endl; + IOdictionary transportProperties + ( + IOobject + ( + "transportProperties", + runTime.constant(), + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE + ) + ); + + + dimensionedScalar nu + ( + transportProperties.lookup("nu") + ); + + + // Read centerline velocity for channel simulations + dimensionedVector Ubar + ( + transportProperties.lookup("Ubar") + ); + + dimensionedScalar magUbar = mag(Ubar); + vector flowDirection = (Ubar/magUbar).value(); diff --git a/applications/solvers/incompressible/channelFoam/writeGradP.H b/applications/solvers/incompressible/channelFoam/writeGradP.H new file mode 100644 index 00000000000..c82dd534740 --- /dev/null +++ b/applications/solvers/incompressible/channelFoam/writeGradP.H @@ -0,0 +1,19 @@ + if (runTime.outputTime()) + { + OFstream gradPFile + ( + runTime.path()/runTime.timeName()/"uniform"/"gradP.raw" + ); + + if(gradPFile.good()) + { + gradPFile << gradP << endl; + } + else + { + FatalErrorIn(args.executable()) + << "Cannot open file " + << runTime.path()/runTime.timeName()/"uniform"/"gradP.raw" + << exit(FatalError); + }; + }; diff --git a/applications/solvers/incompressible/pimpleDyMFoam/Make/files b/applications/solvers/incompressible/pimpleDyMFoam/Make/files new file mode 100644 index 00000000000..c1edb235e6e --- /dev/null +++ b/applications/solvers/incompressible/pimpleDyMFoam/Make/files @@ -0,0 +1,3 @@ +pimpleDyMFoam.C + +EXE = $(FOAM_APPBIN)/pimpleDyMFoam diff --git a/applications/solvers/incompressible/pimpleDyMFoam/Make/options b/applications/solvers/incompressible/pimpleDyMFoam/Make/options new file mode 100644 index 00000000000..e14eec25850 --- /dev/null +++ b/applications/solvers/incompressible/pimpleDyMFoam/Make/options @@ -0,0 +1,17 @@ +EXE_INC = \ + -I$(LIB_SRC)/dynamicFvMesh/lnInclude \ + -I$(LIB_SRC)/dynamicMesh/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \ + -I$(LIB_SRC)/transportModels \ + -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \ + -I$(LIB_SRC)/finiteVolume/lnInclude + +EXE_LIBS = \ + -ldynamicFvMesh \ + -ldynamicMesh \ + -lmeshTools \ + -lincompressibleTransportModels \ + -lincompressibleRASModels \ + -lincompressibleLESModels \ + -lfiniteVolume diff --git a/applications/solvers/incompressible/pimpleDyMFoam/UEqn.H b/applications/solvers/incompressible/pimpleDyMFoam/UEqn.H new file mode 100644 index 00000000000..2876a48b524 --- /dev/null +++ b/applications/solvers/incompressible/pimpleDyMFoam/UEqn.H @@ -0,0 +1,16 @@ + fvVectorMatrix UEqn + ( + fvm::ddt(U) + + fvm::div(phi, U) + + turbulence->divDevReff(U) + ); + + if (ocorr != nOuterCorr-1) + { + UEqn.relax(); + } + + if (momentumPredictor) + { + solve(UEqn == -fvc::grad(p)); + } diff --git a/applications/solvers/incompressible/pimpleDyMFoam/correctPhi.H b/applications/solvers/incompressible/pimpleDyMFoam/correctPhi.H new file mode 100644 index 00000000000..493c4e09297 --- /dev/null +++ b/applications/solvers/incompressible/pimpleDyMFoam/correctPhi.H @@ -0,0 +1,44 @@ +{ + wordList pcorrTypes(p.boundaryField().types()); + + for (label i=0; i<p.boundaryField().size(); i++) + { + if(p.boundaryField()[i].fixesValue()) + { + pcorrTypes[i] = fixedValueFvPatchScalarField::typeName; + } + } + + volScalarField pcorr + ( + IOobject + ( + "pcorr", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + dimensionedScalar("pcorr", p.dimensions(), 0.0), + pcorrTypes + ); + + for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + { + fvScalarMatrix pcorrEqn + ( + fvm::laplacian(rAU, pcorr) == fvc::div(phi) + ); + + pcorrEqn.setReference(pRefCell, pRefValue); + pcorrEqn.solve(); + + if (nonOrth == nNonOrthCorr) + { + phi -= pcorrEqn.flux(); + } + } +} + +#include "continuityErrs.H" diff --git a/applications/solvers/incompressible/pimpleDyMFoam/createFields.H b/applications/solvers/incompressible/pimpleDyMFoam/createFields.H new file mode 100644 index 00000000000..ff3f9c51696 --- /dev/null +++ b/applications/solvers/incompressible/pimpleDyMFoam/createFields.H @@ -0,0 +1,59 @@ + + Info<< "Reading field p\n" << endl; + volScalarField p + ( + IOobject + ( + "p", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + + + Info<< "Reading field U\n" << endl; + volVectorField U + ( + IOobject + ( + "U", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + +# include "createPhi.H" + + + label pRefCell = 0; + scalar pRefValue = 0.0; + setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue); + + singlePhaseTransportModel laminarTransport(U, phi); + + autoPtr<incompressible::turbulenceModel> turbulence + ( + incompressible::turbulenceModel::New(U, phi, laminarTransport) + ); + + Info<< "Reading field rAU if present\n" << endl; + volScalarField rAU + ( + IOobject + ( + "rAU", + runTime.timeName(), + mesh, + IOobject::READ_IF_PRESENT, + IOobject::AUTO_WRITE + ), + mesh, + runTime.deltaT(), + zeroGradientFvPatchScalarField::typeName + ); diff --git a/applications/solvers/incompressible/pimpleDyMFoam/pimpleDyMFoam.C b/applications/solvers/incompressible/pimpleDyMFoam/pimpleDyMFoam.C new file mode 100644 index 00000000000..42aae85309e --- /dev/null +++ b/applications/solvers/incompressible/pimpleDyMFoam/pimpleDyMFoam.C @@ -0,0 +1,172 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Application + turbDyMFoam + +Description + Transient solver for incompressible, flow of Newtonian fluids + on a moving mesh using the PIMPLE (merged PISO-SIMPLE) algorithm. + + Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected. + +\*---------------------------------------------------------------------------*/ + +#include "fvCFD.H" +#include "singlePhaseTransportModel.H" +#include "turbulenceModel.H" +#include "dynamicFvMesh.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ + +# include "setRootCase.H" + +# include "createTime.H" +# include "createDynamicFvMesh.H" +# include "readPISOControls.H" +# include "initContinuityErrs.H" +# include "createFields.H" +# include "readTimeControls.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + Info<< "\nStarting time loop\n" << endl; + + while (runTime.run()) + { +# include "readControls.H" +# include "CourantNo.H" + + // Make the fluxes absolute + fvc::makeAbsolute(phi, U); + +# include "setDeltaT.H" + + runTime++; + + Info<< "Time = " << runTime.timeName() << nl << endl; + + mesh.update(); + + if (mesh.changing() && correctPhi) + { +# include "correctPhi.H" + } + + // Make the fluxes relative to the mesh motion + fvc::makeRelative(phi, U); + + if (mesh.changing() && checkMeshCourantNo) + { +# include "meshCourantNo.H" + } + + // --- PIMPLE loop + for (int ocorr=0; ocorr<nOuterCorr; ocorr++) + { + if (nOuterCorr != 1) + { + p.storePrevIter(); + } + +# include "UEqn.H" + + // --- PISO loop + for (int corr=0; corr<nCorr; corr++) + { + rAU = 1.0/UEqn.A(); + + U = rAU*UEqn.H(); + phi = (fvc::interpolate(U) & mesh.Sf()); + + if (p.needReference()) + { + fvc::makeRelative(phi, U); + adjustPhi(phi, U, p); + fvc::makeAbsolute(phi, U); + } + + for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + { + fvScalarMatrix pEqn + ( + fvm::laplacian(rAU, p) == fvc::div(phi) + ); + + pEqn.setReference(pRefCell, pRefValue); + + if + ( + ocorr == nOuterCorr-1 + && corr == nCorr-1 + && nonOrth == nNonOrthCorr) + { + pEqn.solve(mesh.solver(p.name() + "Final")); + } + else + { + pEqn.solve(mesh.solver(p.name())); + } + + if (nonOrth == nNonOrthCorr) + { + phi -= pEqn.flux(); + } + } + +# include "continuityErrs.H" + + // Explicitly relax pressure for momentum corrector + if (ocorr != nOuterCorr-1) + { + p.relax(); + } + + // Make the fluxes relative to the mesh motion + fvc::makeRelative(phi, U); + + U -= rAU*fvc::grad(p); + U.correctBoundaryConditions(); + } + } + + turbulence->correct(); + + runTime.write(); + + Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" + << " ClockTime = " << runTime.elapsedClockTime() << " s" + << nl << endl; + } + + Info<< "End\n" << endl; + + return(0); +} + + +// ************************************************************************* // diff --git a/applications/solvers/incompressible/pimpleDyMFoam/readControls.H b/applications/solvers/incompressible/pimpleDyMFoam/readControls.H new file mode 100644 index 00000000000..9336616a1be --- /dev/null +++ b/applications/solvers/incompressible/pimpleDyMFoam/readControls.H @@ -0,0 +1,14 @@ +# include "readTimeControls.H" +# include "readPISOControls.H" + + bool correctPhi = false; + if (piso.found("correctPhi")) + { + correctPhi = Switch(piso.lookup("correctPhi")); + } + + bool checkMeshCourantNo = false; + if (piso.found("checkMeshCourantNo")) + { + checkMeshCourantNo = Switch(piso.lookup("checkMeshCourantNo")); + } diff --git a/applications/solvers/incompressible/pisoFoam/Make/files b/applications/solvers/incompressible/pisoFoam/Make/files new file mode 100644 index 00000000000..d9fdfd28ce9 --- /dev/null +++ b/applications/solvers/incompressible/pisoFoam/Make/files @@ -0,0 +1,3 @@ +pisoFoam.C + +EXE = $(FOAM_APPBIN)/pisoFoam diff --git a/applications/solvers/incompressible/pisoFoam/Make/options b/applications/solvers/incompressible/pisoFoam/Make/options new file mode 100644 index 00000000000..419f1ffcbab --- /dev/null +++ b/applications/solvers/incompressible/pisoFoam/Make/options @@ -0,0 +1,12 @@ +EXE_INC = \ + -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \ + -I$(LIB_SRC)/transportModels \ + -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \ + -I$(LIB_SRC)/finiteVolume/lnInclude + +EXE_LIBS = \ + -lincompressibleRASModels \ + -lincompressibleLESModels \ + -lincompressibleTransportModels \ + -lfiniteVolume \ + -lmeshTools diff --git a/applications/solvers/incompressible/pisoFoam/createFields.H b/applications/solvers/incompressible/pisoFoam/createFields.H new file mode 100644 index 00000000000..7cae304f6f6 --- /dev/null +++ b/applications/solvers/incompressible/pisoFoam/createFields.H @@ -0,0 +1,42 @@ + Info<< "Reading field p\n" << endl; + volScalarField p + ( + IOobject + ( + "p", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + + Info<< "Reading field U\n" << endl; + volVectorField U + ( + IOobject + ( + "U", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + +# include "createPhi.H" + + + label pRefCell = 0; + scalar pRefValue = 0.0; + setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue); + + + singlePhaseTransportModel laminarTransport(U, phi); + + autoPtr<incompressible::turbulenceModel> turbulence + ( + incompressible::turbulenceModel::New(U, phi, laminarTransport) + ); diff --git a/applications/solvers/incompressible/pisoFoam/pisoFoam.C b/applications/solvers/incompressible/pisoFoam/pisoFoam.C new file mode 100644 index 00000000000..1c8a534db27 --- /dev/null +++ b/applications/solvers/incompressible/pisoFoam/pisoFoam.C @@ -0,0 +1,131 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Application + turbFoam + +Description + Transient solver for incompressible flow. + + Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected. + +\*---------------------------------------------------------------------------*/ + +#include "fvCFD.H" +#include "singlePhaseTransportModel.H" +#include "turbulenceModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ + +# include "setRootCase.H" + +# include "createTime.H" +# include "createMesh.H" +# include "createFields.H" +# include "initContinuityErrs.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + Info<< "\nStarting time loop\n" << endl; + + for (runTime++; !runTime.end(); runTime++) + { + Info<< "Time = " << runTime.timeName() << nl << endl; + +# include "readPISOControls.H" +# include "CourantNo.H" + + // Pressure-velocity PISO corrector + { + // Momentum predictor + + fvVectorMatrix UEqn + ( + fvm::ddt(U) + + fvm::div(phi, U) + + turbulence->divDevReff(U) + ); + + if (momentumPredictor) + { + solve(UEqn == -fvc::grad(p)); + } + + // --- PISO loop + + for (int corr=0; corr<nCorr; corr++) + { + volScalarField rUA = 1.0/UEqn.A(); + + U = rUA*UEqn.H(); + phi = (fvc::interpolate(U) & mesh.Sf()) + + fvc::ddtPhiCorr(rUA, U, phi); + + adjustPhi(phi, U, p); + + // Non-orthogonal pressure corrector loop + for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + { + // Pressure corrector + + fvScalarMatrix pEqn + ( + fvm::laplacian(rUA, p) == fvc::div(phi) + ); + + pEqn.setReference(pRefCell, pRefValue); + pEqn.solve(); + + if (nonOrth == nNonOrthCorr) + { + phi -= pEqn.flux(); + } + } + +# include "continuityErrs.H" + + U -= rUA*fvc::grad(p); + U.correctBoundaryConditions(); + } + } + + turbulence->correct(); + + runTime.write(); + + Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" + << " ClockTime = " << runTime.elapsedClockTime() << " s" + << nl << endl; + } + + Info<< "End\n" << endl; + + return(0); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/cavitatingFoam/CourantNo.H b/applications/solvers/multiphase/cavitatingFoam/CourantNo.H new file mode 100644 index 00000000000..014944e191f --- /dev/null +++ b/applications/solvers/multiphase/cavitatingFoam/CourantNo.H @@ -0,0 +1,59 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Global + CourantNo + +Description + Calculates and outputs the mean and maximum Courant Numbers. + +\*---------------------------------------------------------------------------*/ + +scalar CoNum = 0.0; +scalar meanCoNum = 0.0; +scalar acousticCoNum = 0.0; + +if (mesh.nInternalFaces()) +{ + surfaceScalarField SfUfbyDelta = + mesh.surfaceInterpolation::deltaCoeffs()*mag(phiv); + + CoNum = max(SfUfbyDelta/mesh.magSf()) + .value()*runTime.deltaT().value(); + + meanCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf())) + .value()*runTime.deltaT().value(); + + acousticCoNum = max + ( + mesh.surfaceInterpolation::deltaCoeffs()/sqrt(fvc::interpolate(psi)) + ).value()*runTime.deltaT().value(); +} + +Info<< "phiv Courant Number mean: " << meanCoNum + << " max: " << CoNum + << " acoustic max: " << acousticCoNum + << endl; + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/cavitatingFoam/Make/files b/applications/solvers/multiphase/cavitatingFoam/Make/files new file mode 100644 index 00000000000..832391f03f0 --- /dev/null +++ b/applications/solvers/multiphase/cavitatingFoam/Make/files @@ -0,0 +1,3 @@ +cavitatingFoam.C + +EXE = $(FOAM_APPBIN)/cavitatingFoam diff --git a/applications/solvers/multiphase/cavitatingFoam/Make/options b/applications/solvers/multiphase/cavitatingFoam/Make/options new file mode 100644 index 00000000000..9cb749d63c1 --- /dev/null +++ b/applications/solvers/multiphase/cavitatingFoam/Make/options @@ -0,0 +1,14 @@ +EXE_INC = \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/transportModels \ + -I$(LIB_SRC)/transportModels/incompressible/lnInclude \ + -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \ + -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \ + -I$(LIB_SRC)/thermophysicalModels/barotropicCompressibilityModel/lnInclude + +EXE_LIBS = \ + -lincompressibleTransportModels \ + -lincompressibleRASModels \ + -lincompressibleLESModels \ + -lfiniteVolume \ + -lbarotropicCompressibilityModel diff --git a/applications/solvers/multiphase/cavitatingFoam/UEqn.H b/applications/solvers/multiphase/cavitatingFoam/UEqn.H new file mode 100644 index 00000000000..11eaf617bc6 --- /dev/null +++ b/applications/solvers/multiphase/cavitatingFoam/UEqn.H @@ -0,0 +1,22 @@ + surfaceScalarField muEff + ( + "muEff", + twoPhaseProperties.muf() + + fvc::interpolate(rho*turbulence->nut()) + ); + + fvVectorMatrix UEqn + ( + fvm::ddt(rho, U) + + fvm::div(phi, U) + - fvm::laplacian(muEff, U) + //- (fvc::grad(U) & fvc::grad(muf)) + - fvc::div(muEff*(fvc::interpolate(dev(fvc::grad(U))) & mesh.Sf())) + ); + + UEqn.relax(); + + if (momentumPredictor) + { + solve(UEqn == -fvc::grad(p)); + } diff --git a/applications/solvers/multiphase/cavitatingFoam/cavitatingFoam.C b/applications/solvers/multiphase/cavitatingFoam/cavitatingFoam.C new file mode 100644 index 00000000000..36ced22ada6 --- /dev/null +++ b/applications/solvers/multiphase/cavitatingFoam/cavitatingFoam.C @@ -0,0 +1,96 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Application + cavitatingFoam + +Description + Transient cavitation code based on the barotropic equation of state. + + Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected. + +\*---------------------------------------------------------------------------*/ + +#include "fvCFD.H" +#include "barotropicCompressibilityModel.H" +#include "twoPhaseMixture.H" +#include "turbulenceModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ + +# include "setRootCase.H" + +# include "createTime.H" +# include "createMesh.H" +# include "readThermodynamicProperties.H" +# include "readControls.H" +# include "createFields.H" +# include "initContinuityErrs.H" +# include "compressibleCourantNo.H" +# include "setInitialDeltaT.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + Info<< "\nStarting time loop\n" << endl; + + while (runTime.run()) + { +# include "readControls.H" +# include "CourantNo.H" +# include "setDeltaT.H" + + runTime++; + Info<< "Time = " << runTime.timeName() << nl << endl; + + for (int outerCorr=0; outerCorr<nOuterCorr; outerCorr++) + { +# include "rhoEqn.H" +# include "gammaPsi.H" +# include "UEqn.H" + + for (int corr=0; corr<nCorr; corr++) + { +# include "pEqn.H" + } + } + + turbulence->correct(); + + runTime.write(); + + Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" + << " ClockTime = " << runTime.elapsedClockTime() << " s" + << nl << endl; + } + + Info<< "\n end \n"; + + return(0); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/cavitatingFoam/continuityErrs.H b/applications/solvers/multiphase/cavitatingFoam/continuityErrs.H new file mode 100644 index 00000000000..6f1622510f6 --- /dev/null +++ b/applications/solvers/multiphase/cavitatingFoam/continuityErrs.H @@ -0,0 +1,22 @@ +{ + volScalarField thermoRho = psi*p + (1.0 - gamma)*rhol0; + + dimensionedScalar totalMass = fvc::domainIntegrate(rho); + + scalar sumLocalContErr = + ( + fvc::domainIntegrate(mag(rho - thermoRho))/totalMass + ).value(); + + scalar globalContErr = + ( + fvc::domainIntegrate(rho - thermoRho)/totalMass + ).value(); + + cumulativeContErr += globalContErr; + + Info<< "time step continuity errors : sum local = " << sumLocalContErr + << ", global = " << globalContErr + << ", cumulative = " << cumulativeContErr + << endl; +} diff --git a/applications/solvers/multiphase/cavitatingFoam/createFields.H b/applications/solvers/multiphase/cavitatingFoam/createFields.H new file mode 100644 index 00000000000..dc2f5e69612 --- /dev/null +++ b/applications/solvers/multiphase/cavitatingFoam/createFields.H @@ -0,0 +1,85 @@ + Info<< "Reading field p\n" << endl; + volScalarField p + ( + IOobject + ( + "p", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + + volScalarField rho + ( + IOobject + ( + "rho", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + + volScalarField gamma + ( + IOobject + ( + "gamma", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + max(min((rho - rholSat)/(rhovSat - rholSat), scalar(1)), scalar(0)) + ); + gamma.oldTime(); + + Info<< "Creating compressibilityModel\n" << endl; + autoPtr<barotropicCompressibilityModel> psiModel = + barotropicCompressibilityModel::New + ( + thermodynamicProperties, + gamma + ); + + const volScalarField& psi = psiModel->psi(); + + rho == max + ( + psi*p + + (1.0 - gamma)*rhol0 + + ((gamma*psiv + (1.0 - gamma)*psil) - psi)*pSat, + rhoMin + ); + + Info<< "Reading field U\n" << endl; + volVectorField U + ( + IOobject + ( + "U", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + +# include "createPhiv.H" +# include "compressibleCreatePhi.H" + + Info<< "Reading transportProperties\n" << endl; + + twoPhaseMixture twoPhaseProperties(U, phiv, "gamma"); + + // Create incompressible turbulence model + autoPtr<incompressible::turbulenceModel> turbulence + ( + incompressible::turbulenceModel::New(U, phiv, twoPhaseProperties) + ); diff --git a/applications/solvers/multiphase/cavitatingFoam/gammaPsi.H b/applications/solvers/multiphase/cavitatingFoam/gammaPsi.H new file mode 100644 index 00000000000..b259ddd3222 --- /dev/null +++ b/applications/solvers/multiphase/cavitatingFoam/gammaPsi.H @@ -0,0 +1,10 @@ +{ + gamma = max(min((rho - rholSat)/(rhovSat - rholSat), scalar(1)), scalar(0)); + + Info<< "max-min gamma: " << max(gamma).value() + << " " << min(gamma).value() << endl; + + psiModel->correct(); + + //Info<< "min a: " << 1.0/sqrt(max(psi)).value() << endl; +} diff --git a/applications/solvers/multiphase/cavitatingFoam/pEqn.H b/applications/solvers/multiphase/cavitatingFoam/pEqn.H new file mode 100644 index 00000000000..c9382dfc0fb --- /dev/null +++ b/applications/solvers/multiphase/cavitatingFoam/pEqn.H @@ -0,0 +1,80 @@ +{ + if (nOuterCorr == 1) + { + p = + ( + rho + - (1.0 - gamma)*rhol0 + - ((gamma*psiv + (1.0 - gamma)*psil) - psi)*pSat + )/psi; + } + + surfaceScalarField rhof = fvc::interpolate(rho, "rhof"); + + volScalarField rUA = 1.0/UEqn.A(); + surfaceScalarField rUAf("rUAf", rhof*fvc::interpolate(rUA)); + volVectorField HbyA = rUA*UEqn.H(); + + phiv = (fvc::interpolate(HbyA) & mesh.Sf()) + + fvc::ddtPhiCorr(rUA, rho, U, phiv); + + p.boundaryField().updateCoeffs(); + + surfaceScalarField phiGradp = rUAf*mesh.magSf()*fvc::snGrad(p); + + phiv -= phiGradp/rhof; + +# include "resetPhivPatches.H" + + for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + { + fvScalarMatrix pEqn + ( + fvm::ddt(psi, p) + - (rhol0 + (psil - psiv)*pSat)*fvc::ddt(gamma) - pSat*fvc::ddt(psi) + + fvc::div(phiv, rho) + + fvc::div(phiGradp) + - fvm::laplacian(rUAf, p) + ); + + pEqn.solve(); + + if (nonOrth == nNonOrthCorr) + { + phiv += (phiGradp + pEqn.flux())/rhof; + } + } + + Info<< "max-min p: " << max(p).value() + << " " << min(p).value() << endl; + + + U = HbyA - rUA*fvc::grad(p); + + // Remove the swirl component of velocity for "wedge" cases + if (piso.found("removeSwirl")) + { + label swirlCmpt(readLabel(piso.lookup("removeSwirl"))); + + Info<< "Removing swirl component-" << swirlCmpt << " of U" << endl; + U.field().replace(swirlCmpt, 0.0); + } + + U.correctBoundaryConditions(); + + Info<< "max(U) " << max(mag(U)).value() << endl; + + rho == max + ( + psi*p + + (1.0 - gamma)*rhol0 + + ((gamma*psiv + (1.0 - gamma)*psil) - psi)*pSat, + rhoMin + ); + + Info<< "max-min rho: " << max(rho).value() + << " " << min(rho).value() << endl; + +# include "gammaPsi.H" + +} diff --git a/applications/solvers/multiphase/cavitatingFoam/readControls.H b/applications/solvers/multiphase/cavitatingFoam/readControls.H new file mode 100644 index 00000000000..f53e7b9eb1c --- /dev/null +++ b/applications/solvers/multiphase/cavitatingFoam/readControls.H @@ -0,0 +1,9 @@ +#include "readTimeControls.H" + +scalar maxAcousticCo +( + readScalar(runTime.controlDict().lookup("maxAcousticCo")) +); + + +#include "readPISOControls.H" diff --git a/applications/solvers/multiphase/cavitatingFoam/readThermodynamicProperties.H b/applications/solvers/multiphase/cavitatingFoam/readThermodynamicProperties.H new file mode 100644 index 00000000000..d3fbb9307aa --- /dev/null +++ b/applications/solvers/multiphase/cavitatingFoam/readThermodynamicProperties.H @@ -0,0 +1,27 @@ + Info<< "Reading thermodynamicProperties\n" << endl; + + IOdictionary thermodynamicProperties + ( + IOobject + ( + "thermodynamicProperties", + runTime.constant(), + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE + ) + ); + + dimensionedScalar psil(thermodynamicProperties.lookup("psil")); + + dimensionedScalar rholSat(thermodynamicProperties.lookup("rholSat")); + + dimensionedScalar psiv(thermodynamicProperties.lookup("psiv")); + + dimensionedScalar pSat(thermodynamicProperties.lookup("pSat")); + + dimensionedScalar rhovSat("rhovSat", psiv*pSat); + + dimensionedScalar rhol0("rhol0", rholSat - pSat*psil); + + dimensionedScalar rhoMin(thermodynamicProperties.lookup("rhoMin")); diff --git a/applications/solvers/multiphase/cavitatingFoam/resetPhiPatches.H b/applications/solvers/multiphase/cavitatingFoam/resetPhiPatches.H new file mode 100644 index 00000000000..e7d0c2f93ea --- /dev/null +++ b/applications/solvers/multiphase/cavitatingFoam/resetPhiPatches.H @@ -0,0 +1,15 @@ +fvsPatchScalarFieldField& phiPatches = phi.boundaryField(); +const fvPatchScalarFieldField& rhoPatches = rho.boundaryField(); +const fvPatchVectorFieldField& Upatches = U.boundaryField(); +const fvsPatchVectorFieldField& SfPatches = mesh.Sf().boundaryField(); + +forAll(phiPatches, patchI) +{ + if (phi.boundaryField().types()[patchI] == "calculated") + { + calculatedFvsPatchScalarField& phiPatch = + refCast<calculatedFvsPatchScalarField>(phiPatches[patchI]); + + phiPatch == ((rhoPatches[patchI]*Upatches[patchI]) & SfPatches[patchI]); + } +} diff --git a/applications/solvers/multiphase/cavitatingFoam/resetPhivPatches.H b/applications/solvers/multiphase/cavitatingFoam/resetPhivPatches.H new file mode 100644 index 00000000000..7e8b040bb6e --- /dev/null +++ b/applications/solvers/multiphase/cavitatingFoam/resetPhivPatches.H @@ -0,0 +1,14 @@ +surfaceScalarField::GeometricBoundaryField& phivPatches = phiv.boundaryField(); +const volVectorField::GeometricBoundaryField& Upatches = U.boundaryField(); +const surfaceVectorField::GeometricBoundaryField& SfPatches = mesh.Sf().boundaryField(); + +forAll(phivPatches, patchI) +{ + if (phiv.boundaryField().types()[patchI] == "calculated") + { + calculatedFvsPatchScalarField& phivPatch = + refCast<calculatedFvsPatchScalarField>(phivPatches[patchI]); + + phivPatch == (Upatches[patchI] & SfPatches[patchI]); + } +} diff --git a/applications/solvers/multiphase/cavitatingFoam/rhoEqn.H b/applications/solvers/multiphase/cavitatingFoam/rhoEqn.H new file mode 100644 index 00000000000..d0bd6e1dad3 --- /dev/null +++ b/applications/solvers/multiphase/cavitatingFoam/rhoEqn.H @@ -0,0 +1,16 @@ +{ + fvScalarMatrix rhoEqn + ( + fvm::ddt(rho) + + fvm::div(phiv, rho) + ); + + rhoEqn.solve(); + + phi = rhoEqn.flux(); + + Info<< "max-min rho: " << max(rho).value() + << " " << min(rho).value() << endl; + + rho == max(rho, rhoMin); +} diff --git a/applications/solvers/multiphase/cavitatingFoam/setDeltaT.H b/applications/solvers/multiphase/cavitatingFoam/setDeltaT.H new file mode 100644 index 00000000000..012a5276e8c --- /dev/null +++ b/applications/solvers/multiphase/cavitatingFoam/setDeltaT.H @@ -0,0 +1,54 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Global + setDeltaT + +Description + Reset the timestep to maintain a constant maximum courant Number. + Reduction of time-step is imediate but increase is damped to avoid + unstable oscillations. + +\*---------------------------------------------------------------------------*/ + +if (adjustTimeStep) +{ + scalar maxDeltaTFact = + min(maxCo/(CoNum + SMALL), maxAcousticCo/(acousticCoNum + SMALL)); + + scalar deltaTFact = min(min(maxDeltaTFact, 1.0 + 0.1*maxDeltaTFact), 1.2); + + runTime.setDeltaT + ( + min + ( + deltaTFact*runTime.deltaT().value(), + maxDeltaT + ) + ); + + Info<< "deltaT = " << runTime.deltaT().value() << endl; +} + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/cavitatingFoam/setInitialDeltaT.H b/applications/solvers/multiphase/cavitatingFoam/setInitialDeltaT.H new file mode 100644 index 00000000000..237cacd05a2 --- /dev/null +++ b/applications/solvers/multiphase/cavitatingFoam/setInitialDeltaT.H @@ -0,0 +1,54 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Global + setInitialDeltaT + +Description + Set the initial timestep corresponding to the timestep adjustment + algorithm in setDeltaT + +\*---------------------------------------------------------------------------*/ + +if (adjustTimeStep) +{ +# include "CourantNo.H" + + if (CoNum > SMALL) + { + scalar maxDeltaTFact = + min(maxCo/(CoNum + SMALL), maxAcousticCo/(acousticCoNum + SMALL)); + + runTime.setDeltaT + ( + min + ( + maxDeltaTFact*runTime.deltaT().value(), + maxDeltaT + ) + ); + } +} + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/compressibleInterDyMFoam/Make/files b/applications/solvers/multiphase/compressibleInterDyMFoam/Make/files new file mode 100644 index 00000000000..121264b1a93 --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterDyMFoam/Make/files @@ -0,0 +1,3 @@ +compressibleInterDyMFoam.C + +EXE = $(FOAM_APPBIN)/compressibleInterDyMFoam diff --git a/applications/solvers/multiphase/compressibleInterDyMFoam/Make/options b/applications/solvers/multiphase/compressibleInterDyMFoam/Make/options new file mode 100644 index 00000000000..13d31339e47 --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterDyMFoam/Make/options @@ -0,0 +1,22 @@ +INTERFOAM = $(FOAM_SOLVERS)/multiphase/interFoam + +EXE_INC = \ + -I$(LIB_SRC)/transportModels \ + -I$(LIB_SRC)/transportModels/incompressible/lnInclude \ + -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \ + -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/dynamicMesh/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(LIB_SRC)/dynamicFvMesh/lnInclude + +EXE_LIBS = \ + -linterfaceProperties \ + -lincompressibleTransportModels \ + -lincompressibleRASModels \ + -lincompressibleLESModels \ + -lfiniteVolume \ + -ldynamicMesh \ + -lmeshTools \ + -ldynamicFvMesh + diff --git a/applications/solvers/multiphase/compressibleInterDyMFoam/UEqn.H b/applications/solvers/multiphase/compressibleInterDyMFoam/UEqn.H new file mode 100644 index 00000000000..90033f9826f --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterDyMFoam/UEqn.H @@ -0,0 +1,31 @@ + surfaceScalarField muf = + twoPhaseProperties.muf() + + fvc::interpolate(rho*turbulence->nut()); + + fvVectorMatrix UEqn + ( + fvm::ddt(rho, U) + + fvm::div(rhoPhi, U) + - fvm::laplacian(muf, U) + - (fvc::grad(U) & fvc::grad(muf)) + //- fvc::div(muf*(mesh.Sf() & fvc::interpolate(fvc::grad(U)().T()))) + ); + + UEqn.relax(); + + if (momentumPredictor) + { + solve + ( + UEqn + == + fvc::reconstruct + ( + ( + fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1) + - ghf*fvc::snGrad(rho) + - fvc::snGrad(pd) + ) * mesh.magSf() + ) + ); + } diff --git a/applications/solvers/multiphase/compressibleInterDyMFoam/alphaEqns.H b/applications/solvers/multiphase/compressibleInterDyMFoam/alphaEqns.H new file mode 100644 index 00000000000..819cd0f538b --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterDyMFoam/alphaEqns.H @@ -0,0 +1,76 @@ +{ + word alphaScheme("div(phi,alpha)"); + word alpharScheme("div(phirb,alpha)"); + + surfaceScalarField phir = phic*interface.nHatf(); + + for (int gCorr=0; gCorr<nAlphaCorr; gCorr++) + { + volScalarField::DimensionedInternalField Sp + ( + IOobject + ( + "Sp", + runTime.timeName(), + mesh + ), + mesh, + dimensionedScalar("Sp", dgdt.dimensions(), 0.0) + ); + + volScalarField::DimensionedInternalField Su + ( + IOobject + ( + "Su", + runTime.timeName(), + mesh + ), + // Divergence term is handled explicitly to be + // consistent with the explicit transport solution + divU*min(alpha1, scalar(1)) + ); + + forAll(dgdt, celli) + { + if (dgdt[celli] > 0.0 && alpha1[celli] > 0.0) + { + Sp[celli] -= dgdt[celli]*alpha1[celli]; + Su[celli] += dgdt[celli]*alpha1[celli]; + } + else if (dgdt[celli] < 0.0 && alpha1[celli] < 1.0) + { + Sp[celli] += dgdt[celli]*(1.0 - alpha1[celli]); + } + } + + + surfaceScalarField phiAlpha1 = + fvc::flux + ( + phi, + alpha1, + alphaScheme + ) + + fvc::flux + ( + -fvc::flux(-phir, alpha2, alpharScheme), + alpha1, + alpharScheme + ); + + MULES::explicitSolve(oneField(), alpha1, phi, phiAlpha1, Sp, Su, 1, 0); + + surfaceScalarField rho1f = fvc::interpolate(rho1); + surfaceScalarField rho2f = fvc::interpolate(rho2); + rhoPhi = phiAlpha1*(rho1f - rho2f) + phi*rho2f; + + alpha2 = scalar(1) - alpha1; + } + + Info<< "Liquid phase volume fraction = " + << alpha1.weightedAverage(mesh.V()).value() + << " Min(alpha1) = " << min(alpha1).value() + << " Min(alpha2) = " << min(alpha2).value() + << endl; +} diff --git a/applications/solvers/multiphase/compressibleInterDyMFoam/alphaEqnsSubCycle.H b/applications/solvers/multiphase/compressibleInterDyMFoam/alphaEqnsSubCycle.H new file mode 100644 index 00000000000..e161a3cbe6b --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterDyMFoam/alphaEqnsSubCycle.H @@ -0,0 +1,43 @@ +{ + label nAlphaCorr + ( + readLabel(piso.lookup("nAlphaCorr")) + ); + + label nAlphaSubCycles + ( + readLabel(piso.lookup("nAlphaSubCycles")) + ); + + surfaceScalarField phic = mag(phi/mesh.magSf()); + phic = min(interface.cAlpha()*phic, max(phic)); + + volScalarField divU = fvc::div(phi); + + if (nAlphaSubCycles > 1) + { + dimensionedScalar totalDeltaT = runTime.deltaT(); + surfaceScalarField rhoPhiSum = 0.0*rhoPhi; + + for + ( + subCycle<volScalarField> alphaSubCycle(alpha1, nAlphaSubCycles); + !(++alphaSubCycle).end(); + ) + { +# include "alphaEqns.H" + rhoPhiSum += (runTime.deltaT()/totalDeltaT)*rhoPhi; + } + + rhoPhi = rhoPhiSum; + } + else + { +# include "alphaEqns.H" + } + + if (oCorr == 0) + { + interface.correct(); + } +} diff --git a/applications/solvers/multiphase/compressibleInterDyMFoam/compressibleInterDyMFoam.C b/applications/solvers/multiphase/compressibleInterDyMFoam/compressibleInterDyMFoam.C new file mode 100644 index 00000000000..11a18095756 --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterDyMFoam/compressibleInterDyMFoam.C @@ -0,0 +1,138 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Application + compressibleLesInterFoam + +Description + Solver for 2 compressible, isothermal immiscible fluids using a VOF + (volume of fluid) phase-fraction based interface capturing approach. + The momentum and other fluid properties are of the "mixture" and a single + momentum equation is solved. + + Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected. + +\*---------------------------------------------------------------------------*/ + +#include "fvCFD.H" +#include "dynamicFvMesh.H" +#include "MULES.H" +#include "subCycle.H" +#include "interfaceProperties.H" +#include "twoPhaseMixture.H" +#include "turbulenceModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ + #include "setRootCase.H" + #include "createTime.H" + #include "createDynamicFvMesh.H" + #include "readEnvironmentalProperties.H" + #include "readControls.H" + #include "initContinuityErrs.H" + #include "createFields.H" + #include "CourantNo.H" + #include "setInitialDeltaT.H" + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + Info<< "\nStarting time loop\n" << endl; + + while (runTime.run()) + { + #include "readControls.H" + #include "CourantNo.H" + + // Make the fluxes absolute + fvc::makeAbsolute(phi, U); + + #include "setDeltaT.H" + + runTime++; + + Info<< "Time = " << runTime.timeName() << nl << endl; + + scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime(); + + // Do any mesh changes + mesh.update(); + + if (mesh.changing()) + { + Info<< "Execution time for mesh.update() = " + << runTime.elapsedCpuTime() - timeBeforeMeshUpdate + << " s" << endl; + + gh = g & mesh.C(); + ghf = g & mesh.Cf(); + } + + if (mesh.changing() && correctPhi) + { + //***HGW#include "correctPhi.H" + } + + // Make the fluxes relative to the mesh motion + fvc::makeRelative(phi, U); + + if (mesh.changing() && checkMeshCourantNo) + { + #include "meshCourantNo.H" + } + + turbulence->correct(); + + // --- Outer-corrector loop + for (int oCorr=0; oCorr<nOuterCorr; oCorr++) + { + #include "alphaEqnsSubCycle.H" + + solve(fvm::ddt(rho) + fvc::div(rhoPhi)); + + #include "UEqn.H" + + // --- PISO loop + for (int corr=0; corr<nCorr; corr++) + { + #include "pEqn.H" + } + } + + rho = alpha1*rho1 + alpha2*rho2; + + runTime.write(); + + Info<< "ExecutionTime = " + << runTime.elapsedCpuTime() + << " s\n\n" << endl; + } + + Info<< "End\n" << endl; + + return(0); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/compressibleInterDyMFoam/createFields.H b/applications/solvers/multiphase/compressibleInterDyMFoam/createFields.H new file mode 100644 index 00000000000..1f579d245bd --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterDyMFoam/createFields.H @@ -0,0 +1,152 @@ + Info<< "Reading field pd\n" << endl; + volScalarField pd + ( + IOobject + ( + "pd", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + + Info<< "Reading field alpha1\n" << endl; + volScalarField alpha1 + ( + IOobject + ( + "alpha1", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + + Info<< "Calculating field alpha1\n" << endl; + volScalarField alpha2("alpha2", scalar(1) - alpha1); + + Info<< "Reading field U\n" << endl; + volVectorField U + ( + IOobject + ( + "U", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + + #include "createPhi.H" + + + Info<< "Calculating field g.h\n" << endl; + volScalarField gh("gh", g & mesh.C()); + surfaceScalarField ghf("ghf", g & mesh.Cf()); + + + Info<< "Reading transportProperties\n" << endl; + twoPhaseMixture twoPhaseProperties(U, phi); + + dimensionedScalar rho10 + ( + twoPhaseProperties.subDict + ( + twoPhaseProperties.phase1Name() + ).lookup("rho0") + ); + + dimensionedScalar rho20 + ( + twoPhaseProperties.subDict + ( + twoPhaseProperties.phase2Name() + ).lookup("rho0") + ); + + dimensionedScalar psi1 + ( + twoPhaseProperties.subDict + ( + twoPhaseProperties.phase1Name() + ).lookup("psi") + ); + + dimensionedScalar psi2 + ( + twoPhaseProperties.subDict + ( + twoPhaseProperties.phase2Name() + ).lookup("psi") + ); + + dimensionedScalar pMin(twoPhaseProperties.lookup("pMin")); + + volScalarField p + ( + IOobject + ( + "p", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + max + ( + (pd + gh*(alpha1*rho10 + alpha2*rho20)) + /(1.0 - gh*(alpha1*psi1 + alpha2*psi2)), + pMin + ) + ); + + volScalarField rho1 = rho10 + psi1*p; + volScalarField rho2 = rho20 + psi2*p; + + volScalarField rho + ( + IOobject + ( + "rho", + runTime.timeName(), + mesh, + IOobject::READ_IF_PRESENT, + IOobject::AUTO_WRITE + ), + alpha1*rho1 + alpha2*rho2 + ); + + + // Mass flux + // Initialisation does not matter because rhoPhi is reset after the + // alpha1 solution before it is used in the U equation. + surfaceScalarField rhoPhi + ( + IOobject + ( + "rho*phi", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + fvc::interpolate(rho)*phi + ); + + volScalarField dgdt = + pos(alpha2)*fvc::div(phi)/max(alpha2, scalar(0.0001)); + + // Construct interface from alpha1 distribution + interfaceProperties interface(alpha1, U, twoPhaseProperties); + + // Construct incompressible turbulence model + autoPtr<incompressible::turbulenceModel> turbulence + ( + incompressible::turbulenceModel::New(U, phi, twoPhaseProperties) + ); diff --git a/applications/solvers/multiphase/compressibleInterDyMFoam/pEqn.H b/applications/solvers/multiphase/compressibleInterDyMFoam/pEqn.H new file mode 100644 index 00000000000..013d8eb05f7 --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterDyMFoam/pEqn.H @@ -0,0 +1,77 @@ +{ + volScalarField rUA = 1.0/UEqn.A(); + surfaceScalarField rUAf = fvc::interpolate(rUA); + + tmp<fvScalarMatrix> pdEqnComp; + + if (transonic) + { + pdEqnComp = + (fvm::ddt(pd) + fvm::div(phi, pd) - fvm::Sp(fvc::div(phi), pd)); + } + else + { + pdEqnComp = + (fvm::ddt(pd) + fvc::div(phi, pd) - fvc::Sp(fvc::div(phi), pd)); + } + + + U = rUA*UEqn.H(); + + surfaceScalarField phiU + ( + "phiU", + (fvc::interpolate(U) & mesh.Sf()) + fvc::ddtPhiCorr(rUA, rho, U, phi) + ); + + phi = phiU + + ( + fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1) + - ghf*fvc::snGrad(rho) + )*rUAf*mesh.magSf(); + + for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + { + fvScalarMatrix pdEqnIncomp + ( + fvc::div(phi) + - fvm::laplacian(rUAf, pd) + ); + + solve + ( + ( + max(alpha1, scalar(0))*(psi1/rho1) + + max(alpha2, scalar(0))*(psi2/rho2) + ) + *pdEqnComp() + + pdEqnIncomp + ); + + if (nonOrth == nNonOrthCorr) + { + dgdt = + (pos(alpha2)*(psi2/rho2) - pos(alpha1)*(psi1/rho1)) + *(pdEqnComp & pd); + phi += pdEqnIncomp.flux(); + } + } + + U += rUA*fvc::reconstruct((phi - phiU)/rUAf); + U.correctBoundaryConditions(); + + p = max + ( + (pd + gh*(alpha1*rho10 + alpha2*rho20))/(1.0 - gh*(alpha1*psi1 + alpha2*psi2)), + pMin + ); + + rho1 = rho10 + psi1*p; + rho2 = rho20 + psi2*p; + + Info<< "max(U) " << max(mag(U)).value() << endl; + Info<< "min(pd) " << min(pd).value() << endl; + + // Make the fluxes relative to the mesh motion + fvc::makeRelative(phi, U); +} diff --git a/applications/solvers/multiphase/compressibleInterDyMFoam/readControls.H b/applications/solvers/multiphase/compressibleInterDyMFoam/readControls.H new file mode 100644 index 00000000000..a2e4ef3747f --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterDyMFoam/readControls.H @@ -0,0 +1,32 @@ + #include "readPISOControls.H" + #include "readTimeControls.H" + + label nAlphaCorr + ( + readLabel(piso.lookup("nAlphaCorr")) + ); + + label nAlphaSubCycles + ( + readLabel(piso.lookup("nAlphaSubCycles")) + ); + + if (nAlphaSubCycles > 1 && nOuterCorr != 1) + { + FatalErrorIn(args.executable()) + << "Sub-cycling alpha is only allowed for PISO, " + "i.e. when the number of outer-correctors = 1" + << exit(FatalError); + } + + bool correctPhi = true; + if (piso.found("correctPhi")) + { + correctPhi = Switch(piso.lookup("correctPhi")); + } + + bool checkMeshCourantNo = false; + if (piso.found("checkMeshCourantNo")) + { + checkMeshCourantNo = Switch(piso.lookup("checkMeshCourantNo")); + } diff --git a/applications/solvers/multiphase/compressibleInterFoam/Make/files b/applications/solvers/multiphase/compressibleInterFoam/Make/files new file mode 100644 index 00000000000..de5437219c0 --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/Make/files @@ -0,0 +1,3 @@ +compressibleInterFoam.C + +EXE = $(FOAM_APPBIN)/compressibleInterFoam diff --git a/applications/solvers/multiphase/compressibleInterFoam/Make/options b/applications/solvers/multiphase/compressibleInterFoam/Make/options new file mode 100644 index 00000000000..9412e3e3748 --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/Make/options @@ -0,0 +1,15 @@ +INTERFOAM = $(FOAM_SOLVERS)/multiphase/interFoam + +EXE_INC = \ + -I$(LIB_SRC)/transportModels \ + -I$(LIB_SRC)/transportModels/incompressible/lnInclude \ + -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \ + -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \ + -I$(LIB_SRC)/finiteVolume/lnInclude + +EXE_LIBS = \ + -linterfaceProperties \ + -lincompressibleTransportModels \ + -lincompressibleRASModels \ + -lincompressibleLESModels \ + -lfiniteVolume diff --git a/applications/solvers/multiphase/compressibleInterFoam/UEqn.H b/applications/solvers/multiphase/compressibleInterFoam/UEqn.H new file mode 100644 index 00000000000..528e0aaafd8 --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/UEqn.H @@ -0,0 +1,34 @@ + surfaceScalarField muEff + ( + "muEff", + twoPhaseProperties.muf() + + fvc::interpolate(rho*turbulence->nut()) + ); + + fvVectorMatrix UEqn + ( + fvm::ddt(rho, U) + + fvm::div(rhoPhi, U) + - fvm::laplacian(muEff, U) + - (fvc::grad(U) & fvc::grad(muEff)) + //- fvc::div(muEff*(fvc::interpolate(dev(fvc::grad(U))) & mesh.Sf())) + ); + + UEqn.relax(); + + if (momentumPredictor) + { + solve + ( + UEqn + == + fvc::reconstruct + ( + ( + fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1) + - ghf*fvc::snGrad(rho) + - fvc::snGrad(pd) + ) * mesh.magSf() + ) + ); + } diff --git a/applications/solvers/multiphase/compressibleInterFoam/alphaEqns.H b/applications/solvers/multiphase/compressibleInterFoam/alphaEqns.H new file mode 100644 index 00000000000..819cd0f538b --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/alphaEqns.H @@ -0,0 +1,76 @@ +{ + word alphaScheme("div(phi,alpha)"); + word alpharScheme("div(phirb,alpha)"); + + surfaceScalarField phir = phic*interface.nHatf(); + + for (int gCorr=0; gCorr<nAlphaCorr; gCorr++) + { + volScalarField::DimensionedInternalField Sp + ( + IOobject + ( + "Sp", + runTime.timeName(), + mesh + ), + mesh, + dimensionedScalar("Sp", dgdt.dimensions(), 0.0) + ); + + volScalarField::DimensionedInternalField Su + ( + IOobject + ( + "Su", + runTime.timeName(), + mesh + ), + // Divergence term is handled explicitly to be + // consistent with the explicit transport solution + divU*min(alpha1, scalar(1)) + ); + + forAll(dgdt, celli) + { + if (dgdt[celli] > 0.0 && alpha1[celli] > 0.0) + { + Sp[celli] -= dgdt[celli]*alpha1[celli]; + Su[celli] += dgdt[celli]*alpha1[celli]; + } + else if (dgdt[celli] < 0.0 && alpha1[celli] < 1.0) + { + Sp[celli] += dgdt[celli]*(1.0 - alpha1[celli]); + } + } + + + surfaceScalarField phiAlpha1 = + fvc::flux + ( + phi, + alpha1, + alphaScheme + ) + + fvc::flux + ( + -fvc::flux(-phir, alpha2, alpharScheme), + alpha1, + alpharScheme + ); + + MULES::explicitSolve(oneField(), alpha1, phi, phiAlpha1, Sp, Su, 1, 0); + + surfaceScalarField rho1f = fvc::interpolate(rho1); + surfaceScalarField rho2f = fvc::interpolate(rho2); + rhoPhi = phiAlpha1*(rho1f - rho2f) + phi*rho2f; + + alpha2 = scalar(1) - alpha1; + } + + Info<< "Liquid phase volume fraction = " + << alpha1.weightedAverage(mesh.V()).value() + << " Min(alpha1) = " << min(alpha1).value() + << " Min(alpha2) = " << min(alpha2).value() + << endl; +} diff --git a/applications/solvers/multiphase/compressibleInterFoam/alphaEqnsSubCycle.H b/applications/solvers/multiphase/compressibleInterFoam/alphaEqnsSubCycle.H new file mode 100644 index 00000000000..89ba7a4e757 --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/alphaEqnsSubCycle.H @@ -0,0 +1,43 @@ +{ + label nAlphaCorr + ( + readLabel(piso.lookup("nAlphaCorr")) + ); + + label nAlphaSubCycles + ( + readLabel(piso.lookup("nAlphaSubCycles")) + ); + + surfaceScalarField phic = mag(phi/mesh.magSf()); + phic = min(interface.cAlpha()*phic, max(phic)); + + volScalarField divU = fvc::div(phi); + + if (nAlphaSubCycles > 1) + { + dimensionedScalar totalDeltaT = runTime.deltaT(); + surfaceScalarField rhoPhiSum = 0.0*rhoPhi; + + for + ( + subCycle<volScalarField> alphaSubCycle(alpha1, nAlphaSubCycles); + !(++alphaSubCycle).end(); + ) + { + #include "alphaEqns.H" + rhoPhiSum += (runTime.deltaT()/totalDeltaT)*rhoPhi; + } + + rhoPhi = rhoPhiSum; + } + else + { + #include "alphaEqns.H" + } + + if (oCorr == 0) + { + interface.correct(); + } +} diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFoam.C b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFoam.C new file mode 100644 index 00000000000..a48fd6b5d39 --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFoam.C @@ -0,0 +1,106 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Application + compressibleLesInterFoam + +Description + Solver for 2 compressible, isothermal immiscible fluids using a VOF + (volume of fluid) phase-fraction based interface capturing approach. + The momentum and other fluid properties are of the "mixture" and a single + momentum equation is solved. + + Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected. + +\*---------------------------------------------------------------------------*/ + +#include "fvCFD.H" +#include "MULES.H" +#include "subCycle.H" +#include "interfaceProperties.H" +#include "twoPhaseMixture.H" +#include "turbulenceModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ + #include "setRootCase.H" + #include "createTime.H" + #include "createMesh.H" + #include "readEnvironmentalProperties.H" + #include "readControls.H" + #include "initContinuityErrs.H" + #include "createFields.H" + #include "CourantNo.H" + #include "setInitialDeltaT.H" + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + Info<< "\nStarting time loop\n" << endl; + + while (runTime.run()) + { + #include "readControls.H" + #include "CourantNo.H" + #include "setDeltaT.H" + + runTime++; + + Info<< "Time = " << runTime.timeName() << nl << endl; + + // --- Outer-corrector loop + for (int oCorr=0; oCorr<nOuterCorr; oCorr++) + { + #include "alphaEqnsSubCycle.H" + + solve(fvm::ddt(rho) + fvc::div(rhoPhi)); + + #include "UEqn.H" + + // --- PISO loop + for (int corr=0; corr<nCorr; corr++) + { + #include "pEqn.H" + } + } + + rho = alpha1*rho1 + alpha2*rho2; + + turbulence->correct(); + + runTime.write(); + + Info<< "ExecutionTime = " + << runTime.elapsedCpuTime() + << " s\n\n" << endl; + } + + Info<< "End\n" << endl; + + return(0); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/compressibleInterFoam/createFields.H b/applications/solvers/multiphase/compressibleInterFoam/createFields.H new file mode 100644 index 00000000000..1f579d245bd --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/createFields.H @@ -0,0 +1,152 @@ + Info<< "Reading field pd\n" << endl; + volScalarField pd + ( + IOobject + ( + "pd", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + + Info<< "Reading field alpha1\n" << endl; + volScalarField alpha1 + ( + IOobject + ( + "alpha1", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + + Info<< "Calculating field alpha1\n" << endl; + volScalarField alpha2("alpha2", scalar(1) - alpha1); + + Info<< "Reading field U\n" << endl; + volVectorField U + ( + IOobject + ( + "U", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + + #include "createPhi.H" + + + Info<< "Calculating field g.h\n" << endl; + volScalarField gh("gh", g & mesh.C()); + surfaceScalarField ghf("ghf", g & mesh.Cf()); + + + Info<< "Reading transportProperties\n" << endl; + twoPhaseMixture twoPhaseProperties(U, phi); + + dimensionedScalar rho10 + ( + twoPhaseProperties.subDict + ( + twoPhaseProperties.phase1Name() + ).lookup("rho0") + ); + + dimensionedScalar rho20 + ( + twoPhaseProperties.subDict + ( + twoPhaseProperties.phase2Name() + ).lookup("rho0") + ); + + dimensionedScalar psi1 + ( + twoPhaseProperties.subDict + ( + twoPhaseProperties.phase1Name() + ).lookup("psi") + ); + + dimensionedScalar psi2 + ( + twoPhaseProperties.subDict + ( + twoPhaseProperties.phase2Name() + ).lookup("psi") + ); + + dimensionedScalar pMin(twoPhaseProperties.lookup("pMin")); + + volScalarField p + ( + IOobject + ( + "p", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + max + ( + (pd + gh*(alpha1*rho10 + alpha2*rho20)) + /(1.0 - gh*(alpha1*psi1 + alpha2*psi2)), + pMin + ) + ); + + volScalarField rho1 = rho10 + psi1*p; + volScalarField rho2 = rho20 + psi2*p; + + volScalarField rho + ( + IOobject + ( + "rho", + runTime.timeName(), + mesh, + IOobject::READ_IF_PRESENT, + IOobject::AUTO_WRITE + ), + alpha1*rho1 + alpha2*rho2 + ); + + + // Mass flux + // Initialisation does not matter because rhoPhi is reset after the + // alpha1 solution before it is used in the U equation. + surfaceScalarField rhoPhi + ( + IOobject + ( + "rho*phi", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + fvc::interpolate(rho)*phi + ); + + volScalarField dgdt = + pos(alpha2)*fvc::div(phi)/max(alpha2, scalar(0.0001)); + + // Construct interface from alpha1 distribution + interfaceProperties interface(alpha1, U, twoPhaseProperties); + + // Construct incompressible turbulence model + autoPtr<incompressible::turbulenceModel> turbulence + ( + incompressible::turbulenceModel::New(U, phi, twoPhaseProperties) + ); diff --git a/applications/solvers/multiphase/compressibleInterFoam/pEqn.H b/applications/solvers/multiphase/compressibleInterFoam/pEqn.H new file mode 100644 index 00000000000..ebf24498ade --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/pEqn.H @@ -0,0 +1,74 @@ +{ + volScalarField rUA = 1.0/UEqn.A(); + surfaceScalarField rUAf = fvc::interpolate(rUA); + + tmp<fvScalarMatrix> pdEqnComp; + + if (transonic) + { + pdEqnComp = + (fvm::ddt(pd) + fvm::div(phi, pd) - fvm::Sp(fvc::div(phi), pd)); + } + else + { + pdEqnComp = + (fvm::ddt(pd) + fvc::div(phi, pd) - fvc::Sp(fvc::div(phi), pd)); + } + + + U = rUA*UEqn.H(); + + surfaceScalarField phiU + ( + "phiU", + (fvc::interpolate(U) & mesh.Sf()) + fvc::ddtPhiCorr(rUA, rho, U, phi) + ); + + phi = phiU + + ( + fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1) + - ghf*fvc::snGrad(rho) + )*rUAf*mesh.magSf(); + + for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + { + fvScalarMatrix pdEqnIncomp + ( + fvc::div(phi) + - fvm::laplacian(rUAf, pd) + ); + + solve + ( + ( + max(alpha1, scalar(0))*(psi1/rho1) + + max(alpha2, scalar(0))*(psi2/rho2) + ) + *pdEqnComp() + + pdEqnIncomp + ); + + if (nonOrth == nNonOrthCorr) + { + dgdt = + (pos(alpha2)*(psi2/rho2) - pos(alpha1)*(psi1/rho1)) + *(pdEqnComp & pd); + phi += pdEqnIncomp.flux(); + } + } + + U += rUA*fvc::reconstruct((phi - phiU)/rUAf); + U.correctBoundaryConditions(); + + p = max + ( + (pd + gh*(alpha1*rho10 + alpha2*rho20))/(1.0 - gh*(alpha1*psi1 + alpha2*psi2)), + pMin + ); + + rho1 = rho10 + psi1*p; + rho2 = rho20 + psi2*p; + + Info<< "max(U) " << max(mag(U)).value() << endl; + Info<< "min(pd) " << min(pd).value() << endl; +} diff --git a/applications/solvers/multiphase/compressibleInterFoam/readControls.H b/applications/solvers/multiphase/compressibleInterFoam/readControls.H new file mode 100644 index 00000000000..7e23354f47f --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/readControls.H @@ -0,0 +1,20 @@ + #include "readPISOControls.H" + #include "readTimeControls.H" + + label nAlphaCorr + ( + readLabel(piso.lookup("nAlphaCorr")) + ); + + label nAlphaSubCycles + ( + readLabel(piso.lookup("nAlphaSubCycles")) + ); + + if (nAlphaSubCycles > 1 && nOuterCorr != 1) + { + FatalErrorIn(args.executable()) + << "Sub-cycling alpha is only allowed for PISO, " + "i.e. when the number of outer-correctors = 1" + << exit(FatalError); + } diff --git a/applications/solvers/multiphase/interFoam/alphaEqn.H b/applications/solvers/multiphase/interFoam/alphaEqn.H new file mode 100644 index 00000000000..3bf24a845ef --- /dev/null +++ b/applications/solvers/multiphase/interFoam/alphaEqn.H @@ -0,0 +1,35 @@ +{ + word alphaScheme("div(phi,alpha)"); + word alpharScheme("div(phirb,alpha)"); + + surfaceScalarField phic = mag(phi/mesh.magSf()); + phic = min(interface.cAlpha()*phic, max(phic)); + surfaceScalarField phir = phic*interface.nHatf(); + + for (int gCorr=0; gCorr<nAlphaCorr; gCorr++) + { + surfaceScalarField phiAlpha = + fvc::flux + ( + phi, + alpha1, + alphaScheme + ) + + fvc::flux + ( + -fvc::flux(-phir, scalar(1) - alpha1, alpharScheme), + alpha1, + alpharScheme + ); + + MULES::explicitSolve(alpha1, phi, phiAlpha, 1, 0); + + rhoPhi = phiAlpha*(rho1 - rho2) + phi*rho2; + } + + Info<< "Liquid phase volume fraction = " + << alpha1.weightedAverage(mesh.V()).value() + << " Min(alpha1) = " << min(alpha1).value() + << " Max(alpha1) = " << max(alpha1).value() + << endl; +} diff --git a/applications/solvers/multiphase/interFoam/alphaEqnSubCycle.H b/applications/solvers/multiphase/interFoam/alphaEqnSubCycle.H new file mode 100644 index 00000000000..9aae37a8bef --- /dev/null +++ b/applications/solvers/multiphase/interFoam/alphaEqnSubCycle.H @@ -0,0 +1,35 @@ +label nAlphaCorr +( + readLabel(piso.lookup("nAlphaCorr")) +); + +label nAlphaSubCycles +( + readLabel(piso.lookup("nAlphaSubCycles")) +); + +if (nAlphaSubCycles > 1) +{ + dimensionedScalar totalDeltaT = runTime.deltaT(); + surfaceScalarField rhoPhiSum = 0.0*rhoPhi; + + for + ( + subCycle<volScalarField> alphaSubCycle(alpha1, nAlphaSubCycles); + !(++alphaSubCycle).end(); + ) + { +# include "alphaEqn.H" + rhoPhiSum += (runTime.deltaT()/totalDeltaT)*rhoPhi; + } + + rhoPhi = rhoPhiSum; +} +else +{ +# include "alphaEqn.H" +} + +interface.correct(); + +rho == alpha1*rho1 + (scalar(1) - alpha1)*rho2; diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqn.H b/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqn.H new file mode 100644 index 00000000000..15a5291ee63 --- /dev/null +++ b/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqn.H @@ -0,0 +1,67 @@ +{ + word alphaScheme("div(phi,alpha)"); + word alpharScheme("div(phirb,alpha)"); + + surfaceScalarField phir("phir", phic*interface.nHatf()); + + for (int gCorr=0; gCorr<nAlphaCorr; gCorr++) + { + surfaceScalarField phiAlpha = + fvc::flux + ( + phi, + alpha1, + alphaScheme + ) + + fvc::flux + ( + -fvc::flux(-phir, scalar(1) - alpha1, alpharScheme), + alpha1, + alpharScheme + ); + + Pair<tmp<volScalarField> > vDotAlphal = + twoPhaseProperties->vDotAlphal(); + const volScalarField& vDotcAlphal = vDotAlphal[0](); + const volScalarField& vDotvAlphal = vDotAlphal[1](); + + volScalarField Sp + ( + IOobject + ( + "Sp", + runTime.timeName(), + mesh + ), + vDotvAlphal - vDotcAlphal + ); + + volScalarField Su + ( + IOobject + ( + "Su", + runTime.timeName(), + mesh + ), + // Divergence term is handled explicitly to be + // consistent with the explicit transport solution + divU*alpha1 + + vDotcAlphal + ); + + //MULES::explicitSolve(alpha1, phi, phiAlpha, 1, 0); + //MULES::explicitSolve(oneField(), alpha1, phi, phiAlpha, Sp, Su, 1, 0); + MULES::implicitSolve(oneField(), alpha1, phi, phiAlpha, Sp, Su, 1, 0); + + rhoPhi += + (runTime.deltaT()/totalDeltaT) + *(phiAlpha*(rho1 - rho2) + phi*rho2); + } + + Info<< "Liquid phase volume fraction = " + << alpha1.weightedAverage(mesh.V()).value() + << " Min(alpha1) = " << min(alpha1).value() + << " Max(alpha1) = " << max(alpha1).value() + << endl; +} diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqnSubCycle.H b/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqnSubCycle.H new file mode 100644 index 00000000000..dd1d828030f --- /dev/null +++ b/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqnSubCycle.H @@ -0,0 +1,53 @@ +surfaceScalarField rhoPhi +( + IOobject + ( + "rhoPhi", + runTime.timeName(), + mesh + ), + mesh, + dimensionedScalar("0", dimensionSet(1, 0, -1, 0, 0), 0) +); + +{ + label nAlphaCorr + ( + readLabel(piso.lookup("nAlphaCorr")) + ); + + label nAlphaSubCycles + ( + readLabel(piso.lookup("nAlphaSubCycles")) + ); + + surfaceScalarField phic = mag(phi/mesh.magSf()); + phic = min(interface.cAlpha()*phic, max(phic)); + + volScalarField divU = fvc::div(phi); + + dimensionedScalar totalDeltaT = runTime.deltaT(); + + if (nAlphaSubCycles > 1) + { + for + ( + subCycle<volScalarField> alphaSubCycle(alpha1, nAlphaSubCycles); + !(++alphaSubCycle).end(); + ) + { +# include "alphaEqn.H" + } + } + else + { +# include "alphaEqn.H" + } + + if (nOuterCorr == 1) + { + interface.correct(); + } + + rho == alpha1*rho1 + (scalar(1) - alpha1)*rho2; +} diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/alphaEqn.H b/applications/solvers/multiphase/twoLiquidMixingFoam/alphaEqn.H new file mode 100644 index 00000000000..c1260253687 --- /dev/null +++ b/applications/solvers/multiphase/twoLiquidMixingFoam/alphaEqn.H @@ -0,0 +1,19 @@ +{ + fvScalarMatrix alpha1Eqn + ( + fvm::ddt(alpha1) + + fvm::div(phi, alpha1) + - fvm::laplacian(Dab, alpha1) + ); + + alpha1Eqn.solve(); + + rhoPhi = alpha1Eqn.flux()*(rho1 - rho2) + phi*rho2; + rho = alpha1*rho1 + (scalar(1) - alpha1)*rho2; + + Info<< "Phase 1 volume fraction = " + << alpha1.weightedAverage(mesh.V()).value() + << " Min(alpha1) = " << min(alpha1).value() + << " Max(alpha1) = " << max(alpha1).value() + << endl; +} diff --git a/src/transportModels/interfaceProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.C b/src/transportModels/interfaceProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.C new file mode 100644 index 00000000000..b11bbd83cf9 --- /dev/null +++ b/src/transportModels/interfaceProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.C @@ -0,0 +1,96 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "alphaContactAngleFvPatchScalarField.H" +#include "addToRunTimeSelectionTable.H" +#include "fvPatchFieldMapper.H" +#include "volMesh.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(alphaContactAngleFvPatchScalarField, 0); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + zeroGradientFvPatchScalarField(p, iF) +{} + + +Foam::alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField +( + const alphaContactAngleFvPatchScalarField& gcpsf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + zeroGradientFvPatchScalarField(gcpsf, p, iF, mapper) +{} + + +Foam::alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + zeroGradientFvPatchScalarField(p, iF) +{ + evaluate(); +} + + +Foam::alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField +( + const alphaContactAngleFvPatchScalarField& gcpsf +) +: + zeroGradientFvPatchScalarField(gcpsf) +{} + + +Foam::alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField +( + const alphaContactAngleFvPatchScalarField& gcpsf, + const DimensionedField<scalar, volMesh>& iF +) +: + zeroGradientFvPatchScalarField(gcpsf, iF) +{} + + +// ************************************************************************* // diff --git a/src/transportModels/interfaceProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.H b/src/transportModels/interfaceProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.H new file mode 100644 index 00000000000..4036f8cb695 --- /dev/null +++ b/src/transportModels/interfaceProperties/alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.H @@ -0,0 +1,125 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::alphaContactAngleFvPatchScalarField + +Description + Abstract base class for alphaContactAngle boundary conditions. + + Derived classes must implement the theta() fuction which returns the + wall contact angle field. + +SourceFiles + alphaContactAngleFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef alphaContactAngleFvPatchScalarField_H +#define alphaContactAngleFvPatchScalarField_H + +#include "zeroGradientFvPatchFields.H" +#include "fvsPatchFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class alphaContactAngleFvPatch Declaration +\*---------------------------------------------------------------------------*/ + +class alphaContactAngleFvPatchScalarField +: + public zeroGradientFvPatchScalarField +{ + +public: + + //- Runtime type information + TypeName("alphaContactAngle"); + + + // Constructors + + //- Construct from patch and internal field + alphaContactAngleFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + alphaContactAngleFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given alphaContactAngleFvPatchScalarField + // onto a new patch + alphaContactAngleFvPatchScalarField + ( + const alphaContactAngleFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + alphaContactAngleFvPatchScalarField + ( + const alphaContactAngleFvPatchScalarField& + ); + + //- Construct as copy setting internal field reference + alphaContactAngleFvPatchScalarField + ( + const alphaContactAngleFvPatchScalarField&, + const DimensionedField<scalar, volMesh>& + ); + + + // Member functions + + //- Return the contact angle + virtual tmp<scalarField> theta + ( + const fvPatchVectorField& Up, + const fvsPatchVectorField& nHat + ) const = 0; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/transportModels/interfaceProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.C b/src/transportModels/interfaceProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.C new file mode 100644 index 00000000000..bf80fd79bde --- /dev/null +++ b/src/transportModels/interfaceProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.C @@ -0,0 +1,133 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "constantAlphaContactAngleFvPatchScalarField.H" +#include "addToRunTimeSelectionTable.H" +#include "volMesh.H" +#include "fvPatchFieldMapper.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::constantAlphaContactAngleFvPatchScalarField:: +constantAlphaContactAngleFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + alphaContactAngleFvPatchScalarField(p, iF), + theta0_(0.0) +{} + + +Foam::constantAlphaContactAngleFvPatchScalarField:: +constantAlphaContactAngleFvPatchScalarField +( + const constantAlphaContactAngleFvPatchScalarField& gcpsf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + alphaContactAngleFvPatchScalarField(gcpsf, p, iF, mapper), + theta0_(gcpsf.theta0_) +{} + + +Foam::constantAlphaContactAngleFvPatchScalarField:: +constantAlphaContactAngleFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + alphaContactAngleFvPatchScalarField(p, iF), + theta0_(readScalar(dict.lookup("theta0"))) +{ + evaluate(); +} + + +Foam::constantAlphaContactAngleFvPatchScalarField:: +constantAlphaContactAngleFvPatchScalarField +( + const constantAlphaContactAngleFvPatchScalarField& gcpsf +) +: + alphaContactAngleFvPatchScalarField(gcpsf), + theta0_(gcpsf.theta0_) +{} + + +Foam::constantAlphaContactAngleFvPatchScalarField:: +constantAlphaContactAngleFvPatchScalarField +( + const constantAlphaContactAngleFvPatchScalarField& gcpsf, + const DimensionedField<scalar, volMesh>& iF +) +: + alphaContactAngleFvPatchScalarField(gcpsf, iF), + theta0_(gcpsf.theta0_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp<Foam::scalarField> +Foam::constantAlphaContactAngleFvPatchScalarField::theta +( + const fvPatchVectorField&, + const fvsPatchVectorField& +) const +{ + return tmp<scalarField>(new scalarField(size(), theta0_)); +} + + +void Foam::constantAlphaContactAngleFvPatchScalarField::write +( + Ostream& os +) const +{ + fvPatchScalarField::write(os); + os.writeKeyword("theta0") << theta0_ << token::END_STATEMENT << nl; + writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + makePatchTypeField + ( + fvPatchScalarField, + constantAlphaContactAngleFvPatchScalarField + ); +} + +// ************************************************************************* // diff --git a/src/transportModels/interfaceProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.H b/src/transportModels/interfaceProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.H new file mode 100644 index 00000000000..d81c115bd71 --- /dev/null +++ b/src/transportModels/interfaceProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.H @@ -0,0 +1,152 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::constantAlphaContactAngleFvPatchScalarField + +Description + A constant alphaContactAngle scalar boundary condition + (alphaContactAngleFvPatchScalarField) + +SourceFiles + constantAlphaContactAngleFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef constantAlphaContactAngleFvPatchScalarField_H +#define constantAlphaContactAngleFvPatchScalarField_H + +#include "alphaContactAngleFvPatchScalarField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class constantAlphaContactAngleFvPatch Declaration +\*---------------------------------------------------------------------------*/ + +class constantAlphaContactAngleFvPatchScalarField +: + public alphaContactAngleFvPatchScalarField +{ + // Private data + + //- Equilibrium contact angle + scalar theta0_; + + +public: + + //- Runtime type information + TypeName("constantAlphaContactAngle"); + + + // Constructors + + //- Construct from patch and internal field + constantAlphaContactAngleFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + constantAlphaContactAngleFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given + // constantAlphaContactAngleFvPatchScalarField + // onto a new patch + constantAlphaContactAngleFvPatchScalarField + ( + const constantAlphaContactAngleFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + constantAlphaContactAngleFvPatchScalarField + ( + const constantAlphaContactAngleFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchScalarField> clone() const + { + return tmp<fvPatchScalarField> + ( + new constantAlphaContactAngleFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + constantAlphaContactAngleFvPatchScalarField + ( + const constantAlphaContactAngleFvPatchScalarField&, + 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 constantAlphaContactAngleFvPatchScalarField(*this, iF) + ); + } + + + // Member functions + + //- Return the equilibrium contact-angle + virtual tmp<scalarField> theta + ( + const fvPatchVectorField& Up, + const fvsPatchVectorField& nHat + ) const; + + //- Write + virtual void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/transportModels/interfaceProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.C b/src/transportModels/interfaceProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.C new file mode 100644 index 00000000000..8c2009f6d01 --- /dev/null +++ b/src/transportModels/interfaceProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.C @@ -0,0 +1,170 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "dynamicAlphaContactAngleFvPatchScalarField.H" +#include "addToRunTimeSelectionTable.H" +#include "fvPatchFieldMapper.H" +#include "volMesh.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::dynamicAlphaContactAngleFvPatchScalarField:: +dynamicAlphaContactAngleFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + alphaContactAngleFvPatchScalarField(p, iF), + theta0_(0.0), + uTheta_(0.0), + thetaA_(0.0), + thetaR_(0.0) +{} + + +Foam::dynamicAlphaContactAngleFvPatchScalarField:: +dynamicAlphaContactAngleFvPatchScalarField +( + const dynamicAlphaContactAngleFvPatchScalarField& gcpsf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + alphaContactAngleFvPatchScalarField(gcpsf, p, iF, mapper), + theta0_(gcpsf.theta0_), + uTheta_(gcpsf.uTheta_), + thetaA_(gcpsf.thetaA_), + thetaR_(gcpsf.thetaR_) +{} + + +Foam::dynamicAlphaContactAngleFvPatchScalarField:: +dynamicAlphaContactAngleFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + alphaContactAngleFvPatchScalarField(p, iF), + theta0_(readScalar(dict.lookup("theta0"))), + uTheta_(readScalar(dict.lookup("uTheta"))), + thetaA_(readScalar(dict.lookup("thetaA"))), + thetaR_(readScalar(dict.lookup("thetaR"))) +{ + evaluate(); +} + + +Foam::dynamicAlphaContactAngleFvPatchScalarField:: +dynamicAlphaContactAngleFvPatchScalarField +( + const dynamicAlphaContactAngleFvPatchScalarField& gcpsf +) +: + alphaContactAngleFvPatchScalarField(gcpsf), + theta0_(gcpsf.theta0_), + uTheta_(gcpsf.uTheta_), + thetaA_(gcpsf.thetaA_), + thetaR_(gcpsf.thetaR_) +{} + + +Foam::dynamicAlphaContactAngleFvPatchScalarField:: +dynamicAlphaContactAngleFvPatchScalarField +( + const dynamicAlphaContactAngleFvPatchScalarField& gcpsf, + const DimensionedField<scalar, volMesh>& iF +) +: + alphaContactAngleFvPatchScalarField(gcpsf, iF), + theta0_(gcpsf.theta0_), + uTheta_(gcpsf.uTheta_), + thetaA_(gcpsf.thetaA_), + thetaR_(gcpsf.thetaR_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp<Foam::scalarField> +Foam::dynamicAlphaContactAngleFvPatchScalarField::theta +( + const fvPatchVectorField& Up, + const fvsPatchVectorField& nHat +) const +{ + if (uTheta_ < SMALL) + { + return tmp<scalarField>(new scalarField(size(), theta0_)); + } + + vectorField nf = patch().nf(); + + // Calculated the component of the velocity parallel to the wall + vectorField Uwall = Up.patchInternalField() - Up; + Uwall -= (nf & Uwall)*nf; + + // Find the direction of the interface parallel to the wall + vectorField nWall = nHat - (nf & nHat)*nf; + + // Normalise nWall + nWall /= (mag(nWall) + SMALL); + + // Calculate Uwall resolved normal to the interface parallel to + // the interface + scalarField uwall = nWall & Uwall; + + return theta0_ + (thetaA_ - thetaR_)*tanh(uwall/uTheta_); +} + + +void Foam::dynamicAlphaContactAngleFvPatchScalarField::write(Ostream& os) const +{ + fvPatchScalarField::write(os); + os.writeKeyword("theta0") << theta0_ << token::END_STATEMENT << nl; + os.writeKeyword("uTheta") << uTheta_ << token::END_STATEMENT << nl; + os.writeKeyword("thetaA") << thetaA_ << token::END_STATEMENT << nl; + os.writeKeyword("thetaR") << thetaR_ << token::END_STATEMENT << nl; + writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + makePatchTypeField + ( + fvPatchScalarField, + dynamicAlphaContactAngleFvPatchScalarField + ); +} + + +// ************************************************************************* // diff --git a/src/transportModels/interfaceProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.H b/src/transportModels/interfaceProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.H new file mode 100644 index 00000000000..6c3d16965d8 --- /dev/null +++ b/src/transportModels/interfaceProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.H @@ -0,0 +1,161 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::dynamicAlphaContactAngleFvPatchScalarField + +Description + A dynamic alphaContactAngle scalar boundary condition + (alphaContactAngleFvPatchScalarField) + +SourceFiles + dynamicAlphaContactAngleFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef dynamicAlphaContactAngleFvPatchScalarField_H +#define dynamicAlphaContactAngleFvPatchScalarField_H + +#include "alphaContactAngleFvPatchScalarField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class dynamicAlphaContactAngleFvPatch Declaration +\*---------------------------------------------------------------------------*/ + +class dynamicAlphaContactAngleFvPatchScalarField +: + public alphaContactAngleFvPatchScalarField +{ + // Private data + + //- Equilibrium contact angle + scalar theta0_; + + //- Dynamic contact angle velocity scale + scalar uTheta_; + + //- Limiting advancing contact angle + scalar thetaA_; + + //- Limiting receeding contact angle + scalar thetaR_; + + +public: + + //- Runtime type information + TypeName("dynamicAlphaContactAngle"); + + + // Constructors + + //- Construct from patch and internal field + dynamicAlphaContactAngleFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + dynamicAlphaContactAngleFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given + // dynamicAlphaContactAngleFvPatchScalarField + // onto a new patch + dynamicAlphaContactAngleFvPatchScalarField + ( + const dynamicAlphaContactAngleFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + dynamicAlphaContactAngleFvPatchScalarField + ( + const dynamicAlphaContactAngleFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchScalarField> clone() const + { + return tmp<fvPatchScalarField> + ( + new dynamicAlphaContactAngleFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + dynamicAlphaContactAngleFvPatchScalarField + ( + const dynamicAlphaContactAngleFvPatchScalarField&, + 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 dynamicAlphaContactAngleFvPatchScalarField(*this, iF) + ); + } + + + // Member functions + + //- Evaluate and return dynamic contact-angle + virtual tmp<scalarField> theta + ( + const fvPatchVectorField& Up, + const fvsPatchVectorField& nHat + ) const; + + //- Write + virtual void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/transportModels/interfaceProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.C b/src/transportModels/interfaceProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.C new file mode 100644 index 00000000000..ff9d7210c51 --- /dev/null +++ b/src/transportModels/interfaceProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.C @@ -0,0 +1,154 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "timeVaryingAlphaContactAngleFvPatchScalarField.H" +#include "addToRunTimeSelectionTable.H" +#include "fvPatchFieldMapper.H" +#include "volMesh.H" +#include "Time.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::timeVaryingAlphaContactAngleFvPatchScalarField:: +timeVaryingAlphaContactAngleFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + alphaContactAngleFvPatchScalarField(p, iF), + t0_(0.0), + thetaT0_(0.0), + te_(0.0), + thetaTe_(0.0) +{} + + +Foam::timeVaryingAlphaContactAngleFvPatchScalarField:: +timeVaryingAlphaContactAngleFvPatchScalarField +( + const timeVaryingAlphaContactAngleFvPatchScalarField& gcpsf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + alphaContactAngleFvPatchScalarField(gcpsf, p, iF, mapper), + t0_(gcpsf.t0_), + thetaT0_(gcpsf.thetaT0_), + te_(gcpsf.te_), + thetaTe_(gcpsf.te_) +{} + + +Foam::timeVaryingAlphaContactAngleFvPatchScalarField:: +timeVaryingAlphaContactAngleFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + alphaContactAngleFvPatchScalarField(p, iF), + t0_(readScalar(dict.lookup("t0"))), + thetaT0_(readScalar(dict.lookup("thetaT0"))), + te_(readScalar(dict.lookup("te"))), + thetaTe_(readScalar(dict.lookup("thetaTe"))) +{ + evaluate(); +} + + +Foam::timeVaryingAlphaContactAngleFvPatchScalarField:: +timeVaryingAlphaContactAngleFvPatchScalarField +( + const timeVaryingAlphaContactAngleFvPatchScalarField& gcpsf, + const DimensionedField<scalar, volMesh>& iF +) +: + alphaContactAngleFvPatchScalarField(gcpsf, iF), + t0_(gcpsf.t0_), + thetaT0_(gcpsf.thetaT0_), + te_(gcpsf.te_), + thetaTe_(gcpsf.thetaTe_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp<Foam::scalarField> +Foam::timeVaryingAlphaContactAngleFvPatchScalarField::theta +( + const fvPatchVectorField&, + const fvsPatchVectorField& +) const +{ + scalar t = patch().boundaryMesh().mesh().time().value(); + scalar theta0 = thetaT0_; + + if (t < t0_) + { + theta0 = thetaT0_; + } + else if (t > te_) + { + theta0 = thetaTe_; + } + else + { + theta0 = thetaT0_ + (t - t0_)*(thetaTe_ - thetaT0_)/(te_ - t0_); + } + + return tmp<scalarField>(new scalarField(size(), theta0)); +} + + +void Foam::timeVaryingAlphaContactAngleFvPatchScalarField::write +( + Ostream& os +) const +{ + fvPatchScalarField::write(os); + os.writeKeyword("t0") << t0_ << token::END_STATEMENT << nl; + os.writeKeyword("thetaT0") << thetaT0_ << token::END_STATEMENT << nl; + os.writeKeyword("te") << te_ << token::END_STATEMENT << nl; + os.writeKeyword("thetaTe") << thetaTe_ << token::END_STATEMENT << nl; + writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + makePatchTypeField + ( + fvPatchScalarField, + timeVaryingAlphaContactAngleFvPatchScalarField + ); +} + +// ************************************************************************* // diff --git a/src/transportModels/interfaceProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.H b/src/transportModels/interfaceProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.H new file mode 100644 index 00000000000..a2a071357e4 --- /dev/null +++ b/src/transportModels/interfaceProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.H @@ -0,0 +1,148 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::timeVaryingAlphaContactAngleFvPatchScalarField + +Description + A time-varying alphaContactAngle scalar boundary condition + (alphaContactAngleFvPatchScalarField) + +SourceFiles + timeVaryingAlphaContactAngleFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef timeVaryingAlphaContactAngleFvPatchScalarField_H +#define timeVaryingAlphaContactAngleFvPatchScalarField_H + +#include "alphaContactAngleFvPatchScalarField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class timeVaryingAlphaContactAngleFvPatch Declaration +\*---------------------------------------------------------------------------*/ + +class timeVaryingAlphaContactAngleFvPatchScalarField +: + public alphaContactAngleFvPatchScalarField +{ + // Private data + + // Equilibrium contact angle control parameters + scalar t0_; + scalar thetaT0_; + scalar te_; + scalar thetaTe_; + + +public: + + //- Runtime type information + TypeName("timeVaryingAlphaContactAngle"); + + + // Constructors + + //- Construct from patch and internal field + timeVaryingAlphaContactAngleFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + timeVaryingAlphaContactAngleFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given timeVaryingAlphaContactAngleFvPatchScalarField + // onto a new patch + timeVaryingAlphaContactAngleFvPatchScalarField + ( + const timeVaryingAlphaContactAngleFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct and return a clone + virtual tmp<fvPatchScalarField> clone() const + { + return tmp<fvPatchScalarField> + ( + new timeVaryingAlphaContactAngleFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + timeVaryingAlphaContactAngleFvPatchScalarField + ( + const timeVaryingAlphaContactAngleFvPatchScalarField&, + 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 timeVaryingAlphaContactAngleFvPatchScalarField(*this, iF) + ); + } + + + // Member functions + + //- Evaluate and return the time-varying equilibrium contact-angle + virtual tmp<scalarField> theta + ( + const fvPatchVectorField& Up, + const fvsPatchVectorField& nHat + ) const; + + //- Write + virtual void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/transportModels/interfaceProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.C b/src/transportModels/interfaceProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.C new file mode 100644 index 00000000000..85d7f471059 --- /dev/null +++ b/src/transportModels/interfaceProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.C @@ -0,0 +1,179 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "alphaFixedPressureFvPatchScalarField.H" +#include "addToRunTimeSelectionTable.H" +#include "fvPatchFieldMapper.H" +#include "volFields.H" +#include "surfaceFields.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::alphaFixedPressureFvPatchScalarField:: +alphaFixedPressureFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchScalarField(p, iF), + p_(p.size(), 0.0) +{} + + +Foam::alphaFixedPressureFvPatchScalarField:: +alphaFixedPressureFvPatchScalarField +( + const alphaFixedPressureFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + fixedValueFvPatchScalarField(ptf, p, iF, mapper), + p_(ptf.p_, mapper) +{} + + +Foam::alphaFixedPressureFvPatchScalarField:: +alphaFixedPressureFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + fixedValueFvPatchScalarField(p, iF), + p_("p", dict, p.size()) +{ + if (dict.found("value")) + { + fvPatchField<scalar>::operator= + ( + scalarField("value", dict, p.size()) + ); + } + else + { + fvPatchField<scalar>::operator=(p_); + } +} + + +Foam::alphaFixedPressureFvPatchScalarField:: +alphaFixedPressureFvPatchScalarField +( + const alphaFixedPressureFvPatchScalarField& tppsf +) +: + fixedValueFvPatchScalarField(tppsf), + p_(tppsf.p_) +{} + + +Foam::alphaFixedPressureFvPatchScalarField:: +alphaFixedPressureFvPatchScalarField +( + const alphaFixedPressureFvPatchScalarField& tppsf, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchScalarField(tppsf, iF), + p_(tppsf.p_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::alphaFixedPressureFvPatchScalarField::autoMap +( + const fvPatchFieldMapper& m +) +{ + scalarField::autoMap(m); + p_.autoMap(m); +} + + +void Foam::alphaFixedPressureFvPatchScalarField::rmap +( + const fvPatchScalarField& ptf, + const labelList& addr +) +{ + fixedValueFvPatchScalarField::rmap(ptf, addr); + + const alphaFixedPressureFvPatchScalarField& tiptf = + refCast<const alphaFixedPressureFvPatchScalarField>(ptf); + + p_.rmap(tiptf.p_, addr); +} + + +void Foam::alphaFixedPressureFvPatchScalarField::updateCoeffs() +{ + if (updated()) + { + return; + } + + const dictionary& environmentalProperties + = db().lookupObject<IOdictionary>("environmentalProperties"); + + dimensionedVector g(environmentalProperties.lookup("g")); + + const fvPatchField<scalar>& rho = + patch().lookupPatchField<volScalarField, scalar>("rho"); + + operator==(p_ - rho*(g.value() & patch().Cf())); + + fixedValueFvPatchScalarField::updateCoeffs(); +} + + +void Foam::alphaFixedPressureFvPatchScalarField::write +( + Ostream& os +) const +{ + fvPatchScalarField::write(os); + p_.writeEntry("p", os); + writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + makePatchTypeField + ( + fvPatchScalarField, + alphaFixedPressureFvPatchScalarField + ); +} + +// ************************************************************************* // diff --git a/src/transportModels/interfaceProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.H b/src/transportModels/interfaceProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.H new file mode 100644 index 00000000000..1a7200b1ce4 --- /dev/null +++ b/src/transportModels/interfaceProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.H @@ -0,0 +1,180 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::alphaFixedPressureFvPatchScalarField + +Description + A fixed-pressure alphaContactAngle boundary + +SourceFiles + alphaFixedPressureFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef alphaFixedPressureFvPatchScalarField_H +#define alphaFixedPressureFvPatchScalarField_H + +#include "fixedValueFvPatchFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class alphaFixedPressureFvPatch Declaration +\*---------------------------------------------------------------------------*/ + +class alphaFixedPressureFvPatchScalarField +: + public fixedValueFvPatchScalarField +{ + // Private data + + //- Fixed pressure + scalarField p_; + + +public: + + //- Runtime type information + TypeName("alphaFixedPressure"); + + + // Constructors + + //- Construct from patch and internal field + alphaFixedPressureFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + alphaFixedPressureFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given alphaFixedPressureFvPatchScalarField + // onto a new patch + alphaFixedPressureFvPatchScalarField + ( + const alphaFixedPressureFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + alphaFixedPressureFvPatchScalarField + ( + const alphaFixedPressureFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchScalarField> clone() const + { + return tmp<fvPatchScalarField> + ( + new alphaFixedPressureFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + alphaFixedPressureFvPatchScalarField + ( + const alphaFixedPressureFvPatchScalarField&, + 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 alphaFixedPressureFvPatchScalarField(*this, iF) + ); + } + + + // Member functions + + // Access + + //- Return the alphaFixed pressure + const scalarField& p() const + { + return p_; + } + + //- Return reference to the alphaFixed pressure to allow adjustment + scalarField& p() + { + return p_; + } + + + // Mapping functions + + //- Map (and resize as needed) from self given a mapping object + virtual void autoMap + ( + const fvPatchFieldMapper& + ); + + //- Reverse map the given fvPatchField onto this fvPatchField + virtual void rmap + ( + const fvPatchScalarField&, + const labelList& + ); + + + // Evaluation functions + + //- Update the coefficients associated with the patch field + virtual void updateCoeffs(); + + + //- Write + virtual void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/Allwmake b/src/turbulenceModels/compressible/Allwmake new file mode 100755 index 00000000000..4686db7027c --- /dev/null +++ b/src/turbulenceModels/compressible/Allwmake @@ -0,0 +1,9 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory +set -x + +#wmake libso turbulenceModel +wmake libso RAS +wmake libso LES + +# ----------------------------------------------------------------- end-of-file diff --git a/src/turbulenceModels/compressible/LES/DeardorffDiffStress/DeardorffDiffStress.C b/src/turbulenceModels/compressible/LES/DeardorffDiffStress/DeardorffDiffStress.C new file mode 100644 index 00000000000..28f31e7164f --- /dev/null +++ b/src/turbulenceModels/compressible/LES/DeardorffDiffStress/DeardorffDiffStress.C @@ -0,0 +1,150 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "DeardorffDiffStress.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace LESModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(DeardorffDiffStress, 0); +addToRunTimeSelectionTable(LESModel, DeardorffDiffStress, dictionary); + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +// from components +DeardorffDiffStress::DeardorffDiffStress +( + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& phi, + const basicThermo& thermoPhysicalModel +) +: + LESModel(typeName, rho, U, phi, thermoPhysicalModel), + GenSGSStress(rho, U, phi, thermoPhysicalModel), + + ck_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "ck", + coeffDict(), + 0.094 + ) + ), + cm_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "cm", + coeffDict(), + 4.13 + ) + ) +{ + printCoeffs(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void DeardorffDiffStress::correct(const tmp<volTensorField>& tgradU) +{ + const volTensorField& gradU = tgradU(); + + GenSGSStress::correct(gradU); + + volSymmTensorField D = symm(gradU); + + volSymmTensorField P = -rho()*twoSymm(B_ & gradU); + + volScalarField K = 0.5*tr(B_); + + solve + ( + fvm::ddt(rho(), B_) + + fvm::div(phi(), B_) + - fvm::laplacian(DBEff(), B_) + + fvm::Sp(cm_*rho()*sqrt(K)/delta(), B_) + == + P + + 0.8*rho()*K*D + - (2*ce_ - 0.667*cm_)*I*rho()*epsilon() + ); + + + // Bounding the component kinetic energies + + forAll(B_, celli) + { + B_[celli].component(symmTensor::XX) = + max(B_[celli].component(symmTensor::XX), 1.0e-10); + B_[celli].component(symmTensor::YY) = + max(B_[celli].component(symmTensor::YY), 1.0e-10); + B_[celli].component(symmTensor::ZZ) = + max(B_[celli].component(symmTensor::ZZ), 1.0e-10); + } + + K = 0.5*tr(B_); + bound(K, k0()); + + muSgs_ = ck_*rho()*sqrt(K)*delta(); + muSgs_.correctBoundaryConditions(); +} + + +bool DeardorffDiffStress::read() +{ + if (GenSGSStress::read()) + { + ck_.readIfPresent(coeffDict()); + cm_.readIfPresent(coeffDict()); + + return true; + } + else + { + return false; + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace compressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/LES/DeardorffDiffStress/DeardorffDiffStress.H b/src/turbulenceModels/compressible/LES/DeardorffDiffStress/DeardorffDiffStress.H new file mode 100644 index 00000000000..bfbcb2a41be --- /dev/null +++ b/src/turbulenceModels/compressible/LES/DeardorffDiffStress/DeardorffDiffStress.H @@ -0,0 +1,141 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::compressible::LESModels::DeardorffDiffStress + +Description + Differential SGS Stress Equation Model for compressible flows + + The DSEM uses a model version of the full balance equation for the SGS + stress tensor to simulate the behaviour of B. + Thus, + @verbatim + d/dt(rho*B) + div(rho*U*B) - div(muSgs*grad(B)) + = + P - c1*rho*epsilon/k*B - 0.667*(1 - c1)*rho*epsilon*I - c2*(P - 0.333*trP*I) + + where + + k = 0.5*trB, + epsilon = ce*k^3/2/delta, + epsilon/k = ce*k^1/2/delta + P = -rho*(B'L + L'B) + muSgs = ck*rho*sqrt(k)*delta + muEff = muSgs + mu + @endverbatim + +SourceFiles + DeardorffDiffStress.C + +\*---------------------------------------------------------------------------*/ + +#ifndef compressibleDeardorffDiffStress_H +#define compressibleDeardorffDiffStress_H + +#include "GenSGSStress.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace LESModels +{ + +/*---------------------------------------------------------------------------*\ + Class DeardorffDiffStress Declaration +\*---------------------------------------------------------------------------*/ + +class DeardorffDiffStress +: + public GenSGSStress +{ + // Private data + + dimensionedScalar ck_; + dimensionedScalar cm_; + + + // Private Member Functions + + // Disallow default bitwise copy construct and assignment + DeardorffDiffStress(const DeardorffDiffStress&); + DeardorffDiffStress& operator=(const DeardorffDiffStress&); + + +public: + + //- Runtime type information + TypeName("DeardorffDiffStress"); + + // Constructors + + //- Constructor from components + DeardorffDiffStress + ( + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& phi, + const basicThermo& thermoPhysicalModel + ); + + + // Destructor + + ~DeardorffDiffStress() + {} + + + // Member Functions + + //- Return the effective diffusivity for B + tmp<volScalarField> DBEff() const + { + return tmp<volScalarField> + ( + new volScalarField("DBEff", muSgs_ + mu()) + ); + } + + //- Correct Eddy-Viscosity and related properties + void correct(const tmp<volTensorField>& gradU); + + //- Read turbulenceProperties dictionary + bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace compressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/LES/GenEddyVisc/GenEddyVisc.C b/src/turbulenceModels/compressible/LES/GenEddyVisc/GenEddyVisc.C new file mode 100644 index 00000000000..c3843bb8f19 --- /dev/null +++ b/src/turbulenceModels/compressible/LES/GenEddyVisc/GenEddyVisc.C @@ -0,0 +1,144 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "GenEddyVisc.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace LESModels +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +// from components +GenEddyVisc::GenEddyVisc +( + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& phi, + const basicThermo& thermoPhysicalModel +) +: + LESModel + ( + word("GenEddyVisc"), rho, U, phi, thermoPhysicalModel + ), + + ce_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "ce", + coeffDict(), + 1.048 + ) + ), + + k_ + ( + IOobject + ( + "k", + runTime_.timeName(), + mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh_ + ), + + muSgs_ + ( + IOobject + ( + "muSgs", + runTime_.timeName(), + mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh_ + ) +{ +// printCoeffs(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +tmp<volSymmTensorField> GenEddyVisc::B() const +{ + return ((2.0/3.0)*I)*k_ - (muSgs_/rho())*dev(twoSymm(fvc::grad(U()))); +} + + +tmp<volSymmTensorField> GenEddyVisc::devRhoBeff() const +{ + return -muEff()*dev(twoSymm(fvc::grad(U()))); +} + + +tmp<fvVectorMatrix> GenEddyVisc::divDevRhoBeff(volVectorField& U) const +{ + return + ( + - fvm::laplacian(muEff(), U) - fvc::div(muEff()*dev2(fvc::grad(U)().T())) + ); +} + + +void GenEddyVisc::correct(const tmp<volTensorField>& gradU) +{ + LESModel::correct(gradU); +} + + +bool GenEddyVisc::read() +{ + if (LESModel::read()) + { + ce_.readIfPresent(coeffDict()); + + return true; + } + else + { + return false; + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace compressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/LES/GenEddyVisc/GenEddyVisc.H b/src/turbulenceModels/compressible/LES/GenEddyVisc/GenEddyVisc.H new file mode 100644 index 00000000000..cd501e9f68e --- /dev/null +++ b/src/turbulenceModels/compressible/LES/GenEddyVisc/GenEddyVisc.H @@ -0,0 +1,155 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::compressible::LESModels::GenEddyVisc + +Description + General base class for all compressible models that can be implemented as + an eddy viscosity, i.e. algebraic and one-equation models. + + Contains fields for k (SGS turbulent kinetic energy), gamma + (modelled viscosity) and epsilon (SGS dissipation). + +SourceFiles + GenEddyVisc.C + +\*---------------------------------------------------------------------------*/ + +#ifndef compressibleGenEddyVisc_H +#define compressibleGenEddyVisc_H + +#include "LESModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace LESModels +{ + +/*---------------------------------------------------------------------------*\ + Class GenEddyVisc Declaration +\*---------------------------------------------------------------------------*/ + +class GenEddyVisc +: + virtual public LESModel +{ + // Private Member Functions + + // Disallow default bitwise copy construct and assignment + GenEddyVisc(const GenEddyVisc&); + GenEddyVisc& operator=(const GenEddyVisc&); + + +protected: + + dimensionedScalar ce_; + + volScalarField k_; + volScalarField muSgs_; + + +public: + + // Constructors + + //- Construct from components + GenEddyVisc + ( + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& phi, + const basicThermo& thermoPhysicalModel + ); + + + // Destructor + + virtual ~GenEddyVisc() + {} + + + // Member Functions + + //- Return SGS kinetic energy + virtual tmp<volScalarField> k() const + { + return k_; + } + + //- Return sub-grid disipation rate + virtual tmp<volScalarField> epsilon() const + { + return ce_*k_*sqrt(k_)/delta(); + } + + //- Return viscosity + virtual tmp<volScalarField> muSgs() const + { + return muSgs_; + } + + //- Return thermal conductivity + virtual tmp<volScalarField> alphaEff() const + { + return tmp<volScalarField> + ( + new volScalarField("alphaEff", muSgs_ + alpha()) + ); + } + + //- Return the sub-grid stress tensor. + virtual tmp<volSymmTensorField> B() const; + + //- Return the deviatoric part of the effective sub-grid + // turbulence stress tensor including the laminar stress + virtual tmp<volSymmTensorField> devRhoBeff() const; + + //- Returns div(rho*dev(B)). + // This is the additional term due to the filtering of the NSE. + virtual tmp<fvVectorMatrix> divDevRhoBeff(volVectorField& U) const; + + //- Correct Eddy-Viscosity and related properties + virtual void correct(const tmp<volTensorField>& gradU); + + //- Read turbulenceProperties dictionary + bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace compressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/LES/GenSGSStress/GenSGSStress.C b/src/turbulenceModels/compressible/LES/GenSGSStress/GenSGSStress.C new file mode 100644 index 00000000000..7ef8ebee764 --- /dev/null +++ b/src/turbulenceModels/compressible/LES/GenSGSStress/GenSGSStress.C @@ -0,0 +1,159 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "GenSGSStress.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace LESModels +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +// from components +GenSGSStress::GenSGSStress +( + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& phi, + const basicThermo& thermoPhysicalModel +) +: + LESModel + ( + word("GenSGSStress"), + rho, + U, + phi, + thermoPhysicalModel + ), + + ce_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "ce", + coeffDict(), + 1.048 + ) + ), + + B_ + ( + IOobject + ( + "B", + runTime_.timeName(), + mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh_ + ), + + muSgs_ + ( + IOobject + ( + "muSgs", + runTime_.timeName(), + mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh_ + ) +{ +// printCoeffs(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +tmp<volSymmTensorField> GenSGSStress::devRhoBeff() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + "devRhoReff", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + rho()*B_ - mu()*dev(twoSymm(fvc::grad(U()))) + ) + ); +} + + +tmp<fvVectorMatrix> GenSGSStress::divDevRhoBeff(volVectorField& U) const +{ + return + ( + fvc::div(rho()*B_ + 0.05*muSgs_*fvc::grad(U)) + + fvc::laplacian(0.95*muSgs_, U, "laplacian(muEff,U)") + - fvm::laplacian(muEff(), U) + - fvc::div(mu()*dev2(fvc::grad(U)().T())) + ); +} + + +void GenSGSStress::correct(const tmp<volTensorField>& gradU) +{ + LESModel::correct(gradU); +} + + +bool GenSGSStress::read() +{ + if (LESModel::read()) + { + ce_.readIfPresent(coeffDict()); + + return true; + } + else + { + return false; + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace compressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/LES/GenSGSStress/GenSGSStress.H b/src/turbulenceModels/compressible/LES/GenSGSStress/GenSGSStress.H new file mode 100644 index 00000000000..c071a7a01cc --- /dev/null +++ b/src/turbulenceModels/compressible/LES/GenSGSStress/GenSGSStress.H @@ -0,0 +1,160 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::compressible::LESModels::GenSGSStress + +Description + General base class for all compressible models that directly + solve for the SGS stress tensor B. + + Contains tensor fields B (the SGS stress tensor) as well as scalar + fields for k (SGS turbulent energy) gamma (SGS viscosity) and epsilon + (SGS dissipation). + +SourceFiles + GenSGSStress.C + +\*---------------------------------------------------------------------------*/ + +#ifndef compressibleGenSGSStress_H +#define compressibleGenSGSStress_H + +#include "LESModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace LESModels +{ + +/*---------------------------------------------------------------------------*\ + Class GenSGSStress Declaration +\*---------------------------------------------------------------------------*/ + +class GenSGSStress +: + virtual public LESModel +{ + // Private Member Functions + + // Disallow default bitwise copy construct and assignment + GenSGSStress(const GenSGSStress&); + GenSGSStress& operator=(const GenSGSStress&); + + +protected: + + dimensionedScalar ce_; + + volSymmTensorField B_; + volScalarField muSgs_; + + +public: + + // Constructors + + //- Constructor from components + GenSGSStress + ( + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& phi, + const basicThermo& thermoPhysicalModel + ); + + + // Destructor + + virtual ~GenSGSStress() + {} + + + // Member Functions + + //- Return the SGS turbulent kinetic energy. + virtual tmp<volScalarField> k() const + { + return 0.5*tr(B_); + } + + //- Return the SGS turbulent dissipation. + virtual tmp<volScalarField> epsilon() const + { + volScalarField K = k(); + return ce_*K*sqrt(K)/delta(); + } + + //- Return the SGS viscosity. + virtual tmp<volScalarField> muSgs() const + { + return muSgs_; + } + + //- Return thermal conductivity + virtual tmp<volScalarField> alphaEff() const + { + return tmp<volScalarField> + ( + new volScalarField("alphaEff", muSgs_ + alpha()) + ); + } + + //- Return the sub-grid stress tensor. + virtual tmp<volSymmTensorField> B() const + { + return B_; + } + + //- Return the deviatoric part of the effective sub-grid + // turbulence stress tensor including the laminar stress + virtual tmp<volSymmTensorField> devRhoBeff() const; + + //- Returns divergence of B : i.e. the additional term in the + // filtered NSE. + virtual tmp<fvVectorMatrix> divDevRhoBeff(volVectorField& U) const; + + //- Correct Eddy-Viscosity and related properties + virtual void correct(const tmp<volTensorField>& gradU); + + //- Read turbulenceProperties dictionary + bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace compressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/LES/LESModel/LESModel.C b/src/turbulenceModels/compressible/LES/LESModel/LESModel.C new file mode 100644 index 00000000000..8591c4c7b46 --- /dev/null +++ b/src/turbulenceModels/compressible/LES/LESModel/LESModel.C @@ -0,0 +1,133 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "LESModel.H" +#include "wallDist.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(LESModel, 0); +defineRunTimeSelectionTable(LESModel, dictionary); + +// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * // + +void LESModel::printCoeffs() +{ + if (printCoeffs_) + { + Info<< type() << "Coeffs" << coeffDict_ << endl; + } +} + + +// * * * * * * * * * * * * * * * Constructor * * * * * * * * * * * * * * * * // + +LESModel::LESModel +( + const word& type, + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& phi, + const basicThermo& thermoPhysicalModel +) +: + IOdictionary + ( + IOobject + ( + "LESProperties", + U.time().constant(), + U.db(), + IOobject::MUST_READ, + IOobject::NO_WRITE + ) + ), + + runTime_(U.time()), + mesh_(U.mesh()), + + rho_(rho), + U_(U), + phi_(phi), + thermoPhysicalModel_(thermoPhysicalModel), + + printCoeffs_(lookupOrDefault<Switch>("printCoeffs", false)), + coeffDict_(subDict(type + "Coeffs")), + + k0_("k0", dimVelocity*dimVelocity, SMALL), + + delta_(LESdelta::New("delta", U.mesh(), *this)) +{ + readIfPresent("k0", k0_); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void LESModel::correct(const tmp<volTensorField>&) +{ + delta_().correct(); +} + + +void LESModel::correct() +{ + correct(fvc::grad(U_)); +} + + +bool LESModel::read() +{ + if (regIOobject::read()) + { + coeffDict_ = subDict(type() + "Coeffs"); + + delta_().read(*this); + + readIfPresent("k0", k0_); + + return true; + } + else + { + return false; + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace compressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/LES/LESModel/LESModel.H b/src/turbulenceModels/compressible/LES/LESModel/LESModel.H new file mode 100644 index 00000000000..ecef2d8f771 --- /dev/null +++ b/src/turbulenceModels/compressible/LES/LESModel/LESModel.H @@ -0,0 +1,293 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Namespace + Foam::compressible::LESModels + +Description + Namespace for compressible LES models. + + +Class + Foam::compressible::LESModel + +Description + Class for all compressible flow LES SGS models. + + This class defines the basic interface for a compressible flow SGS model, + and encapsulates data of value to all possible models. In particular + this includes references to all the dependent fields (rho, U, phi), + the physical viscosity mu, and the turbulenceProperties dictionary + which contains the model selection and model coefficients. + +SourceFiles + LESModel.C + newLESModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef compressibleLESModel_H +#define compressibleLESModel_H + +#include "LESdelta.H" +#include "fvm.H" +#include "fvc.H" +#include "fvMatrices.H" +#include "basicThermo.H" +#include "bound.H" +#include "autoPtr.H" +#include "runTimeSelectionTables.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ + +/*---------------------------------------------------------------------------*\ + Class LESModel Declaration +\*---------------------------------------------------------------------------*/ + +class LESModel +: + public IOdictionary +{ + +protected: + + // Protected data + + const Time& runTime_; + const fvMesh& mesh_; + + +private: + + // Private data + + const volScalarField& rho_; + const volVectorField& U_; + const surfaceScalarField& phi_; + + const basicThermo& thermoPhysicalModel_; + + Switch printCoeffs_; + dictionary coeffDict_; + + dimensionedScalar k0_; + + autoPtr<LESdelta> delta_; + + + // Private Member Functions + + // Disallow default bitwise copy construct and assignment + LESModel(const LESModel&); + LESModel& operator=(const LESModel&); + + +protected: + + // Protected Member Functions + + //- Print model coefficients + virtual void printCoeffs(); + + +public: + + //- Runtime type information + TypeName("LESModel"); + + + // Declare run-time constructor selection table + + declareRunTimeSelectionTable + ( + autoPtr, + LESModel, + dictionary, + ( + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& phi, + const basicThermo& thermoPhysicalModel + ), + (rho, U, phi, thermoPhysicalModel) + ); + + + // Constructors + + //- Construct from components + LESModel + ( + const word& type, + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& phi, + const basicThermo& thermoPhysicalModel + ); + + + // Selectors + + //- Return a reference to the selected LES model + static autoPtr<LESModel> New + ( + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& phi, + const basicThermo& thermoPhysicalModel + ); + + + // Destructor + + virtual ~LESModel() + {} + + + // Member Functions + + // Access + + //- Access function to the density field + inline const volScalarField& rho() const + { + return rho_; + } + + //- Access function to velocity field + inline const volVectorField& U() const + { + return U_; + } + + //- Access function to flux field + inline const surfaceScalarField& phi() const + { + return phi_; + } + + //- Access function to the thermophysical properties model + inline const basicThermo& thermo() const + { + return thermoPhysicalModel_; + } + + //- Access the dictionary which provides info. about choice of + // models, and all related data (particularly model coefficients). + inline dictionary& coeffDict() + { + return coeffDict_; + } + + //- Access function to filter width + inline const volScalarField& delta() const + { + return delta_(); + } + + //- Return the value of k0 which k is not allowed to be less than + const dimensionedScalar& k0() const + { + return k0_; + } + + //- Allow k0 to be changed + dimensionedScalar& k0() + { + return k0_; + } + + //- Access function to laminar viscosity + tmp<volScalarField> mu() const + { + return thermoPhysicalModel_.mu(); + } + + //- Access function to laminar thermal conductivity + tmp<volScalarField> alpha() const + { + return thermoPhysicalModel_.alpha(); + } + + + //- Return the SGS turbulent kinetic energy. + virtual tmp<volScalarField> k() const = 0; + + //- Return the SGS turbulent dissipation. + virtual tmp<volScalarField> epsilon() const = 0; + + //- Return the effective viscosity + virtual tmp<volScalarField> muSgs() const = 0; + + //- Return the effective viscosity + virtual tmp<volScalarField> muEff() const + { + return tmp<volScalarField> + ( + new volScalarField("muEff", muSgs() + mu()) + ); + } + + //- Return the SGS thermal conductivity. + virtual tmp<volScalarField> alphaEff() const = 0; + + //- Return the sub-grid stress tensor. + virtual tmp<volSymmTensorField> B() const = 0; + + //- Return the deviatoric part of the effective sub-grid + // turbulence stress tensor including the laminar stress + virtual tmp<volSymmTensorField> devRhoBeff() const = 0; + + //- Returns div(rho*dev(B)). + // This is the additional term due to the filtering of the NSE. + virtual tmp<fvVectorMatrix> divDevRhoBeff(volVectorField& U) const = 0; + + //- Correct Eddy-Viscosity and related properties. + // This calls correct(const tmp<volTensorField>& gradU) by supplying + // gradU calculated locally. + void correct(); + + //- Correct Eddy-Viscosity and related properties + virtual void correct(const tmp<volTensorField>& gradU); + + //- Read turbulenceProperties dictionary + virtual bool read() = 0; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace compressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/LES/LESModel/newLESModel.C b/src/turbulenceModels/compressible/LES/LESModel/newLESModel.C new file mode 100644 index 00000000000..b411074b170 --- /dev/null +++ b/src/turbulenceModels/compressible/LES/LESModel/newLESModel.C @@ -0,0 +1,94 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "LESModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +autoPtr<LESModel> LESModel::New +( + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& phi, + const basicThermo& thermoPhysicalModel +) +{ + word LESModelTypeName; + + // Enclose the creation of the turbulencePropertiesDict to ensure it is + // deleted before the turbulenceModel is created otherwise the dictionary + // is entered in the database twice + { + IOdictionary turbulencePropertiesDict + ( + IOobject + ( + "LESProperties", + U.time().constant(), + U.db(), + IOobject::MUST_READ, + IOobject::NO_WRITE + ) + ); + + turbulencePropertiesDict.lookup("LESModel") >> LESModelTypeName; + } + + Info<< "Selecting LES turbulence model " << LESModelTypeName << endl; + + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(LESModelTypeName); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalErrorIn + ( + "LESModel::New(const volVectorField& U, const " + "surfaceScalarField& phi, const basicThermo&)" + ) << "Unknown LESModel type " << LESModelTypeName + << endl << endl + << "Valid LESModel types are :" << endl + << dictionaryConstructorTablePtr_->toc() + << exit(FatalError); + } + + return autoPtr<LESModel>(cstrIter()(rho, U, phi, thermoPhysicalModel)); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace compressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/LES/Make/files b/src/turbulenceModels/compressible/LES/Make/files new file mode 100644 index 00000000000..dc31f55cae3 --- /dev/null +++ b/src/turbulenceModels/compressible/LES/Make/files @@ -0,0 +1,19 @@ +LESModel/LESModel.C +LESModel/newLESModel.C +GenEddyVisc/GenEddyVisc.C +GenSGSStress/GenSGSStress.C + +Smagorinsky/Smagorinsky.C +oneEqEddy/oneEqEddy.C +lowReOneEqEddy/lowReOneEqEddy.C +dynOneEqEddy/dynOneEqEddy.C +DeardorffDiffStress/DeardorffDiffStress.C +SpalartAllmaras/SpalartAllmaras.C + +/* Wall functions */ +wallFunctions=derivedFvPatchFields/wallFunctions + +muSgsWallFunctions=$(wallFunctions)/muSgsWallFunctions +$(muSgsWallFunctions)/muSgsSpalartAllmarasWallFunction/muSgsSpalartAllmarasWallFunctionFvPatchScalarField.C + +LIB = $(FOAM_LIBBIN)/libcompressibleLESModels diff --git a/src/turbulenceModels/compressible/LES/Make/options b/src/turbulenceModels/compressible/LES/Make/options new file mode 100644 index 00000000000..4ccb52fba2e --- /dev/null +++ b/src/turbulenceModels/compressible/LES/Make/options @@ -0,0 +1,11 @@ +EXE_INC = \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude \ + -I../../LES/LESdeltas/lnInclude \ + -I../../LES/LESfilters/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude + +LIB_LIBS = \ + -lLESdeltas \ + -lLESfilters \ + -lmeshTools diff --git a/src/turbulenceModels/compressible/LES/Smagorinsky/Smagorinsky.C b/src/turbulenceModels/compressible/LES/Smagorinsky/Smagorinsky.C new file mode 100644 index 00000000000..547fd60f5e5 --- /dev/null +++ b/src/turbulenceModels/compressible/LES/Smagorinsky/Smagorinsky.C @@ -0,0 +1,112 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "Smagorinsky.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace LESModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(Smagorinsky, 0); +addToRunTimeSelectionTable(LESModel, Smagorinsky, dictionary); + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +// from components +Smagorinsky::Smagorinsky +( + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& phi, + const basicThermo& thermoPhysicalModel +) +: + LESModel(typeName, rho, U, phi, thermoPhysicalModel), + GenEddyVisc(rho, U, phi, thermoPhysicalModel), + + ck_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "ck", + coeffDict(), + 0.02 + ) + ) +{ + printCoeffs(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Smagorinsky::correct(const tmp<volTensorField>& gradU) +{ + GenEddyVisc::correct(gradU); + + volSymmTensorField D = symm(gradU); + + volScalarField a = ce_/delta(); + volScalarField b = (2.0/3.0)*tr(D); + volScalarField c = 2*ck_*delta()*(dev(D) && D); + + k_ = sqr((-b + sqrt(sqr(b) + 4*a*c))/(2*a)); + + muSgs_ = ck_*rho()*delta()*sqrt(k_); + muSgs_.correctBoundaryConditions(); +} + + +bool Smagorinsky::read() +{ + if (GenEddyVisc::read()) + { + ck_.readIfPresent(coeffDict()); + + return true; + } + else + { + return false; + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace compressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/LES/Smagorinsky/Smagorinsky.H b/src/turbulenceModels/compressible/LES/Smagorinsky/Smagorinsky.H new file mode 100644 index 00000000000..e5d786f94af --- /dev/null +++ b/src/turbulenceModels/compressible/LES/Smagorinsky/Smagorinsky.H @@ -0,0 +1,127 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::compressible::LESModels::Smagorinsky + +Description + The choric Smagorinsky Model for compressible flows. + + Algebraic eddy viscosity SGS model founded on the assumption that + local equilibrium prevails. + Thus, + @verbatim + + B = 2/3*k*I - 2*nuSgs*dev(D) + + where + + D = symm(grad(U)); + k from rho*D:B + ce*rho*k^3/2/delta = 0 + muSgs = ck*rho*sqrt(k)*delta + @endverbatim + +SourceFiles + Smagorinsky.C + +\*---------------------------------------------------------------------------*/ + +#ifndef compressibleSmagorinsky_H +#define compressibleSmagorinsky_H + +#include "GenEddyVisc.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace LESModels +{ + +/*---------------------------------------------------------------------------*\ + Class Smagorinsky Declaration +\*---------------------------------------------------------------------------*/ + +class Smagorinsky +: + public GenEddyVisc +{ + // Private data + + dimensionedScalar ck_; + + + // Private Member Functions + + // Disallow default bitwise copy construct and assignment + Smagorinsky(const Smagorinsky&); + Smagorinsky& operator=(const Smagorinsky&); + + +public: + + //- Runtime type information + TypeName("Smagorinsky"); + + // Constructors + + //- Construct from components + Smagorinsky + ( + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& phi, + const basicThermo& thermoPhysicalModel + ); + + + // Destructor + + ~Smagorinsky() + {} + + + // Member Functions + + //- Correct Eddy-Viscosity and related properties + void correct(const tmp<volTensorField>& gradU); + + //- Read turbulenceProperties dictionary + bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace compressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/LES/SpalartAllmaras/SpalartAllmaras.C b/src/turbulenceModels/compressible/LES/SpalartAllmaras/SpalartAllmaras.C new file mode 100644 index 00000000000..568598a0653 --- /dev/null +++ b/src/turbulenceModels/compressible/LES/SpalartAllmaras/SpalartAllmaras.C @@ -0,0 +1,329 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "SpalartAllmaras.H" +#include "addToRunTimeSelectionTable.H" +#include "wallDist.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace LESModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(SpalartAllmaras, 0); +addToRunTimeSelectionTable(LESModel, SpalartAllmaras, dictionary); + + +// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // + +tmp<volScalarField> SpalartAllmaras::fv1() const +{ + volScalarField chi3 = pow3(nuTilda_/(mu()/rho())); + return chi3/(chi3 + pow3(Cv1_)); +} + + +tmp<volScalarField> SpalartAllmaras::fv2() const +{ + volScalarField chi = nuTilda_/(mu()/rho()); + //return scalar(1) - chi/(scalar(1) + chi*fv1()); + return 1.0/pow3(scalar(1) + chi/Cv2_); +} + + +tmp<volScalarField> SpalartAllmaras::fv3() const +{ + volScalarField chi = nuTilda_/(mu()/rho()); + volScalarField chiByCv2 = (1/Cv2_)*chi; + + return + (scalar(1) + chi*fv1()) + *(1/Cv2_) + *(3*(scalar(1) + chiByCv2) + sqr(chiByCv2)) + /pow3(scalar(1) + chiByCv2); +} + + +tmp<volScalarField> SpalartAllmaras::fw(const volScalarField& Stilda) const +{ + volScalarField r = min + ( + nuTilda_ + /( + max(Stilda, dimensionedScalar("SMALL", Stilda.dimensions(), SMALL)) + *sqr(kappa_*dTilda_) + ), + scalar(10.0) + ); + r.boundaryField() == 0.0; + + volScalarField g = r + Cw2_*(pow6(r) - r); + + return g*pow((1.0 + pow6(Cw3_))/(pow6(g) + pow6(Cw3_)), 1.0/6.0); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +SpalartAllmaras::SpalartAllmaras +( + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& phi, + const basicThermo& thermoPhysicalModel +) +: + LESModel(typeName, rho, U, phi, thermoPhysicalModel), + + alphaNut_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphaNut", + coeffDict(), + 1.5 + ) + ), + + Cb1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Cb1", + coeffDict(), + 0.1355 + ) + ), + Cb2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Cb2", + coeffDict(), + 0.622 + ) + ), + Cv1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Cv1", + coeffDict(), + 7.1 + ) + ), + Cv2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Cv2", + coeffDict(), + 5.0 + ) + ), + CDES_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "CDES", + coeffDict(), + 0.65 + ) + ), + ck_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "ck", + coeffDict(), + 0.07 + ) + ), + kappa_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "kappa", + *this, + 0.4187 + ) + ), + Cw1_(Cb1_/sqr(kappa_) + alphaNut_*(1.0 + Cb2_)), + Cw2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Cw2", + coeffDict(), + 0.3 + ) + ), + Cw3_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Cw3", + coeffDict(), + 2.0 + ) + ), + + nuTilda_ + ( + IOobject + ( + "nuTilda", + runTime_.timeName(), + mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh_ + ), + + dTilda_(min(CDES_*delta(), wallDist(mesh_).y())), + muSgs_ + ( + IOobject + ( + "muSgs", + runTime_.timeName(), + mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh_ + ) + +{ + printCoeffs(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +tmp<volSymmTensorField> SpalartAllmaras::B() const +{ + return ((2.0/3.0)*I)*k() - (muSgs_/rho())*dev(twoSymm(fvc::grad(U()))); +} + + +tmp<volSymmTensorField> SpalartAllmaras::devRhoBeff() const +{ + return -muEff()*dev(twoSymm(fvc::grad(U()))); +} + + +tmp<volScalarField> SpalartAllmaras::epsilon() const +{ + return 2*muEff()/rho()*magSqr(symm(fvc::grad(U()))); +} + + +tmp<fvVectorMatrix> SpalartAllmaras::divDevRhoBeff(volVectorField& U) const +{ + return + ( + - fvm::laplacian(muEff(), U) - fvc::div(muEff()*dev2(fvc::grad(U)().T())) + ); +} + + +void SpalartAllmaras::correct(const tmp<volTensorField>& tgradU) +{ + const volTensorField& gradU = tgradU(); + LESModel::correct(gradU); + + if (mesh_.changing()) + { + dTilda_ = min(CDES_*delta(), wallDist(mesh_).y()); + } + + volScalarField Stilda = + fv3()*::sqrt(2.0)*mag(skew(gradU)) + fv2()*nuTilda_/sqr(kappa_*dTilda_); + + solve + ( + fvm::ddt(rho(), nuTilda_) + + fvm::div(phi(), nuTilda_) + - fvm::laplacian + ( + alphaNut_*(nuTilda_*rho() + mu()), + nuTilda_, + "laplacian(DnuTildaEff,nuTilda)" + ) + - alphaNut_*rho()*Cb2_*magSqr(fvc::grad(nuTilda_)) + == + rho()*Cb1_*Stilda*nuTilda_ + - fvm::Sp(rho()*Cw1_*fw(Stilda)*nuTilda_/sqr(dTilda_), nuTilda_) + ); + + bound(nuTilda_, dimensionedScalar("zero", nuTilda_.dimensions(), 0.0)); + + nuTilda_.correctBoundaryConditions(); + muSgs_.internalField() = rho()*fv1()*nuTilda_.internalField(); + muSgs_.correctBoundaryConditions(); +} + + +bool SpalartAllmaras::read() +{ + if (LESModel::read()) + { + alphaNut_.readIfPresent(coeffDict()); + Cb1_.readIfPresent(coeffDict()); + Cb2_.readIfPresent(coeffDict()); + Cw1_ = Cb1_/sqr(kappa_) + alphaNut_*(1.0 + Cb2_); + Cw2_.readIfPresent(coeffDict()); + Cw3_.readIfPresent(coeffDict()); + Cv1_.readIfPresent(coeffDict()); + Cv2_.readIfPresent(coeffDict()); + CDES_.readIfPresent(coeffDict()); + ck_.readIfPresent(coeffDict()); + kappa_.readIfPresent(*this); + + return true; + } + else + { + return false; + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace compressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/LES/SpalartAllmaras/SpalartAllmaras.H b/src/turbulenceModels/compressible/LES/SpalartAllmaras/SpalartAllmaras.H new file mode 100644 index 00000000000..67a1d7b8a83 --- /dev/null +++ b/src/turbulenceModels/compressible/LES/SpalartAllmaras/SpalartAllmaras.H @@ -0,0 +1,175 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::compressible::LESModels::SpalartAllmaras + +Description + SpalartAllmaras for compressible flows + +SourceFiles + SpalartAllmaras.C + +\*---------------------------------------------------------------------------*/ + +#ifndef compressibleSpalartAllmaras_H +#define compressibleSpalartAllmaras_H + +#include "LESModel.H" +#include "volFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace LESModels +{ + +/*---------------------------------------------------------------------------*\ + Class SpalartAllmaras Declaration +\*---------------------------------------------------------------------------*/ + +class SpalartAllmaras +: + public LESModel +{ + // Private data + + dimensionedScalar alphaNut_; + + dimensionedScalar Cb1_; + dimensionedScalar Cb2_; + dimensionedScalar Cv1_; + dimensionedScalar Cv2_; + dimensionedScalar CDES_; + dimensionedScalar ck_; + dimensionedScalar kappa_; + dimensionedScalar Cw1_; + dimensionedScalar Cw2_; + dimensionedScalar Cw3_; + + + // Private member functions + + tmp<volScalarField> fv1() const; + tmp<volScalarField> fv2() const; + tmp<volScalarField> fv3() const; + tmp<volScalarField> fw(const volScalarField& Stilda) const; + + // Disallow default bitwise copy construct and assignment + SpalartAllmaras(const SpalartAllmaras&); + SpalartAllmaras& operator=(const SpalartAllmaras&); + + volScalarField nuTilda_; + volScalarField dTilda_; + volScalarField muSgs_; + + +public: + + //- Runtime type information + TypeName("SpalartAllmaras"); + + + // Constructors + + //- Constructor from components + SpalartAllmaras + ( + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& phi, + const basicThermo& thermoPhysicalModel + ); + + + // Destructor + + ~SpalartAllmaras() + {} + + + // Member Functions + + //- Return SGS kinetic energy + tmp<volScalarField> k() const + { + return sqr(muSgs()/rho()/ck_/dTilda_); + } + + //- Return sub-grid disipation rate + tmp<volScalarField> epsilon() const; + + tmp<volScalarField> nuTilda() const + { + return nuTilda_; + } + + //- Return SGS viscosity + tmp<volScalarField> muSgs() const + { + return muSgs_; + } + + //- Return thermal conductivity + tmp<volScalarField> alphaEff() const + { + return tmp<volScalarField> + ( + new volScalarField("alphaEff", muSgs_ + alpha()) + ); + } + + //- Return the sub-grid stress tensor. + virtual tmp<volSymmTensorField> B() const; + + //- Return the deviatoric part of the effective sub-grid + // turbulence stress tensor including the laminar stress + virtual tmp<volSymmTensorField> devRhoBeff() const; + + //- Returns div(rho*dev(B)). + // This is the additional term due to the filtering of the NSE. + tmp<fvVectorMatrix> divDevRhoBeff(volVectorField& U) const; + + //- Correct nuTilda and related properties + void correct(const tmp<volTensorField>& gradU); + + //- Read turbulenceProperties dictionary + bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace compressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsSpalartAllmarasWallFunction/muSgsSpalartAllmarasWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsSpalartAllmarasWallFunction/muSgsSpalartAllmarasWallFunctionFvPatchScalarField.C new file mode 100644 index 00000000000..e210c32c730 --- /dev/null +++ b/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsSpalartAllmarasWallFunction/muSgsSpalartAllmarasWallFunctionFvPatchScalarField.C @@ -0,0 +1,205 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "muSgsSpalartAllmarasWallFunctionFvPatchScalarField.H" +#include "LESModel.H" +#include "fvPatchFieldMapper.H" +#include "volFields.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace LESModels +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +muSgsSpalartAllmarasWallFunctionFvPatchScalarField:: +muSgsSpalartAllmarasWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchScalarField(p, iF) +{} + + +muSgsSpalartAllmarasWallFunctionFvPatchScalarField:: +muSgsSpalartAllmarasWallFunctionFvPatchScalarField +( + const muSgsSpalartAllmarasWallFunctionFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + fixedValueFvPatchScalarField(ptf, p, iF, mapper) +{} + + +muSgsSpalartAllmarasWallFunctionFvPatchScalarField:: +muSgsSpalartAllmarasWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + Istream& is +) +: + fixedValueFvPatchScalarField(p, iF, is) +{} + + +muSgsSpalartAllmarasWallFunctionFvPatchScalarField:: +muSgsSpalartAllmarasWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + fixedValueFvPatchScalarField(p, iF, dict) +{} + + +muSgsSpalartAllmarasWallFunctionFvPatchScalarField:: +muSgsSpalartAllmarasWallFunctionFvPatchScalarField +( + const muSgsSpalartAllmarasWallFunctionFvPatchScalarField& tppsf +) +: + fixedValueFvPatchScalarField(tppsf) +{} + + +muSgsSpalartAllmarasWallFunctionFvPatchScalarField:: +muSgsSpalartAllmarasWallFunctionFvPatchScalarField +( + const muSgsSpalartAllmarasWallFunctionFvPatchScalarField& tppsf, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchScalarField(tppsf, iF) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void muSgsSpalartAllmarasWallFunctionFvPatchScalarField::evaluate +( + const Pstream::commsTypes +) +{ + const LESModel& sgsModel + = db().lookupObject<LESModel>("LESProperties"); + + scalar kappa = readScalar(sgsModel.lookup("kappa")); + + scalar E = readScalar(sgsModel.subDict("wallFunctionCoeffs").lookup("E")); + + const scalarField& ry = patch().deltaCoeffs(); + + const fvPatchVectorField& U = + patch().lookupPatchField<volVectorField, vector>("U"); + + scalarField magUp = mag(U.patchInternalField() - U); + + const scalarField& muw = + patch().lookupPatchField<volScalarField, scalar>("mu"); + + const scalarField& rhow = + patch().lookupPatchField<volScalarField, scalar>("rho"); + + scalarField& muSgsw = *this; + + scalarField magFaceGradU = mag(U.snGrad()); + + forAll(muSgsw, facei) + { + scalar magUpara = magUp[facei]; + + scalar utau = sqrt + ( + (muSgsw[facei] + muw[facei]) + *magFaceGradU[facei]/rhow[facei] + ); + + if(utau > 0) + { + int iter = 0; + scalar err = GREAT; + + do + { + scalar kUu = kappa*magUpara/utau; + scalar fkUu = exp(kUu) - 1 - kUu*(1 + 0.5*kUu); + + scalar f = + - utau/(ry[facei]*muw[facei]/rhow[facei]) + + magUpara/utau + + 1/E*(fkUu - 1.0/6.0*kUu*sqr(kUu)); + + scalar df = + - 1.0/(ry[facei]*muw[facei]/rhow[facei]) + - magUpara/sqr(utau) + - 1/E*kUu*fkUu/utau; + + scalar utauNew = utau - f/df; + err = mag((utau - utauNew)/utau); + utau = utauNew; + + } while (utau > VSMALL && err > 0.01 && ++iter < 10); + + muSgsw[facei] = + max(rhow[facei]*sqr(utau)/magFaceGradU[facei] - muw[facei],0.0); + } + else + { + muSgsw[facei] = 0; + } + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField +( + fvPatchScalarField, + muSgsSpalartAllmarasWallFunctionFvPatchScalarField +); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace compressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsSpalartAllmarasWallFunction/muSgsSpalartAllmarasWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsSpalartAllmarasWallFunction/muSgsSpalartAllmarasWallFunctionFvPatchScalarField.H new file mode 100644 index 00000000000..9d3210c1d41 --- /dev/null +++ b/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsSpalartAllmarasWallFunction/muSgsSpalartAllmarasWallFunctionFvPatchScalarField.H @@ -0,0 +1,165 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::compressible::LESModels:: + muSgsSpalartAllmarasWallFunctionFvPatchScalarField + +Description + Spalart Allmaas wall function boundary condition for compressible flows + +SourceFiles + muSgsSpalartAllmarasWallFunctionFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef muSgsSpalartAllmarasWallFunctionFvPatchScalarField_H +#define muSgsSpalartAllmarasWallFunctionFvPatchScalarField_H + +#include "fixedValueFvPatchFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace LESModels +{ + +/*---------------------------------------------------------------------------*\ + Class muSgsSpalartAllmarasWallFunctionFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class muSgsSpalartAllmarasWallFunctionFvPatchScalarField +: + public fixedValueFvPatchScalarField +{ + // Private data + + +public: + + //- Runtime type information + TypeName("muSgsSpalartAllmarasWallFunction"); + + + // Constructors + + //- Construct from patch and internal field + muSgsSpalartAllmarasWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and Istream + muSgsSpalartAllmarasWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + Istream& + ); + + //- Construct from patch, internal field and dictionary + muSgsSpalartAllmarasWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given + // muSgsSpalartAllmarasWallFunctionFvPatchScalarField + // onto a new patch + muSgsSpalartAllmarasWallFunctionFvPatchScalarField + ( + const muSgsSpalartAllmarasWallFunctionFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + muSgsSpalartAllmarasWallFunctionFvPatchScalarField + ( + const muSgsSpalartAllmarasWallFunctionFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchScalarField> clone() const + { + return tmp<fvPatchScalarField> + ( + new muSgsSpalartAllmarasWallFunctionFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + muSgsSpalartAllmarasWallFunctionFvPatchScalarField + ( + const muSgsSpalartAllmarasWallFunctionFvPatchScalarField&, + 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 muSgsSpalartAllmarasWallFunctionFvPatchScalarField + ( + *this, + iF + ) + ); + } + + + // Member functions + + // Evaluation functions + + //- Evaluate the patchField + virtual void evaluate + ( + const Pstream::commsTypes commsType=Pstream::blocking + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace compressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/LES/dynOneEqEddy/dynOneEqEddy.C b/src/turbulenceModels/compressible/LES/dynOneEqEddy/dynOneEqEddy.C new file mode 100644 index 00000000000..96bf8abbc9e --- /dev/null +++ b/src/turbulenceModels/compressible/LES/dynOneEqEddy/dynOneEqEddy.C @@ -0,0 +1,155 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "dynOneEqEddy.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace LESModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(dynOneEqEddy, 0); +addToRunTimeSelectionTable(LESModel, dynOneEqEddy, dictionary); + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +dimensionedScalar dynOneEqEddy::ck_(const volSymmTensorField& D) const +{ + volScalarField KK = 0.5*(filter_(magSqr(U())) - magSqr(filter_(U()))); + + volSymmTensorField LL = dev(filter_(sqr(U())) - (sqr(filter_(U())))); + + volSymmTensorField MM = + delta()*(filter_(sqrt(k_)*D) - 2*sqrt(KK + filter_(k_))*filter_(D)); + + return average(LL && MM)/average(magSqr(MM)); +} + + +dimensionedScalar dynOneEqEddy::ce_(const volSymmTensorField& D) const +{ + volScalarField KK = 0.5*(filter_(magSqr(U())) - magSqr(filter_(U()))); + + volScalarField mm = + pow(KK + filter_(k_), 1.5)/(2*delta()) - filter_(pow(k_, 1.5))/delta(); + + volScalarField ee = + 2*delta()*ck_(D)* + ( + filter_(sqrt(k_)*magSqr(D)) + - 2*sqrt(KK + filter_(k_))*magSqr(filter_(D)) + ); + + return average(ee*mm)/average(mm*mm); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +// from components +dynOneEqEddy::dynOneEqEddy +( + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& phi, + const basicThermo& thermoPhysicalModel +) +: + LESModel(typeName, rho, U, phi, thermoPhysicalModel), + GenEddyVisc(rho, U, phi, thermoPhysicalModel), + + filterPtr_(LESfilter::New(U.mesh(), coeffDict())), + filter_(filterPtr_()) +{ + printCoeffs(); +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +dynOneEqEddy::~dynOneEqEddy() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void dynOneEqEddy::correct(const tmp<volTensorField>& tgradU) +{ + const volTensorField& gradU = tgradU(); + + GenEddyVisc::correct(gradU); + + volSymmTensorField D = dev(symm(gradU)); + volScalarField divU = fvc::div(phi()/fvc::interpolate(rho())); + volScalarField G = 2*muSgs_*(gradU && D); + + solve + ( + fvm::ddt(rho(), k_) + + fvm::div(phi(), k_) + - fvm::laplacian(DkEff(), k_) + == + G + - fvm::SuSp(2.0/3.0*rho()*divU, k_) + - fvm::Sp(ce_(D)*rho()*sqrt(k_)/delta(), k_) + ); + + bound(k_, dimensionedScalar("0", k_.dimensions(), 1.0e-10)); + + muSgs_ = ck_(D)*rho()*sqrt(k_)*delta(); + muSgs_.correctBoundaryConditions(); +} + + +bool dynOneEqEddy::read() +{ + if (GenEddyVisc::read()) + { + filter_.read(coeffDict()); + + return true; + } + else + { + return false; + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace compressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/LES/dynOneEqEddy/dynOneEqEddy.H b/src/turbulenceModels/compressible/LES/dynOneEqEddy/dynOneEqEddy.H new file mode 100644 index 00000000000..3ffeb9c5dba --- /dev/null +++ b/src/turbulenceModels/compressible/LES/dynOneEqEddy/dynOneEqEddy.H @@ -0,0 +1,146 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::compressible::LESModels::dynOneEqEddy + +Description + One Equation Eddy Viscosity Model for compressible flows. + + Eddy viscosity SGS model using a modeled balance equation to simulate + the behaviour of k. + Thus + @verbatim + d/dt(k) + div(U*k) - div(nuSgs*grad(k)) + = + -rho*B*L - ce*rho*k^3/2/delta + + and + + B = 2/3*k*I - 2*nuSgs*dev(D) + + where + + D = symm(grad(U)); + nuSgs = ck*sqrt(k)*delta + @endverbatim + +SourceFiles + dynOneEqEddy.C + +\*---------------------------------------------------------------------------*/ + +#ifndef compressibleDynOneEqEddy_H +#define compressibleDynOneEqEddy_H + +#include "GenEddyVisc.H" +#include "LESfilter.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace LESModels +{ + +/*---------------------------------------------------------------------------*\ + Class dynOneEqEddy Declaration +\*---------------------------------------------------------------------------*/ + +class dynOneEqEddy +: + public GenEddyVisc +{ + // Private data + + autoPtr<LESfilter> filterPtr_; + LESfilter& filter_; + + + // Private Member Functions + + //- Calculate ck, ce by filtering the velocity field U. + dimensionedScalar ck_(const volSymmTensorField& D) const; + dimensionedScalar ce_(const volSymmTensorField& D) const; + + // Disallow default bitwise copy construct and assignment + dynOneEqEddy(const dynOneEqEddy&); + dynOneEqEddy& operator=(const dynOneEqEddy&); + + +public: + + //- Runtime type information + TypeName("dynOneEqEddy"); + + + // Constructors + + //- Constructor from components + dynOneEqEddy + ( + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& phi, + const basicThermo& thermoPhysicalModel + ); + + + // Destructor + + ~dynOneEqEddy(); + + + // Member Functions + + //- Return the effective diffusivity for k + tmp<volScalarField> DkEff() const + { + return tmp<volScalarField> + ( + new volScalarField("DkEff", muSgs_ + mu()) + ); + } + + //- Correct Eddy-Viscosity and related properties + void correct(const tmp<volTensorField>& gradU); + + //- Read turbulenceProperties dictionary + bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace compressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/LES/lowReOneEqEddy/lowReOneEqEddy.C b/src/turbulenceModels/compressible/LES/lowReOneEqEddy/lowReOneEqEddy.C new file mode 100644 index 00000000000..a626068335c --- /dev/null +++ b/src/turbulenceModels/compressible/LES/lowReOneEqEddy/lowReOneEqEddy.C @@ -0,0 +1,137 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "lowReOneEqEddy.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace LESModels +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +defineTypeNameAndDebug(lowReOneEqEddy, 0); +addToRunTimeSelectionTable(LESModel, lowReOneEqEddy, dictionary); + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +// from components +lowReOneEqEddy::lowReOneEqEddy +( + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& phi, + const basicThermo& thermoPhysicalModel +) +: + LESModel(typeName, rho, U, phi, thermoPhysicalModel), + GenEddyVisc(rho, U, phi, thermoPhysicalModel), + + ck_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "ck", + coeffDict(), + 0.07 + ) + ), + beta_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "beta", + coeffDict(), + 0.01 + ) + ) +{ + printCoeffs(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void lowReOneEqEddy::correct(const tmp<volTensorField>& tgradU) +{ + const volTensorField& gradU = tgradU(); + + GenEddyVisc::correct(gradU); + + volScalarField divU = fvc::div(phi()/fvc::interpolate(rho())); + volScalarField G = 2*muSgs_*(gradU && dev(symm(gradU))); + + solve + ( + fvm::ddt(rho(), k_) + + fvm::div(phi(), k_) + - fvm::laplacian(DkEff(), k_) + == + G + - fvm::SuSp(2.0/3.0*rho()*divU, k_) + - fvm::Sp(ce_*rho()*sqrt(k_)/delta(), k_) + ); + + bound(k_, k0()); + + // High Re eddy viscosity + muSgs_ = ck_*rho()*sqrt(k_)*delta(); + + // low Re no corrected eddy viscosity + muSgs_ -= (mu()/beta_)*(scalar(1) - exp(-beta_*muSgs_/mu())); + + muSgs_.correctBoundaryConditions(); +} + + +bool lowReOneEqEddy::read() +{ + if (GenEddyVisc::read()) + { + ck_.readIfPresent(coeffDict()); + beta_.readIfPresent(coeffDict()); + + return true; + } + else + { + return false; + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace compressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/LES/lowReOneEqEddy/lowReOneEqEddy.H b/src/turbulenceModels/compressible/LES/lowReOneEqEddy/lowReOneEqEddy.H new file mode 100644 index 00000000000..44d74f8ea9e --- /dev/null +++ b/src/turbulenceModels/compressible/LES/lowReOneEqEddy/lowReOneEqEddy.H @@ -0,0 +1,138 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::compressible::LESModels::lowReOneEqEddy + +Description + One Equation Eddy Viscosity Model for compressible flow + + @verbatim + d/dt(rho*k) + div(rho*U*k) - div(muEff*grad(k)) + = + -rho*B*L - ce*rho*k^3/2/delta + + and + + B = 2/3*k*I - 2*nuSgs*dev(D) + + where + + nuSgsHiRe = ck*sqrt(k)*delta + nuSgs = (nu/beta)*(1 - exp(-beta*nuSgsHiRe/nu)); + @endverbatim + +SourceFiles + lowReOneEqEddy.C + +\*---------------------------------------------------------------------------*/ + +#ifndef compressibleLowReOneEqEddy_H +#define compressibleLowReOneEqEddy_H + +#include "GenEddyVisc.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace LESModels +{ + +/*---------------------------------------------------------------------------*\ + Class lowReOneEqEddy Declaration +\*---------------------------------------------------------------------------*/ + +class lowReOneEqEddy +: + public GenEddyVisc +{ + // Private data + + dimensionedScalar ck_; + dimensionedScalar beta_; + + // Private Member Functions + + // Disallow default bitwise copy construct and assignment + lowReOneEqEddy(const lowReOneEqEddy&); + lowReOneEqEddy& operator=(const lowReOneEqEddy&); + + +public: + + //- Runtime type information + TypeName("lowReOneEqEddy"); + + + // Constructors + + //- Constructor from components + lowReOneEqEddy + ( + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& phi, + const basicThermo& thermoPhysicalModel + ); + + + // Destructor + + ~lowReOneEqEddy() + {} + + + // Member Functions + + //- Return the effective diffusivity for k + tmp<volScalarField> DkEff() const + { + return tmp<volScalarField> + ( + new volScalarField("DkEff", muSgs_ + mu()) + ); + } + + //- Correct Eddy-Viscosity and related properties + void correct(const tmp<volTensorField>& gradU); + + //- Read turbulenceProperties dictionary + bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace compressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/LES/oneEqEddy/oneEqEddy.C b/src/turbulenceModels/compressible/LES/oneEqEddy/oneEqEddy.C new file mode 100644 index 00000000000..bf4103e430e --- /dev/null +++ b/src/turbulenceModels/compressible/LES/oneEqEddy/oneEqEddy.C @@ -0,0 +1,124 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "oneEqEddy.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace LESModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(oneEqEddy, 0); +addToRunTimeSelectionTable(LESModel, oneEqEddy, dictionary); + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +oneEqEddy::oneEqEddy +( + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& phi, + const basicThermo& thermoPhysicalModel +) +: + LESModel(typeName, rho, U, phi, thermoPhysicalModel), + GenEddyVisc(rho, U, phi, thermoPhysicalModel), + + ck_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "ck", + coeffDict(), + 0.094 + ) + ) +{ + printCoeffs(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void oneEqEddy::correct(const tmp<volTensorField>& tgradU) +{ + const volTensorField& gradU = tgradU(); + + GenEddyVisc::correct(gradU); + + volScalarField divU = fvc::div(phi()/fvc::interpolate(rho())); + volScalarField G = 2*muSgs_*(gradU && dev(symm(gradU))); + + fvScalarMatrix kEqn + ( + fvm::ddt(rho(), k_) + + fvm::div(phi(), k_) + - fvm::laplacian(DkEff(), k_) + == + G + - fvm::SuSp(2.0/3.0*rho()*divU, k_) + - fvm::Sp(ce_*rho()*sqrt(k_)/delta(), k_) + ); + + kEqn.relax(); + kEqn.solve(); + + bound(k_, k0()); + + muSgs_ = ck_*rho()*sqrt(k_)*delta(); + muSgs_.correctBoundaryConditions(); +} + + +bool oneEqEddy::read() +{ + if (GenEddyVisc::read()) + { + ck_.readIfPresent(coeffDict()); + + return true; + } + else + { + return false; + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace compressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/LES/oneEqEddy/oneEqEddy.H b/src/turbulenceModels/compressible/LES/oneEqEddy/oneEqEddy.H new file mode 100644 index 00000000000..edd2c04d371 --- /dev/null +++ b/src/turbulenceModels/compressible/LES/oneEqEddy/oneEqEddy.H @@ -0,0 +1,141 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::compressible::LESModels::oneEqEddy + +Description + One Equation Eddy Viscosity Model for incompressible flows + + Eddy viscosity SGS model using a modeled balance equation to simulate the + behaviour of k, hence, + @verbatim + d/dt(rho*k) + div(rho*U*k) - div(muEff*grad(k)) + = + -rho*D:B - ce*rho*k^3/2/delta + + and + + B = 2/3*k*I - 2*nuSgs*dev(D) + + where + + D = symm(grad(U)); + muSgs = ck*rho*sqrt(k)*delta + @endverbatim + + +SourceFiles + oneEqEddy.C + +\*---------------------------------------------------------------------------*/ + +#ifndef compressibleOneEqEddy_H +#define compressibleOneEqEddy_H + +#include "GenEddyVisc.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace LESModels +{ + +/*---------------------------------------------------------------------------*\ + Class oneEqEddy Declaration +\*---------------------------------------------------------------------------*/ + +class oneEqEddy +: + public GenEddyVisc +{ + // Private data + + dimensionedScalar ck_; + + + // Private Member Functions + + // Disallow default bitwise copy construct and assignment + oneEqEddy(const oneEqEddy&); + oneEqEddy& operator=(const oneEqEddy&); + + +public: + + //- Runtime type information + TypeName("oneEqEddy"); + + + // Constructors + + //- Constructor from components + oneEqEddy + ( + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& phi, + const basicThermo& thermoPhysicalModel + ); + + + // Destructor + + ~oneEqEddy() + {} + + + // Member Functions + + //- Return the effective diffusivity for k + tmp<volScalarField> DkEff() const + { + return tmp<volScalarField> + ( + new volScalarField("DkEff", muSgs_ + mu()) + ); + } + + //- Correct Eddy-Viscosity and related properties + void correct(const tmp<volTensorField>& gradU); + + //- Read turbulenceProperties dictionary + bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace compressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/LRR/LRR.C b/src/turbulenceModels/compressible/RAS/LRR/LRR.C new file mode 100644 index 00000000000..a22d4952497 --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/LRR/LRR.C @@ -0,0 +1,476 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "LRR.H" +#include "addToRunTimeSelectionTable.H" +#include "wallFvPatch.H" + +#include "backwardsCompatibilityWallFunctions.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace RASModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(LRR, 0); +addToRunTimeSelectionTable(RASModel, LRR, dictionary); + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +// from components +LRR::LRR +( + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& phi, + basicThermo& thermophysicalModel +) +: + RASModel(typeName, rho, U, phi, thermophysicalModel), + + Cmu_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Cmu", + coeffDict_, + 0.09 + ) + ), + Clrr1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Clrr1", + coeffDict_, + 1.8 + ) + ), + Clrr2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Clrr2", + coeffDict_, + 0.6 + ) + ), + C1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "C1", + coeffDict_, + 1.44 + ) + ), + C2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "C2", + coeffDict_, + 1.92 + ) + ), + Cs_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Cs", + coeffDict_, + 0.25 + ) + ), + Ceps_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Ceps", + coeffDict_, + 0.15 + ) + ), + couplingFactor_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "couplingFactor", + coeffDict_, + 0.0 + ) + ), + alphaR_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphaR", + coeffDict_, + 1.22 + ) + ), + alphaEps_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphaEps", + coeffDict_, + 0.76923 + ) + ), + alphah_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphah", + coeffDict_, + 1.0 + ) + ), + + R_ + ( + IOobject + ( + "R", + runTime_.timeName(), + mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + autoCreateR("R", mesh_) + ), + k_ + ( + IOobject + ( + "k", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + autoCreateK("k", mesh_) + ), + epsilon_ + ( + IOobject + ( + "epsilon", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + autoCreateEpsilon("epsilon", mesh_) + ), + mut_ + ( + IOobject + ( + "mut", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + autoCreateMut("mut", mesh_) + ), + alphat_ + ( + IOobject + ( + "alphat", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + autoCreateAlphat("alphat", mesh_) + ) +{ + if (couplingFactor_.value() < 0.0 || couplingFactor_.value() > 1.0) + { + FatalErrorIn + ( + "LRR::LRR" + "( const volScalarField&, const volVectorField&" + ", const surfaceScalarField&, incompressibleTransportModel&)" + ) << "couplingFactor = " << couplingFactor_ + << " is not in range 0 - 1" << nl + << exit(FatalError); + } + + mut_ == Cmu_*rho_*sqr(k_)/(epsilon_ + epsilonSmall_); + mut_.correctBoundaryConditions(); + + alphat_ == mut_/Prt_; + alphat_.correctBoundaryConditions(); + + printCoeffs(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +tmp<volSymmTensorField> LRR::devRhoReff() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + "devRhoReff", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + rho_*R_ - mu()*dev(twoSymm(fvc::grad(U_))) + ) + ); +} + + +tmp<fvVectorMatrix> LRR::divDevRhoReff(volVectorField& U) const +{ + if (couplingFactor_.value() > 0.0) + { + return + ( + fvc::div(rho_*R_ + couplingFactor_*mut_*fvc::grad(U)) + + fvc::laplacian((1.0 - couplingFactor_)*mut_, U) + - fvm::laplacian(muEff(), U) + - fvc::div(mu()*dev2(fvc::grad(U)().T())) + ); + } + else + { + return + ( + fvc::div(rho_*R_) + + fvc::laplacian(mut_, U) + - fvm::laplacian(muEff(), U) + - fvc::div(mu()*dev2(fvc::grad(U)().T())) + ); + } +} + + +bool LRR::read() +{ + if (RASModel::read()) + { + Cmu_.readIfPresent(coeffDict_); + Clrr1_.readIfPresent(coeffDict_); + Clrr2_.readIfPresent(coeffDict_); + C1_.readIfPresent(coeffDict_); + C2_.readIfPresent(coeffDict_); + Cs_.readIfPresent(coeffDict_); + Ceps_.readIfPresent(coeffDict_); + alphaR_.readIfPresent(coeffDict_); + alphaEps_.readIfPresent(coeffDict_); + alphah_.readIfPresent(coeffDict_); + couplingFactor_.readIfPresent(coeffDict_); + + if (couplingFactor_.value() < 0.0 || couplingFactor_.value() > 1.0) + { + FatalErrorIn("LRR::read()") + << "couplingFactor = " << couplingFactor_ + << " is not in range 0 - 1" << nl + << exit(FatalError); + } + + return true; + } + else + { + return false; + } +} + + +void LRR::correct() +{ + if (!turbulence_) + { + // Re-calculate viscosity + mut_ == rho_*Cmu_*sqr(k_)/(epsilon_ + epsilonSmall_); + mut_.correctBoundaryConditions(); + + // Re-calculate thermal diffusivity + alphat_ = mut_/Prt_; + alphat_.correctBoundaryConditions(); + + return; + } + + RASModel::correct(); + + volSymmTensorField P = -twoSymm(R_ & fvc::grad(U_)); + volScalarField G("G", 0.5*tr(P)); + + // Update espsilon and G at the wall + epsilon_.boundaryField().updateCoeffs(); + + // Dissipation equation + tmp<fvScalarMatrix> epsEqn + ( + fvm::ddt(rho_, epsilon_) + + fvm::div(phi_, epsilon_) + //- fvm::laplacian(Ceps*rho_*(k_/epsilon_)*R_, epsilon_) + - fvm::laplacian(DepsilonEff(), epsilon_) + == + C1_*rho_*G*epsilon_/k_ + - fvm::Sp(C2_*rho_*epsilon_/k_, epsilon_) + ); + + epsEqn().relax(); + + epsEqn().boundaryManipulate(epsilon_.boundaryField()); + + solve(epsEqn); + bound(epsilon_, epsilon0_); + + + // Reynolds stress equation + + const fvPatchList& patches = mesh_.boundary(); + + forAll(patches, patchi) + { + const fvPatch& curPatch = patches[patchi]; + + if (typeid(curPatch) == typeid(wallFvPatch)) + { + forAll(curPatch, facei) + { + label faceCelli = curPatch.faceCells()[facei]; + P[faceCelli] + *= min(G[faceCelli]/(0.5*tr(P[faceCelli]) + SMALL), 100.0); + } + } + } + + + tmp<fvSymmTensorMatrix> REqn + ( + fvm::ddt(rho_, R_) + + fvm::div(phi_, R_) + //- fvm::laplacian(Cs*rho_*(k_/epsilon_)*R_, R_) + - fvm::laplacian(DREff(), R_) + + fvm::Sp(Clrr1_*rho_*epsilon_/k_, R_) + == + rho_*P + - (2.0/3.0*(1 - Clrr1_)*I)*rho_*epsilon_ + - Clrr2_*rho_*dev(P) + ); + + REqn().relax(); + solve(REqn); + + R_.max + ( + dimensionedSymmTensor + ( + "zero", + R_.dimensions(), + symmTensor + ( + k0_.value(), -GREAT, -GREAT, + k0_.value(), -GREAT, + k0_.value() + ) + ) + ); + + k_ = 0.5*tr(R_); + bound(k_, k0_); + + + // Re-calculate viscosity + mut_ == rho_*Cmu_*sqr(k_)/epsilon_; + mut_.correctBoundaryConditions(); + + // Re-calculate thermal diffusivity + alphat_ = mut_/Prt_; + alphat_.correctBoundaryConditions(); + + + // Correct wall shear stresses + + forAll(patches, patchi) + { + const fvPatch& curPatch = patches[patchi]; + + if (typeid(curPatch) == typeid(wallFvPatch)) + { + symmTensorField& Rw = R_.boundaryField()[patchi]; + + const scalarField& rhow = rho_.boundaryField()[patchi]; + const scalarField& mutw = mut_.boundaryField()[patchi]; + + vectorField snGradU = U_.boundaryField()[patchi].snGrad(); + + const vectorField& faceAreas + = mesh_.Sf().boundaryField()[patchi]; + + const scalarField& magFaceAreas + = mesh_.magSf().boundaryField()[patchi]; + + forAll(curPatch, facei) + { + // Calculate near-wall velocity gradient + tensor gradUw + = (faceAreas[facei]/magFaceAreas[facei])*snGradU[facei]; + + // Calculate near-wall shear-stress tensor + tensor tauw = -(mutw[facei]/rhow[facei])*2*dev(symm(gradUw)); + + // Reset the shear components of the stress tensor + Rw[facei].xy() = tauw.xy(); + Rw[facei].xz() = tauw.xz(); + Rw[facei].yz() = tauw.yz(); + } + } + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace compressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/LRR/LRR.H b/src/turbulenceModels/compressible/RAS/LRR/LRR.H new file mode 100644 index 00000000000..0dc2ed2ad85 --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/LRR/LRR.H @@ -0,0 +1,202 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::compressible::RASModels::LRR + +Description + Launder, Reece and Rodi Reynolds-stress turbulence model for + compressible flows. + + The default model coefficients correspond to the following: + @verbatim + LRRCoeffs + { + Cmu 0.09; + Clrr1 1.8; + Clrr2 0.6; + C1 1.44; + C2 1.92; + Cs 0.25; + Ceps 0.15; + alphah 1.0; // only for compressible + alphaEps 0.76923; + alphaR 1.22; // only for compressible + couplingFactor 0.0; // only for incompressible + } + @endverbatim + +SourceFiles + LRR.C + LRRcorrect.C + +\*---------------------------------------------------------------------------*/ + +#ifndef compressibleLRR_H +#define compressibleLRR_H + +#include "RASModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class LRR Declaration +\*---------------------------------------------------------------------------*/ + +class LRR +: + public RASModel +{ + // Private data + + dimensionedScalar Cmu_; + + dimensionedScalar Clrr1_; + dimensionedScalar Clrr2_; + + dimensionedScalar C1_; + dimensionedScalar C2_; + dimensionedScalar Cs_; + dimensionedScalar Ceps_; + + dimensionedScalar couplingFactor_; + + dimensionedScalar alphaR_; + dimensionedScalar alphaEps_; + dimensionedScalar alphah_; + + volSymmTensorField R_; + volScalarField k_; + volScalarField epsilon_; + volScalarField mut_; + volScalarField alphat_; + + +public: + + //- Runtime type information + TypeName("LRR"); + + // Constructors + + //- from components + LRR + ( + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& phi, + basicThermo& thermophysicalModel + ); + + + // Destructor + + ~LRR(){} + + + // Member Functions + + //- Return the turbulence viscosity + tmp<volScalarField> mut() const + { + return mut_; + } + + //- Return the effective diffusivity for R + tmp<volScalarField> DREff() const + { + return tmp<volScalarField> + ( + new volScalarField("DREff", alphaR_*mut_ + mu()) + ); + } + + //- Return the effective diffusivity for epsilon + tmp<volScalarField> DepsilonEff() const + { + return tmp<volScalarField> + ( + new volScalarField("DepsilonEff", alphaEps_*mut_ + mu()) + ); + } + + //- Return the effective turbulent thermal diffusivity + tmp<volScalarField> alphaEff() const + { + return tmp<volScalarField> + ( + new volScalarField("alphaEff", alphah_*alphat_ + alpha()) + ); + } + + //- Return the turbulence kinetic energy + tmp<volScalarField> k() const + { + return k_; + } + + //- Return the turbulence kinetic energy dissipation rate + tmp<volScalarField> epsilon() const + { + return epsilon_; + } + + //- Return the Reynolds stress tensor + tmp<volSymmTensorField> R() const + { + return R_; + } + + //- Return the effective stress tensor including the laminar stress + tmp<volSymmTensorField> devRhoReff() const; + + //- Return the source term for the momentum equation + tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const; + + //- Solve the turbulence equations and correct the turbulence viscosity + void correct(); + + //- Read turbulenceProperties dictionary + bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace compressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C b/src/turbulenceModels/compressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C new file mode 100644 index 00000000000..0181605fb19 --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C @@ -0,0 +1,514 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "LaunderGibsonRSTM.H" +#include "addToRunTimeSelectionTable.H" +#include "wallFvPatch.H" +#include "wallDist.H" +#include "wallDistReflection.H" + +#include "backwardsCompatibilityWallFunctions.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace RASModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(LaunderGibsonRSTM, 0); +addToRunTimeSelectionTable(RASModel, LaunderGibsonRSTM, dictionary); + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +// from components +LaunderGibsonRSTM::LaunderGibsonRSTM +( + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& phi, + basicThermo& thermophysicalModel +) +: + RASModel(typeName, rho, U, phi, thermophysicalModel), + + Cmu_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Cmu", + coeffDict_, + 0.09 + ) + ), + Clg1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Clg1", + coeffDict_, + 1.8 + ) + ), + Clg2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Clg2", + coeffDict_, + 0.6 + ) + ), + C1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "C1", + coeffDict_, + 1.44 + ) + ), + C2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "C2", + coeffDict_, + 1.92 + ) + ), + Cs_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Cs", + coeffDict_, + 0.25 + ) + ), + Ceps_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Ceps", + coeffDict_, + 0.15 + ) + ), + C1Ref_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "C1Ref", + coeffDict_, + 0.5 + ) + ), + C2Ref_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "C2Ref", + coeffDict_, + 0.3 + ) + ), + couplingFactor_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "couplingFactor", + coeffDict_, + 0.0 + ) + ), + alphaR_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphaR", + coeffDict_, + 1.22 + ) + ), + alphaEps_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphaEps", + coeffDict_, + 0.76923 + ) + ), + alphah_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphah", + coeffDict_, + 1.0 + ) + ), + + y_(mesh_), + + R_ + ( + IOobject + ( + "R", + runTime_.timeName(), + mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + autoCreateR("R", mesh_) + ), + k_ + ( + IOobject + ( + "k", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + autoCreateK("k", mesh_) + ), + epsilon_ + ( + IOobject + ( + "epsilon", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + autoCreateEpsilon("epsilon", mesh_) + ), + mut_ + ( + IOobject + ( + "mut", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + autoCreateMut("mut", mesh_) + ), + alphat_ + ( + IOobject + ( + "alphat", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + autoCreateAlphat("alphat", mesh_) + ) +{ + if (couplingFactor_.value() < 0.0 || couplingFactor_.value() > 1.0) + { + FatalErrorIn + ( + "LaunderGibsonRSTM::LaunderGibsonRSTM" + "(const volScalarField&, const volVectorField&" + ", const surfaceScalarField&, basicThermo&)" + ) << "couplingFactor = " << couplingFactor_ + << " is not in range 0 - 1" << nl + << exit(FatalError); + } + + mut_ == Cmu_*rho_*sqr(k_)/(epsilon_ + epsilonSmall_); + mut_.correctBoundaryConditions(); + + alphat_ == mut_/Prt_; + alphat_.correctBoundaryConditions(); + + printCoeffs(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +tmp<volSymmTensorField> LaunderGibsonRSTM::devRhoReff() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + "devRhoReff", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + rho_*R_ - mu()*dev(twoSymm(fvc::grad(U_))) + ) + ); +} + + +tmp<fvVectorMatrix> LaunderGibsonRSTM::divDevRhoReff(volVectorField& U) const +{ + if (couplingFactor_.value() > 0.0) + { + return + ( + fvc::div(rho_*R_ + couplingFactor_*mut_*fvc::grad(U)) + + fvc::laplacian((1.0 - couplingFactor_)*mut_, U) + - fvm::laplacian(muEff(), U) + - fvc::div(mu()*dev2(fvc::grad(U)().T())) + ); + } + else + { + return + ( + fvc::div(rho_*R_) + + fvc::laplacian(mut_, U) + - fvm::laplacian(muEff(), U) + - fvc::div(mu()*dev2(fvc::grad(U)().T())) + ); + } +} + + +bool LaunderGibsonRSTM::read() +{ + if (RASModel::read()) + { + Cmu_.readIfPresent(coeffDict_); + Clg1_.readIfPresent(coeffDict_); + Clg2_.readIfPresent(coeffDict_); + C1_.readIfPresent(coeffDict_); + C2_.readIfPresent(coeffDict_); + Cs_.readIfPresent(coeffDict_); + Ceps_.readIfPresent(coeffDict_); + C1Ref_.readIfPresent(coeffDict_); + C2Ref_.readIfPresent(coeffDict_); + alphaR_.readIfPresent(coeffDict_); + alphaEps_.readIfPresent(coeffDict_); + alphah_.readIfPresent(coeffDict_); + + couplingFactor_.readIfPresent(coeffDict_); + + if (couplingFactor_.value() < 0.0 || couplingFactor_.value() > 1.0) + { + FatalErrorIn("LaunderGibsonRSTM::read()") + << "couplingFactor = " << couplingFactor_ + << " is not in range 0 - 1" << nl + << exit(FatalError); + } + + return true; + } + else + { + return false; + } +} + + +void LaunderGibsonRSTM::correct() +{ + if (!turbulence_) + { + // Re-calculate viscosity + mut_ == rho_*Cmu_*sqr(k_)/(epsilon_ + epsilonSmall_); + mut_.correctBoundaryConditions(); + + // Re-calculate thermal diffusivity + alphat_ = mut_/Prt_; + alphat_.correctBoundaryConditions(); + + return; + } + + RASModel::correct(); + + if (mesh_.changing()) + { + y_.correct(); + } + + volSymmTensorField P = -twoSymm(R_ & fvc::grad(U_)); + volScalarField G("G", 0.5*tr(P)); + + // Update espsilon and G at the wall + epsilon_.boundaryField().updateCoeffs(); + + // Dissipation equation + tmp<fvScalarMatrix> epsEqn + ( + fvm::ddt(rho_, epsilon_) + + fvm::div(phi_, epsilon_) + //- fvm::laplacian(Ceps*rho_*(k_/epsilon_)*R_, epsilon_) + - fvm::laplacian(DepsilonEff(), epsilon_) + == + C1_*rho_*G*epsilon_/k_ + - fvm::Sp(C2_*rho_*epsilon_/k_, epsilon_) + ); + + epsEqn().relax(); + + epsEqn().boundaryManipulate(epsilon_.boundaryField()); + + solve(epsEqn); + bound(epsilon_, epsilon0_); + + + // Reynolds stress equation + + const fvPatchList& patches = mesh_.boundary(); + + forAll(patches, patchi) + { + const fvPatch& curPatch = patches[patchi]; + + if (typeid(curPatch) == typeid(wallFvPatch)) + { + forAll(curPatch, facei) + { + label faceCelli = curPatch.faceCells()[facei]; + P[faceCelli] *= + min(G[faceCelli]/(0.5*tr(P[faceCelli]) + SMALL), 100.0); + } + } + } + + volSymmTensorField reflect = C1Ref_*epsilon_/k_*R_ - C2Ref_*Clg2_*dev(P); + + tmp<fvSymmTensorMatrix> REqn + ( + fvm::ddt(rho_, R_) + + fvm::div(phi_, R_) + //- fvm::laplacian(Cs*rho_*(k_/epsilon_)*R_, R_) + - fvm::laplacian(DREff(), R_) + + fvm::Sp(Clg1_*rho_*epsilon_/k_, R_) + == + rho_*P + + (2.0/3.0*(Clg1_ - 1)*I)*rho_*epsilon_ + - Clg2_*rho_*dev(P) + + // wall reflection terms + + symm + ( + I*((y_.n() & reflect) & y_.n()) + - 1.5*(y_.n()*(reflect & y_.n()) + + (y_.n() & reflect)*y_.n()) + )*pow(Cmu_, 0.75)*rho_*pow(k_, 1.5)/(kappa_*y_*epsilon_) + ); + + REqn().relax(); + solve(REqn); + + R_.max + ( + dimensionedSymmTensor + ( + "zero", + R_.dimensions(), + symmTensor + ( + k0_.value(), -GREAT, -GREAT, + k0_.value(), -GREAT, + k0_.value() + ) + ) + ); + + k_ == 0.5*tr(R_); + bound(k_, k0_); + + + // Re-calculate turbulent viscosity + mut_ == Cmu_*rho_*sqr(k_)/epsilon_; + mut_.correctBoundaryConditions(); + + // Re-calculate thermal diffusivity + alphat_ = mut_/Prt_; + alphat_.correctBoundaryConditions(); + + // Correct wall shear stresses + + forAll(patches, patchi) + { + const fvPatch& curPatch = patches[patchi]; + + if (typeid(curPatch) == typeid(wallFvPatch)) + { + symmTensorField& Rw = R_.boundaryField()[patchi]; + + const scalarField& mutw = mut_.boundaryField()[patchi]; + const scalarField& rhow = rho_.boundaryField()[patchi]; + + vectorField snGradU = U_.boundaryField()[patchi].snGrad(); + + const vectorField& faceAreas + = mesh_.Sf().boundaryField()[patchi]; + + const scalarField& magFaceAreas + = mesh_.magSf().boundaryField()[patchi]; + + forAll(curPatch, facei) + { + // Calculate near-wall velocity gradient + tensor gradUw + = (faceAreas[facei]/magFaceAreas[facei])*snGradU[facei]; + + // Calculate near-wall shear-stress tensor + tensor tauw = -(mutw[facei]/rhow[facei])*2*dev(symm(gradUw)); + + // Reset the shear components of the stress tensor + Rw[facei].xy() = tauw.xy(); + Rw[facei].xz() = tauw.xz(); + Rw[facei].yz() = tauw.yz(); + } + } + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace compressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.H b/src/turbulenceModels/compressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.H new file mode 100644 index 00000000000..4fa0e9315ea --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.H @@ -0,0 +1,211 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::compressible::RASModels::LaunderGibsonRSTM + +Description + Launder-Gibson Reynolds stress turbulence model for compressible flows. + + The default model coefficients correspond to the following: + @verbatim + LaunderGibsonRSTMCoeffs + { + Cmu 0.09; + Clg1 1.8; + Clg2 0.6; + C1 1.44; + C2 1.92; + C1Ref 0.5; + C2Ref 0.3; + Cs 0.25; + Ceps 0.15; + alphah 1.0; // only for compressible + alphaEps 0.76923; + alphaR 1.22; + couplingFactor 0.0; + } + @endverbatim + +SourceFiles + LaunderGibsonRSTM.C + LaunderGibsonRSTMcorrect.C + +\*---------------------------------------------------------------------------*/ + +#ifndef compressibleLaunderGibsonRSTM_H +#define compressibleLaunderGibsonRSTM_H + +#include "RASModel.H" +#include "wallDistReflection.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class LaunderGibsonRSTM Declaration +\*---------------------------------------------------------------------------*/ + +class LaunderGibsonRSTM +: + public RASModel +{ + // Private data + + dimensionedScalar Cmu_; + + dimensionedScalar Clg1_; + dimensionedScalar Clg2_; + + dimensionedScalar C1_; + dimensionedScalar C2_; + dimensionedScalar Cs_; + dimensionedScalar Ceps_; + + dimensionedScalar C1Ref_; + dimensionedScalar C2Ref_; + + dimensionedScalar couplingFactor_; + + dimensionedScalar alphaR_; + dimensionedScalar alphaEps_; + dimensionedScalar alphah_; + + wallDistReflection y_; + + volSymmTensorField R_; + volScalarField k_; + volScalarField epsilon_; + volScalarField mut_; + volScalarField alphat_; + + +public: + + //- Runtime type information + TypeName("LaunderGibsonRSTM"); + + // Constructors + + //- from components + LaunderGibsonRSTM + ( + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& phi, + basicThermo& thermophysicalModel + ); + + + // Destructor + + ~LaunderGibsonRSTM(){} + + + // Member Functions + + // Access + + //- Return the turbulence viscosity + tmp<volScalarField> mut() const + { + return mut_; + } + + //- Return the effective diffusivity for R + tmp<volScalarField> DREff() const + { + return tmp<volScalarField> + ( + new volScalarField("DREff", alphaR_*mut_ + mu()) + ); + } + + //- Return the effective diffusivity for epsilon + tmp<volScalarField> DepsilonEff() const + { + return tmp<volScalarField> + ( + new volScalarField("DepsilonEff", alphaEps_*mut_ + mu()) + ); + } + + //- Return the effective turbulent thermal diffusivity + tmp<volScalarField> alphaEff() const + { + return tmp<volScalarField> + ( + new volScalarField("alphaEff", alphah_*alphat_ + alpha()) + ); + } + + //- Return the turbulence kinetic energy + tmp<volScalarField> k() const + { + return k_; + } + + //- Return the turbulence kinetic energy dissipation rate + tmp<volScalarField> epsilon() const + { + return epsilon_; + } + + //- Return the Reynolds stress tensor + tmp<volSymmTensorField> R() const + { + return R_; + } + + //- Return the effective stress tensor including the laminar stress + tmp<volSymmTensorField> devRhoReff() const; + + //- Return the source term for the momentum equation + tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const; + + //- Solve the turbulence equations and correct the turbulence viscosity + void correct(); + + //- Read turbulenceProperties dictionary + bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace compressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/LaunderSharmaKE/LaunderSharmaKE.C b/src/turbulenceModels/compressible/RAS/LaunderSharmaKE/LaunderSharmaKE.C new file mode 100644 index 00000000000..b5774100973 --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/LaunderSharmaKE/LaunderSharmaKE.C @@ -0,0 +1,331 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "LaunderSharmaKE.H" +#include "addToRunTimeSelectionTable.H" +#include "wallFvPatch.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace RASModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(LaunderSharmaKE, 0); +addToRunTimeSelectionTable(RASModel, LaunderSharmaKE, dictionary); + +// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // + +tmp<volScalarField> LaunderSharmaKE::fMu() const +{ + return exp(-3.4/sqr(scalar(1) + rho_*sqr(k_)/(mu()*epsilon_)/50.0)); +} + + +tmp<volScalarField> LaunderSharmaKE::f2() const +{ + return + scalar(1) + - 0.3*exp(-min(sqr(rho_*sqr(k_)/(mu()*epsilon_)), scalar(50.0))); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +// from components +LaunderSharmaKE::LaunderSharmaKE +( + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& phi, + basicThermo& thermophysicalModel +) +: + RASModel(typeName, rho, U, phi, thermophysicalModel), + + Cmu_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Cmu", + coeffDict_, + 0.09 + ) + ), + C1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "C1", + coeffDict_, + 1.44 + ) + ), + C2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "C2", + coeffDict_, + 1.92 + ) + ), + C3_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "C3", + coeffDict_, + -0.33 + ) + ), + alphak_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphak", + coeffDict_, + 1.0 + ) + ), + alphaEps_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphaEps", + coeffDict_, + 0.76923 + ) + ), + alphah_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphah", + coeffDict_, + 1.0 + ) + ), + + k_ + ( + IOobject + ( + "k", + runTime_.timeName(), + mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh_ + ), + + epsilon_ + ( + IOobject + ( + "epsilon", + runTime_.timeName(), + mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh_ + ), + + mut_ + ( + IOobject + ( + "mut", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + Cmu_*fMu()*rho_*sqr(k_)/(epsilon_ + epsilonSmall_) + ) +{ + printCoeffs(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +tmp<volSymmTensorField> LaunderSharmaKE::R() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + "R", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + ((2.0/3.0)*I)*k_ - (mut_/rho_)*dev(twoSymm(fvc::grad(U_))), + k_.boundaryField().types() + ) + ); +} + + +tmp<volSymmTensorField> LaunderSharmaKE::devRhoReff() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + "devRhoReff", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + -muEff()*dev(twoSymm(fvc::grad(U_))) + ) + ); +} + + +tmp<fvVectorMatrix> LaunderSharmaKE::divDevRhoReff(volVectorField& U) const +{ + return + ( + - fvm::laplacian(muEff(), U) - fvc::div(muEff()*dev2(fvc::grad(U)().T())) + ); +} + + +bool LaunderSharmaKE::read() +{ + if (RASModel::read()) + { + Cmu_.readIfPresent(coeffDict_); + C1_.readIfPresent(coeffDict_); + C2_.readIfPresent(coeffDict_); + C3_.readIfPresent(coeffDict_); + alphak_.readIfPresent(coeffDict_); + alphaEps_.readIfPresent(coeffDict_); + alphah_.readIfPresent(coeffDict_); + + return true; + } + else + { + return false; + } +} + + +void LaunderSharmaKE::correct() +{ + if (!turbulence_) + { + // Re-calculate viscosity + mut_ = rho_*Cmu_*fMu()*sqr(k_)/(epsilon_ + epsilonSmall_); + return; + } + + RASModel::correct(); + + // Calculate parameters and coefficients for Launder-Sharma low-Reynolds + // number model + + volScalarField E = 2.0*mu()*mut_*fvc::magSqrGradGrad(U_)/rho_; + volScalarField D = 2.0*mu()*magSqr(fvc::grad(sqrt(k_)))/rho_; + + volScalarField divU = fvc::div(phi_/fvc::interpolate(rho_)); + + if (mesh_.moving()) + { + divU += fvc::div(mesh_.phi()); + } + + tmp<volTensorField> tgradU = fvc::grad(U_); + volScalarField G = mut_*(tgradU() && dev(twoSymm(tgradU()))); + tgradU.clear(); + + + // Dissipation equation + + tmp<fvScalarMatrix> epsEqn + ( + fvm::ddt(rho_, epsilon_) + + fvm::div(phi_, epsilon_) + - fvm::laplacian(DepsilonEff(), epsilon_) + == + C1_*G*epsilon_/k_ + fvm::SuSp((C3_ - 2.0/3.0*C1_)*rho_*divU, epsilon_) + - fvm::Sp(C2_*f2()*rho_*epsilon_/k_, epsilon_) + //+ 0.75*1.5*flameKproduction*epsilon_/k_ + + E + ); + + epsEqn().relax(); + solve(epsEqn); + bound(epsilon_, epsilon0_); + + + // Turbulent kinetic energy equation + + tmp<fvScalarMatrix> kEqn + ( + fvm::ddt(rho_, k_) + + fvm::div(phi_, k_) + - fvm::laplacian(DkEff(), k_) + == + G - fvm::SuSp(2.0/3.0*rho_*divU, k_) + - fvm::Sp(rho_*(epsilon_ + D)/k_, k_) + //+ flameKproduction + ); + + kEqn().relax(); + solve(kEqn); + bound(k_, k0_); + + + // Re-calculate viscosity + mut_ = Cmu_*fMu()*rho_*sqr(k_)/epsilon_; +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace compressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/LaunderSharmaKE/LaunderSharmaKE.H b/src/turbulenceModels/compressible/RAS/LaunderSharmaKE/LaunderSharmaKE.H new file mode 100644 index 00000000000..731e0cdb02a --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/LaunderSharmaKE/LaunderSharmaKE.H @@ -0,0 +1,191 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::compressible::RASModels::LaunderSharmaKE + +Description + Launder and Sharma low-Reynolds k-epsilon turbulence model for + compressible and combusting flows. + + The default model coefficients correspond to the following: + @verbatim + LaunderSharmaKECoeffs + { + Cmu 0.09; + C1 1.44; + C2 1.92; + C3 -0.33; + alphah 1.0; // only for compressible + alphahk 1.0; // only for compressible + alphaEps 0.76923; + } + @endverbatim + +SourceFiles + LaunderSharmaKE.C + LaunderSharmaKECorrect.C + +\*---------------------------------------------------------------------------*/ + +#ifndef compressibleLaunderSharmaKE_H +#define compressibleLaunderSharmaKE_H + +#include "RASModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class LaunderSharmaKE Declaration +\*---------------------------------------------------------------------------*/ + +class LaunderSharmaKE +: + public RASModel +{ + // Private data + + dimensionedScalar Cmu_; + dimensionedScalar C1_; + dimensionedScalar C2_; + dimensionedScalar C3_; + dimensionedScalar alphak_; + dimensionedScalar alphaEps_; + dimensionedScalar alphah_; + + volScalarField k_; + volScalarField epsilon_; + volScalarField mut_; + + + // Private member functions + + tmp<volScalarField> fMu() const; + tmp<volScalarField> f2() const; + + +public: + + //- Runtime type information + TypeName("LaunderSharmaKE"); + + // Constructors + + //- from components + LaunderSharmaKE + ( + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& phi, + basicThermo& thermophysicalModel + ); + + + // Destructor + + ~LaunderSharmaKE(){} + + + // Member Functions + + //- Return the turbulence viscosity + tmp<volScalarField> mut() const + { + return mut_; + } + + //- Return the effective diffusivity for k + tmp<volScalarField> DkEff() const + { + return tmp<volScalarField> + ( + new volScalarField("DkEff", alphak_*mut_ + mu()) + ); + } + + //- Return the effective diffusivity for epsilon + tmp<volScalarField> DepsilonEff() const + { + return tmp<volScalarField> + ( + new volScalarField("DepsilonEff", alphaEps_*mut_ + mu()) + ); + } + + //- Return the effective turbulent thermal diffusivity + tmp<volScalarField> alphaEff() const + { + return tmp<volScalarField> + ( + new volScalarField("alphaEff", alphah_*mut_ + alpha()) + ); + } + + //- Return the turbulence kinetic energy + tmp<volScalarField> k() const + { + return k_; + } + + //- Return the turbulence kinetic energy dissipation rate + tmp<volScalarField> epsilon() const + { + return epsilon_; + } + + //- Return the Reynolds stress tensor + tmp<volSymmTensorField> R() const; + + //- Return the effective stress tensor including the laminar stress + tmp<volSymmTensorField> devRhoReff() const; + + //- Return the source term for the momentum equation + tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const; + + //- Solve the turbulence equations and correct the turbulence viscosity + void correct(); + + //- Read turbulenceProperties dictionary + bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace compressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/Make/files b/src/turbulenceModels/compressible/RAS/Make/files new file mode 100644 index 00000000000..0598d06a00e --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/Make/files @@ -0,0 +1,43 @@ +/* RAS turbulence models */ +RASModel/RASModel.C +RASModel/newRASModel.C +laminar/laminar.C +kEpsilon/kEpsilon.C +RNGkEpsilon/RNGkEpsilon.C +LaunderSharmaKE/LaunderSharmaKE.C +LRR/LRR.C +LaunderGibsonRSTM/LaunderGibsonRSTM.C +realizableKE/realizableKE.C +SpalartAllmaras/SpalartAllmaras.C +kOmegaSST/kOmegaSST.C + +/* Wall functions */ +wallFunctions = derivedFvPatchFields/wallFunctions + +alphatWallFunctions = $(wallFunctions)/alphatWallFunctions +$(alphatWallFunctions)/alphatWallFunction/alphatWallFunctionFvPatchScalarField.C + +mutWallFunctions = $(wallFunctions)/mutWallFunctions +$(mutWallFunctions)/mutWallFunction/mutWallFunctionFvPatchScalarField.C +$(mutWallFunctions)/mutRoughWallFunction/mutRoughWallFunctionFvPatchScalarField.C +$(mutWallFunctions)/mutSpalartAllmarasWallFunction/mutSpalartAllmarasWallFunctionFvPatchScalarField.C +$(mutWallFunctions)/mutSpalartAllmarasStandardWallFunction/mutSpalartAllmarasStandardWallFunctionFvPatchScalarField.C +$(mutWallFunctions)/mutSpalartAllmarasStandardRoughWallFunction/mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.C + +epsilonWallFunctions = $(wallFunctions)/epsilonWallFunctions +$(epsilonWallFunctions)/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C + +omegaWallFunctions = $(wallFunctions)/omegaWallFunctions +$(omegaWallFunctions)/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C + +kQRWallFunctions = $(wallFunctions)/kQRWallFunctions +$(kQRWallFunctions)/kQRWallFunction/kQRWallFunctionFvPatchFields.C + +/* Patch fields */ +derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C +derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C +derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C + +backwardsCompatibilityWallFunctions/backwardsCompatibilityWallFunctions.C + +LIB = $(FOAM_LIBBIN)/libcompressibleRASModels diff --git a/src/turbulenceModels/compressible/RAS/Make/options b/src/turbulenceModels/compressible/RAS/Make/options new file mode 100644 index 00000000000..6c12c9d7819 --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/Make/options @@ -0,0 +1,8 @@ +EXE_INC = \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude + +LIB_LIBS = \ + -lfiniteVolume \ + -lmeshTools diff --git a/src/turbulenceModels/compressible/RAS/RASModel/RASModel.C b/src/turbulenceModels/compressible/RAS/RASModel/RASModel.C new file mode 100644 index 00000000000..c1bbdc1684e --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/RASModel/RASModel.C @@ -0,0 +1,228 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "RASModel.H" +#include "wallDist.H" +#include "wallFvPatch.H" +#include "fixedValueFvPatchFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(RASModel, 0); +defineRunTimeSelectionTable(RASModel, dictionary); + +// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * // + +void RASModel::printCoeffs() +{ + if (printCoeffs_) + { + Info<< type() << "Coeffs" << coeffDict_ << nl + << "wallFunctionCoeffs" << wallFunctionDict_ << endl; + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +RASModel::RASModel +( + const word& type, + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& phi, + basicThermo& thermophysicalModel +) +: + IOdictionary + ( + IOobject + ( + "RASProperties", + U.time().constant(), + U.db(), + IOobject::MUST_READ, + IOobject::NO_WRITE + ) + ), + + runTime_(U.time()), + mesh_(U.mesh()), + + rho_(rho), + U_(U), + phi_(phi), + thermophysicalModel_(thermophysicalModel), + + turbulence_(lookup("turbulence")), + printCoeffs_(lookupOrDefault<Switch>("printCoeffs", false)), + coeffDict_(subDict(type + "Coeffs")), + + wallFunctionDict_(subDict("wallFunctionCoeffs")), + kappa_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "kappa", + subDict("wallFunctionCoeffs"), + 0.4187 + ) + ), + E_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "E", + subDict("wallFunctionCoeffs"), + 9.0 + ) + ), + Cmu_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Cmu", + wallFunctionDict_, + 0.09 + ) + ), + Prt_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Prt", + wallFunctionDict_, + 0.85 + ) + ), + + yPlusLam_(yPlusLam(kappa_.value(), E_.value())), + + k0_("k0", dimVelocity*dimVelocity, SMALL), + epsilon0_("epsilon", k0_.dimensions()/dimTime, SMALL), + epsilonSmall_("epsilonSmall", epsilon0_.dimensions(), SMALL), + + y_(mesh_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +scalar RASModel::yPlusLam(const scalar kappa, const scalar E) const +{ + scalar ypl = 11.0; + + for (int i=0; i<10; i++) + { + ypl = log(E*ypl)/kappa; + } + + return ypl; +} + + +tmp<scalarField> RASModel::yPlus(const label patchNo) const +{ + const fvPatch& curPatch = mesh_.boundary()[patchNo]; + + tmp<scalarField> tYp(new scalarField(curPatch.size())); + scalarField& Yp = tYp(); + + if (isType<wallFvPatch>(curPatch)) + { + Yp = pow(Cmu_.value(), 0.25) + *y_[patchNo] + *sqrt(k()().boundaryField()[patchNo].patchInternalField()) + /( + mu().boundaryField()[patchNo].patchInternalField() + /rho_.boundaryField()[patchNo] + ); + } + else + { + WarningIn + ( + "tmp<scalarField> RASModel::yPlus(const label patchNo) const" + ) << "Patch " << patchNo << " is not a wall. Returning null field" + << nl << endl; + + Yp.setSize(0); + } + + return tYp; +} + + +void RASModel::correct() +{ + if (mesh_.changing()) + { + y_.correct(); + } +} + + +bool RASModel::read() +{ + if (regIOobject::read()) + { + lookup("turbulence") >> turbulence_; + coeffDict_ = subDict(type() + "Coeffs"); + + wallFunctionDict_ = subDict("wallFunctionCoeffs"); + kappa_.readIfPresent(wallFunctionDict_); + E_.readIfPresent(wallFunctionDict_); + Cmu_.readIfPresent(wallFunctionDict_); + Prt_.readIfPresent(wallFunctionDict_); + + yPlusLam_ = yPlusLam(kappa_.value(), E_.value()); + + k0_.readIfPresent(*this); + epsilon0_.readIfPresent(*this); + epsilonSmall_.readIfPresent(*this); + + return true; + } + else + { + return false; + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace compressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/RASModel/RASModel.H b/src/turbulenceModels/compressible/RAS/RASModel/RASModel.H new file mode 100644 index 00000000000..1be29e6e792 --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/RASModel/RASModel.H @@ -0,0 +1,339 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Namespace + Foam::compressible::RASModels + +Description + Namespace for compressible RAS turbulence models. + + +Class + Foam::compressible::RASModel + +Description + Abstract base class for turbulence models for compressible and combusting + flows. + +SourceFiles + RASModel.C + newTurbulenceModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef compressibleRASModel_H +#define compressibleRASModel_H + +#include "volFields.H" +#include "surfaceFields.H" +#include "nearWallDist.H" +#include "fvm.H" +#include "fvc.H" +#include "fvMatrices.H" +#include "basicThermo.H" +#include "IOdictionary.H" +#include "Switch.H" +#include "bound.H" +#include "autoPtr.H" +#include "runTimeSelectionTables.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ + +/*---------------------------------------------------------------------------*\ + Class RASModel Declaration +\*---------------------------------------------------------------------------*/ + +class RASModel +: + public IOdictionary +{ + +protected: + + // Protected data + + const Time& runTime_; + const fvMesh& mesh_; + + const volScalarField& rho_; + const volVectorField& U_; + const surfaceScalarField& phi_; + + basicThermo& thermophysicalModel_; + + Switch turbulence_; + Switch printCoeffs_; + dictionary coeffDict_; + + dictionary wallFunctionDict_; + dimensionedScalar kappa_; + dimensionedScalar E_; + dimensionedScalar Cmu_; + dimensionedScalar Prt_; + + scalar yPlusLam_; + + dimensionedScalar k0_; + dimensionedScalar epsilon0_; + dimensionedScalar epsilonSmall_; + + nearWallDist y_; + + + // Protected member functions + + //- Print model coefficients + virtual void printCoeffs(); + + //- Return the laminar thermal conductivity + const volScalarField& alpha() const + { + return thermophysicalModel_.alpha(); + } + + +private: + + // Private Member Functions + + //- Disallow default bitwise copy construct + RASModel(const RASModel&); + + //- Disallow default bitwise assignment + void operator=(const RASModel&); + + +public: + + //- Runtime type information + TypeName("RASModel"); + + + // Declare run-time constructor selection table + + declareRunTimeSelectionTable + ( + autoPtr, + RASModel, + dictionary, + ( + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& phi, + basicThermo& thermoPhysicalModel + ), + (rho, U, phi, thermoPhysicalModel) + ); + + + // Constructors + + //- Construct from components + RASModel + ( + const word& type, + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& phi, + basicThermo& thermoPhysicalModel + ); + + + // Selectors + + //- Return a reference to the selected turbulence model + static autoPtr<RASModel> New + ( + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& phi, + basicThermo& thermoPhysicalModel + ); + + + // Destructor + + virtual ~RASModel() + {} + + + // Member Functions + + // Access + + //- Return the value of k0 which k is not allowed to be less than + const dimensionedScalar& k0() const + { + return k0_; + } + + //- Return the value of epsilon0 which epsilon is not allowed to be + // less than + const dimensionedScalar& epsilon0() const + { + return epsilon0_; + } + + //- Return the value of epsilonSmall which is added to epsilon when + // calculating nut + const dimensionedScalar& epsilonSmall() const + { + return epsilonSmall_; + } + + + //- Allow k0 to be changed + dimensionedScalar& k0() + { + return k0_; + } + + //- Allow epsilon0 to be changed + dimensionedScalar& epsilon0() + { + return epsilon0_; + } + + //- Allow epsilonSmall to be changed + dimensionedScalar& epsilonSmall() + { + return epsilonSmall_; + } + + + //- Return kappa for use in wall-functions + dimensionedScalar kappa() const + { + return kappa_; + } + + //- Return E for use in wall-functions + dimensionedScalar E() const + { + return E_; + } + + //- Return Cmu for use in wall-functions + dimensionedScalar Cmu() const + { + return Cmu_; + } + + //- Return turbulent Prandtl number for use in wall-functions + dimensionedScalar Prt() const + { + return Prt_; + } + + //- Return the near wall distances + const nearWallDist& y() const + { + return y_; + } + + //- Calculate y+ at the edge of the laminar sublayer + scalar yPlusLam(const scalar kappa, const scalar E) const; + + //- Return y+ at the edge of the laminar sublayer + // for use in wall-functions + scalar yPlusLam() const + { + return yPlusLam_; + } + + //- Const access to the coefficients dictionary + const dictionary& coeffDict() const + { + return coeffDict_; + } + + //- Const access to the wall functions coefficients dictionary + const dictionary& walLFunctionDict() const + { + return wallFunctionDict_; + } + + + //- Return the laminar viscosity + const volScalarField& mu() const + { + return thermophysicalModel_.mu(); + } + + //- Return the turbulence viscosity + virtual tmp<volScalarField> mut() const = 0; + + //- Return the effective viscosity + virtual tmp<volScalarField> muEff() const + { + return tmp<volScalarField> + ( + new volScalarField("muEff", mut() + mu()) + ); + } + + //- Return the effective turbulent thermal diffusivity + virtual tmp<volScalarField> alphaEff() const = 0; + + //- Return the turbulence kinetic energy + virtual tmp<volScalarField> k() const = 0; + + //- Return the turbulence kinetic energy dissipation rate + virtual tmp<volScalarField> epsilon() const = 0; + + //- Return the Reynolds stress tensor + virtual tmp<volSymmTensorField> R() const = 0; + + //- Return the effective stress tensor including the laminar stress + virtual tmp<volSymmTensorField> devRhoReff() const = 0; + + //- Return the source term for the momentum equation + virtual tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const = 0; + + //- Return yPlus for the given patch + virtual tmp<scalarField> yPlus(const label patchI) const; + + //- Solve the turbulence equations and correct the turbulence viscosity + virtual void correct() = 0; + + //- Read turbulenceProperties dictionary + virtual bool read() = 0; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace compressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/RASModel/newRASModel.C b/src/turbulenceModels/compressible/RAS/RASModel/newRASModel.C new file mode 100644 index 00000000000..339e9ad2d2a --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/RASModel/newRASModel.C @@ -0,0 +1,99 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "RASModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +autoPtr<RASModel> RASModel::New +( + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& phi, + basicThermo& thermophysicalModel +) +{ + word RASModelTypeName; + + // Enclose the creation of the turbulencePropertiesDict to ensure it is + // deleted before the RASModel is created otherwise the dictionary + // is entered in the database twice + { + IOdictionary turbulencePropertiesDict + ( + IOobject + ( + "RASProperties", + U.time().constant(), + U.db(), + IOobject::MUST_READ, + IOobject::NO_WRITE + ) + ); + + turbulencePropertiesDict.lookup("RASModel") + >> RASModelTypeName; + } + + Info<< "Selecting RAS turbulence model " << RASModelTypeName << endl; + + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(RASModelTypeName); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalErrorIn + ( + "RASModel::New(const volScalarField&, " + "const volVectorField&, const surfaceScalarField&, " + "basicThermo&)" + ) << "Unknown RASModel type " << RASModelTypeName + << endl << endl + << "Valid RASModel types are :" << endl + << dictionaryConstructorTablePtr_->toc() + << exit(FatalError); + } + + return autoPtr<RASModel> + ( + cstrIter()(rho, U, phi, thermophysicalModel) + ); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace compressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/RNGkEpsilon/RNGkEpsilon.C b/src/turbulenceModels/compressible/RAS/RNGkEpsilon/RNGkEpsilon.C new file mode 100644 index 00000000000..8f6ba823213 --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/RNGkEpsilon/RNGkEpsilon.C @@ -0,0 +1,368 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "RNGkEpsilon.H" +#include "addToRunTimeSelectionTable.H" +#include "wallFvPatch.H" + +#include "backwardsCompatibilityWallFunctions.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace RASModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(RNGkEpsilon, 0); +addToRunTimeSelectionTable(RASModel, RNGkEpsilon, dictionary); + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +// from components +RNGkEpsilon::RNGkEpsilon +( + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& phi, + basicThermo& thermophysicalModel +) +: + RASModel(typeName, rho, U, phi, thermophysicalModel), + + Cmu_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Cmu", + coeffDict_, + 0.0845 + ) + ), + C1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "C1", + coeffDict_, + 1.42 + ) + ), + C2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "C2", + coeffDict_, + 1.68 + ) + ), + C3_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "C3", + coeffDict_, + -0.33 + ) + ), + alphak_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphak", + coeffDict_, + 1.39 + ) + ), + alphaEps_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphaEps", + coeffDict_, + 1.39 + ) + ), + alphah_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphah", + coeffDict_, + 1.0 + ) + ), + eta0_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "eta0", + coeffDict_, + 4.38 + ) + ), + beta_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "beta", + coeffDict_, + 0.012 + ) + ), + + k_ + ( + IOobject + ( + "k", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + autoCreateK("k", mesh_) + ), + epsilon_ + ( + IOobject + ( + "epsilon", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + autoCreateEpsilon("epsilon", mesh_) + ), + mut_ + ( + IOobject + ( + "mut", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + autoCreateMut("mut", mesh_) + ), + alphat_ + ( + IOobject + ( + "alphat", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + autoCreateAlphat("alphat", mesh_) + ) +{ + mut_ == Cmu_*rho_*sqr(k_)/(epsilon_ + epsilonSmall_); + mut_.correctBoundaryConditions(); + + alphat_ == mut_/Prt_; + alphat_.correctBoundaryConditions(); + + printCoeffs(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +tmp<volSymmTensorField> RNGkEpsilon::R() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + "R", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + ((2.0/3.0)*I)*k_ - (mut_/rho_)*dev(twoSymm(fvc::grad(U_))), + k_.boundaryField().types() + ) + ); +} + + +tmp<volSymmTensorField> RNGkEpsilon::devRhoReff() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + "devRhoReff", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + -muEff()*dev(twoSymm(fvc::grad(U_))) + ) + ); +} + + +tmp<fvVectorMatrix> RNGkEpsilon::divDevRhoReff(volVectorField& U) const +{ + return + ( + - fvm::laplacian(muEff(), U) - fvc::div(muEff()*dev2(fvc::grad(U)().T())) + ); +} + + +bool RNGkEpsilon::read() +{ + if (RASModel::read()) + { + Cmu_.readIfPresent(coeffDict_); + C1_.readIfPresent(coeffDict_); + C2_.readIfPresent(coeffDict_); + C3_.readIfPresent(coeffDict_); + alphak_.readIfPresent(coeffDict_); + alphaEps_.readIfPresent(coeffDict_); + alphah_.readIfPresent(coeffDict_); + eta0_.readIfPresent(coeffDict_); + beta_.readIfPresent(coeffDict_); + + return true; + } + else + { + return false; + } +} + + +void RNGkEpsilon::correct() +{ + if (!turbulence_) + { + // Re-calculate viscosity + mut_ == rho_*Cmu_*sqr(k_)/(epsilon_ + epsilonSmall_); + mut_.correctBoundaryConditions(); + + // Re-calculate thermal diffusivity + alphat_ = mut_/Prt_; + alphat_.correctBoundaryConditions(); + + return; + } + + RASModel::correct(); + + volScalarField divU = fvc::div(phi_/fvc::interpolate(rho_)); + + if (mesh_.moving()) + { + divU += fvc::div(mesh_.phi()); + } + + tmp<volTensorField> tgradU = fvc::grad(U_); + volScalarField S2 = (tgradU() && dev(twoSymm(tgradU()))); + tgradU.clear(); + + volScalarField G("G", mut_*S2); + + volScalarField eta = sqrt(mag(S2))*k_/epsilon_; + volScalarField eta3 = eta*sqr(eta); + + volScalarField R = + ((eta*(-eta/eta0_ + scalar(1)))/(beta_*eta3 + scalar(1))); + + // Update espsilon and G at the wall + epsilon_.boundaryField().updateCoeffs(); + + // Dissipation equation + tmp<fvScalarMatrix> epsEqn + ( + fvm::ddt(rho_, epsilon_) + + fvm::div(phi_, epsilon_) + - fvm::laplacian(DepsilonEff(), epsilon_) + == + (C1_ - R)*G*epsilon_/k_ + - fvm::SuSp(((2.0/3.0)*C1_ + C3_)*rho_*divU, epsilon_) + - fvm::Sp(C2_*rho_*epsilon_/k_, epsilon_) + ); + + epsEqn().relax(); + + epsEqn().boundaryManipulate(epsilon_.boundaryField()); + + solve(epsEqn); + bound(epsilon_, epsilon0_); + + + // Turbulent kinetic energy equation + + tmp<fvScalarMatrix> kEqn + ( + fvm::ddt(rho_, k_) + + fvm::div(phi_, k_) + - fvm::laplacian(DkEff(), k_) + == + G - fvm::SuSp(2.0/3.0*rho_*divU, k_) + - fvm::Sp(rho_*(epsilon_)/k_, k_) + ); + + kEqn().relax(); + solve(kEqn); + bound(k_, k0_); + + + // Re-calculate viscosity + mut_ == rho_*Cmu_*sqr(k_)/epsilon_; + mut_.correctBoundaryConditions(); + + // Re-calculate thermal diffusivity + alphat_ = mut_/Prt_; + alphat_.correctBoundaryConditions(); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace compressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/RNGkEpsilon/RNGkEpsilon.H b/src/turbulenceModels/compressible/RAS/RNGkEpsilon/RNGkEpsilon.H new file mode 100644 index 00000000000..98445ced1db --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/RNGkEpsilon/RNGkEpsilon.H @@ -0,0 +1,189 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::compressible::RASModels::RNGkEpsilon + +Description + Renormalisation group k-epsilon turbulence model for compressible flows. + + The default model coefficients correspond to the following: + @verbatim + RNGkEpsilonCoeffs + { + Cmu 0.0845; + C1 1.42; + C2 1.68; + C3 -0.33; // only for compressible + alphah 1.0; // only for compressible + alphak 1.39; + alphaEps 1.39; + eta0 4.38; + beta 0.012; + } + @endverbatim + +SourceFiles + RNGkEpsilon.C + RNGkEpsilonCorrect.C + +\*---------------------------------------------------------------------------*/ + +#ifndef compressibleRNGkEpsilon_H +#define compressibleRNGkEpsilon_H + +#include "RASModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class RNGkEpsilon Declaration +\*---------------------------------------------------------------------------*/ + +class RNGkEpsilon +: + public RASModel +{ + // Private data + + dimensionedScalar Cmu_; + dimensionedScalar C1_; + dimensionedScalar C2_; + dimensionedScalar C3_; + dimensionedScalar alphak_; + dimensionedScalar alphaEps_; + dimensionedScalar alphah_; + dimensionedScalar eta0_; + dimensionedScalar beta_; + + volScalarField k_; + volScalarField epsilon_; + volScalarField mut_; + volScalarField alphat_; + + +public: + + //- Runtime type information + TypeName("RNGkEpsilon"); + + // Constructors + + //- from components + RNGkEpsilon + ( + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& phi, + basicThermo& thermophysicalModel + ); + + + // Destructor + + ~RNGkEpsilon(){} + + + // Member Functions + + //- Return the turbulence viscosity + tmp<volScalarField> mut() const + { + return mut_; + } + + //- Return the effective diffusivity for k + tmp<volScalarField> DkEff() const + { + return tmp<volScalarField> + ( + new volScalarField("DkEff", alphak_*mut_ + mu()) + ); + } + + //- Return the effective diffusivity for epsilon + tmp<volScalarField> DepsilonEff() const + { + return tmp<volScalarField> + ( + new volScalarField("DepsilonEff", alphaEps_*mut_ + mu()) + ); + } + + //- Return the effective turbulent thermal diffusivity + tmp<volScalarField> alphaEff() const + { + return tmp<volScalarField> + ( + new volScalarField("alphaEff", alphah_*alphat_ + alpha()) + ); + } + + //- Return the turbulence kinetic energy + tmp<volScalarField> k() const + { + return k_; + } + + //- Return the turbulence kinetic energy dissipation rate + tmp<volScalarField> epsilon() const + { + return epsilon_; + } + + //- Return the Reynolds stress tensor + tmp<volSymmTensorField> R() const; + + //- Return the effective stress tensor including the laminar stress + tmp<volSymmTensorField> devRhoReff() const; + + //- Return the effective stress tensor including the laminar stress + tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const; + + //- Solve the turbulence equations and correct the turbulence viscosity + void correct(); + + //- Read turbulenceProperties dictionary + bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace compressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/SpalartAllmaras/SpalartAllmaras.C b/src/turbulenceModels/compressible/RAS/SpalartAllmaras/SpalartAllmaras.C new file mode 100644 index 00000000000..d0757ab1428 --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/SpalartAllmaras/SpalartAllmaras.C @@ -0,0 +1,353 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "SpalartAllmaras.H" +#include "addToRunTimeSelectionTable.H" +#include "wallDist.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace RASModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(SpalartAllmaras, 0); +addToRunTimeSelectionTable(RASModel, SpalartAllmaras, dictionary); + +// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // + +tmp<volScalarField> SpalartAllmaras::chi() const +{ + return rho_*nuTilda_/mu(); +} + + +tmp<volScalarField> SpalartAllmaras::fv1(const volScalarField& chi) const +{ + volScalarField chi3 = pow3(chi); + return chi3/(chi3 + pow3(Cv1_)); +} + + +tmp<volScalarField> SpalartAllmaras::fv2 +( + const volScalarField& chi, + const volScalarField& fv1 +) const +{ + return 1.0 - chi/(1.0 + chi*fv1); + //return 1.0/pow3(scalar(1) + chi/Cv2); +} + + +tmp<volScalarField> SpalartAllmaras::fv3 +( + const volScalarField& chi, + const volScalarField& fv1 +) const +{ + volScalarField chiByCv2 = (1/Cv2_)*chi; + + return + (scalar(1) + chi*fv1) + *(1/Cv2_) + *(3*(scalar(1) + chiByCv2) + sqr(chiByCv2)) + /pow3(scalar(1) + chiByCv2); +} + + +tmp<volScalarField> SpalartAllmaras::fw(const volScalarField& Stilda) const +{ + volScalarField r = min + ( + nuTilda_ + /( + max(Stilda, dimensionedScalar("SMALL", Stilda.dimensions(), SMALL)) + *sqr(kappa_*d_) + ), + scalar(10.0) + ); + r.boundaryField() == 0.0; + + volScalarField g = r + Cw2_*(pow6(r) - r); + + return g*pow((1.0 + pow6(Cw3_))/(pow6(g) + pow6(Cw3_)), 1.0/6.0); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +SpalartAllmaras::SpalartAllmaras +( + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& phi, + basicThermo& thermophysicalModel +) +: + RASModel(typeName, rho, U, phi, thermophysicalModel), + + alphaNut_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphaNut", + coeffDict_, + 1.5 + ) + ), + alphah_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphah", + coeffDict_, + 1.0 + ) + ), + + Cb1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Cb1", + coeffDict_, + 0.1355 + ) + ), + Cb2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Cb2", + coeffDict_, + 0.622 + ) + ), + Cw1_(Cb1_/sqr(kappa_) + alphaNut_*(1.0 + Cb2_)), + Cw2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Cw2", + coeffDict_, + 0.3 + ) + ), + Cw3_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Cw3", + coeffDict_, + 2.0 + ) + ), + Cv1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Cv1", + coeffDict_, + 7.1 + ) + ), + Cv2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Cv2", + coeffDict_, + 5.0 + ) + ), + + nuTilda_ + ( + IOobject + ( + "nuTilda", + runTime_.timeName(), + mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh_ + ), + + mut_ + ( + IOobject + ( + "mut", + runTime_.timeName(), + mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh_ + ), + + d_(mesh_) +{ + printCoeffs(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +tmp<volSymmTensorField> SpalartAllmaras::R() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + "R", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + ((2.0/3.0)*I)*k() - (mut_/rho_)*dev(twoSymm(fvc::grad(U_))) + ) + ); +} + + +tmp<volSymmTensorField> SpalartAllmaras::devRhoReff() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + "devRhoReff", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + -muEff()*dev(twoSymm(fvc::grad(U_))) + ) + ); +} + + +tmp<fvVectorMatrix> SpalartAllmaras::divDevRhoReff(volVectorField& U) const +{ + volScalarField muEff_ = muEff(); + + return + ( + - fvm::laplacian(muEff_, U) + - fvc::div(muEff_*dev2(fvc::grad(U)().T())) + ); +} + + +bool SpalartAllmaras::read() +{ + if (RASModel::read()) + { + alphaNut_.readIfPresent(coeffDict_); + alphah_.readIfPresent(coeffDict_); + + Cb1_.readIfPresent(coeffDict_); + Cb2_.readIfPresent(coeffDict_); + Cw1_ = Cb1_/sqr(kappa_) + alphaNut_*(1.0 + Cb2_); + Cw2_.readIfPresent(coeffDict_); + Cw3_.readIfPresent(coeffDict_); + Cv1_.readIfPresent(coeffDict_); + Cv2_.readIfPresent(coeffDict_); + + return true; + } + else + { + return false; + } +} + + +void SpalartAllmaras::correct() +{ + if (!turbulence_) + { + // Re-calculate viscosity + mut_ = rho_*nuTilda_*fv1(chi()); + return; + } + + RASModel::correct(); + + if (mesh_.changing()) + { + d_.correct(); + } + + volScalarField chi = this->chi(); + volScalarField fv1 = this->fv1(chi); + + volScalarField Stilda = + fv3(chi, fv1)*::sqrt(2.0)*mag(skew(fvc::grad(U_))) + + fv2(chi, fv1)*nuTilda_/sqr(kappa_*d_); + + tmp<fvScalarMatrix> nuTildaEqn + ( + fvm::ddt(rho_, nuTilda_) + + fvm::div(phi_, nuTilda_) + - fvm::laplacian(DnuTildaEff(), nuTilda_) + - alphaNut_*Cb2_*rho_*magSqr(fvc::grad(nuTilda_)) + == + Cb1_*rho_*Stilda*nuTilda_ + - fvm::Sp(Cw1_*fw(Stilda)*nuTilda_*rho_/sqr(d_), nuTilda_) + ); + + nuTildaEqn().relax(); + solve(nuTildaEqn); + bound(nuTilda_, dimensionedScalar("0", nuTilda_.dimensions(), 0.0)); + nuTilda_.correctBoundaryConditions(); + + mut_.internalField() = fv1*nuTilda_.internalField()*rho_.internalField(); + mut_.correctBoundaryConditions(); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace compressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/SpalartAllmaras/SpalartAllmaras.H b/src/turbulenceModels/compressible/RAS/SpalartAllmaras/SpalartAllmaras.H new file mode 100644 index 00000000000..da3aa6fc2e5 --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/SpalartAllmaras/SpalartAllmaras.H @@ -0,0 +1,245 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::compressible::RASModels::SpalartAllmaras + +Description + Spalart-Allmaras one-eqn mixing-length model for compressible + external flows. + + Reference: + @verbatim + "A One-Equation Turbulence Model for Aerodynamic Flows" + P.R. Spalart, + S.R. Allmaras, + La Recherche A´rospatiale, No. 1, 1994, pp. 5–21. + + Extended according to: + + "An Unstructured Grid Generation and Adaptive Solution Technique + for High Reynolds Number Compressible Flows" + G.A. Ashford, + Ph.D. thesis, University of Michigan, 1996. + @endverbatim + + The default model coefficients correspond to the following: + @verbatim + SpalartAllmarasCoeffs + { + Cb1 0.1355; + Cb2 0.622; + Cw2 0.3; + Cw3 2.0; + Cv1 7.1; + Cv2 5.0; + alphaNut 1.5; + alphah 1.0; // only for compressible + } + @endverbatim + +SourceFiles + SpalartAllmaras.C + SpalartAllmarasCorrect.C + +\*---------------------------------------------------------------------------*/ + +#ifndef compressibleSpalartAllmaras_H +#define combressibleSpalartAllmaras_H + +#include "RASModel.H" +#include "wallDist.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class SpalartAllmaras Declaration +\*---------------------------------------------------------------------------*/ + +class SpalartAllmaras +: + public RASModel +{ + // Private data + + dimensionedScalar alphaNut_; + dimensionedScalar alphah_; + + dimensionedScalar Cb1_; + dimensionedScalar Cb2_; + dimensionedScalar Cw1_; + dimensionedScalar Cw2_; + dimensionedScalar Cw3_; + dimensionedScalar Cv1_; + dimensionedScalar Cv2_; + + volScalarField nuTilda_; + volScalarField mut_; + + wallDist d_; + + + // Private member functions + + tmp<volScalarField> chi() const; + tmp<volScalarField> fv1(const volScalarField& chi) const; + tmp<volScalarField> fv2 + ( + const volScalarField& chi, + const volScalarField& fv1 + ) const; + tmp<volScalarField> fv3 + ( + const volScalarField& chi, + const volScalarField& fv1 + ) const; + tmp<volScalarField> fw(const volScalarField& Stilda) const; + + +public: + + //- Runtime type information + TypeName("SpalartAllmaras"); + + + // Constructors + + //- from components + SpalartAllmaras + ( + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& phi, + basicThermo& thermophysicalModel + ); + + + // Destructor + + ~SpalartAllmaras() + {} + + + // Member Functions + + //- Return the turbulence viscosity + tmp<volScalarField> mut() const + { + return mut_; + } + + //- Return the effective diffusivity for nuTilda + tmp<volScalarField> DnuTildaEff() const + { + return tmp<volScalarField> + ( + new volScalarField + ( + "DnuTildaEff", + alphaNut_*rho_*nuTilda_ + mu() + ) + ); + } + //- Return the effective turbulent thermal diffusivity + tmp<volScalarField> alphaEff() const + { + return tmp<volScalarField> + ( + new volScalarField("alphaEff", alphah_*mut_ + alpha()) + ); + } + + //- Return the turbulence kinetic energy + tmp<volScalarField> k() const + { + return tmp<volScalarField> + ( + new volScalarField + ( + IOobject + ( + "k", + runTime_.timeName(), + mesh_ + ), + mesh_, + dimensionedScalar("0", dimensionSet(0, 2, -2, 0, 0), 0) + ) + ); + } + + //- Return the turbulence kinetic energy dissipation rate + tmp<volScalarField> epsilon() const + { + return tmp<volScalarField> + ( + new volScalarField + ( + IOobject + ( + "epslion", + runTime_.timeName(), + mesh_ + ), + mesh_, + dimensionedScalar("0", dimensionSet(0, 2, -3, 0, 0), 0) + ) + ); + } + + //- Return the Reynolds stress tensor + tmp<volSymmTensorField> R() const; + + //- Return the effective stress tensor including the laminar stress + tmp<volSymmTensorField> devRhoReff() const; + + //- Return the source term for the momentum equation + tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const; + + //- Solve the turbulence equations and correct the turbulence viscosity + void correct(); + + //- Read turbulenceProperties dictionary + bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace compressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/backwardsCompatibilityWallFunctions/backwardsCompatibilityWallFunctions.C b/src/turbulenceModels/compressible/RAS/backwardsCompatibilityWallFunctions/backwardsCompatibilityWallFunctions.C new file mode 100644 index 00000000000..19df95a3d5b --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/backwardsCompatibilityWallFunctions/backwardsCompatibilityWallFunctions.C @@ -0,0 +1,286 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "backwardsCompatibilityWallFunctions.H" + +#include "calculatedFvPatchField.H" +#include "alphatWallFunctionFvPatchScalarField.H" +#include "mutWallFunctionFvPatchScalarField.H" +#include "epsilonWallFunctionFvPatchScalarField.H" +#include "kQRWallFunctionFvPatchField.H" +#include "omegaWallFunctionFvPatchScalarField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +tmp<volScalarField> autoCreateAlphat +( + const word& fieldName, + const fvMesh& mesh +) +{ + IOobject alphatHeader + ( + fieldName, + mesh.time().timeName(), + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE, + false + ); + + if (alphatHeader.headerOk()) + { + return tmp<volScalarField>(new volScalarField(alphatHeader, mesh)); + } + else + { + Info<< "--> Upgrading " << fieldName << " to employ run-time " + << "selectable wall functions" << endl; + + const fvBoundaryMesh& bm = mesh.boundary(); + + wordList alphatBoundaryTypes(bm.size()); + + forAll(bm, patchI) + { + if (isType<wallFvPatch>(bm[patchI])) + { + alphatBoundaryTypes[patchI] = + RASModels::alphatWallFunctionFvPatchScalarField::typeName; + } + else + { + alphatBoundaryTypes[patchI] = + calculatedFvPatchField<scalar>::typeName; + } + } + + tmp<volScalarField> alphat + ( + new volScalarField + ( + IOobject + ( + fieldName, + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE, + false + ), + mesh, + dimensionedScalar("zero", dimDensity*dimArea/dimTime, 0.0), + alphatBoundaryTypes + ) + ); + + Info<< " Writing updated " << fieldName << endl; + alphat().write(); + + return alphat; + } +} + + +tmp<volScalarField> autoCreateMut +( + const word& fieldName, + const fvMesh& mesh +) +{ + IOobject mutHeader + ( + fieldName, + mesh.time().timeName(), + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE, + false + ); + + if (mutHeader.headerOk()) + { + return tmp<volScalarField>(new volScalarField(mutHeader, mesh)); + } + else + { + Info<< "--> Upgrading " << fieldName << " to employ run-time " + << "selectable wall functions" << endl; + + const fvBoundaryMesh& bm = mesh.boundary(); + + wordList mutBoundaryTypes(bm.size()); + + forAll(bm, patchI) + { + if (isType<wallFvPatch>(bm[patchI])) + { + mutBoundaryTypes[patchI] = + RASModels::mutWallFunctionFvPatchScalarField::typeName; + } + else + { + mutBoundaryTypes[patchI] = + calculatedFvPatchField<scalar>::typeName; + } + } + + tmp<volScalarField> mut + ( + new volScalarField + ( + IOobject + ( + fieldName, + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE, + false + ), + mesh, + dimensionedScalar("zero", dimDensity*dimArea/dimTime, 0.0), + mutBoundaryTypes + ) + ); + + Info<< " Writing updated " << fieldName << endl; + mut().write(); + + return mut; + } +} + + +tmp<volScalarField> autoCreateEpsilon +( + const word& fieldName, + const fvMesh& mesh +) +{ + return + autoCreateWallFunctionField + < + scalar, + RASModels::epsilonWallFunctionFvPatchScalarField + > + ( + fieldName, + mesh + ); +} + + +tmp<volScalarField> autoCreateOmega +( + const word& fieldName, + const fvMesh& mesh +) +{ + return + autoCreateWallFunctionField + < + scalar, + RASModels::omegaWallFunctionFvPatchScalarField + > + ( + fieldName, + mesh + ); +} + + +tmp<volScalarField> autoCreateK +( + const word& fieldName, + const fvMesh& mesh +) +{ + return + autoCreateWallFunctionField + < + scalar, + RASModels::kQRWallFunctionFvPatchField<scalar> + > + ( + fieldName, + mesh + ); +} + + +tmp<volScalarField> autoCreateQ +( + const word& fieldName, + const fvMesh& mesh +) +{ + return + autoCreateWallFunctionField + < + scalar, + RASModels::kQRWallFunctionFvPatchField<scalar> + > + ( + fieldName, + mesh + ); +} + + +tmp<volSymmTensorField> autoCreateR +( + const word& fieldName, + const fvMesh& mesh +) +{ + return + autoCreateWallFunctionField + < + symmTensor, + RASModels::kQRWallFunctionFvPatchField<symmTensor> + > + ( + fieldName, + mesh + ); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace compressible +} // End namespace Foam + +// ************************************************************************* // + diff --git a/src/turbulenceModels/compressible/RAS/backwardsCompatibilityWallFunctions/backwardsCompatibilityWallFunctions.H b/src/turbulenceModels/compressible/RAS/backwardsCompatibilityWallFunctions/backwardsCompatibilityWallFunctions.H new file mode 100644 index 00000000000..bcc812a6b4d --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/backwardsCompatibilityWallFunctions/backwardsCompatibilityWallFunctions.H @@ -0,0 +1,123 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::compressible + +Description + Auto creation of fields to provide backwards compatibility with + runtime selectable wall functions + +SourceFiles + backwardsCompatibilityWallFunctions.C + backwardsCompatibilityWallFunctionsTemplates.C + +\*---------------------------------------------------------------------------*/ + +#ifndef backwardsCompatibilityWallFunctions_H +#define backwardsCompatibilityWallFunctions_H + +#include "fvMesh.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ + //- mut + tmp<volScalarField> autoCreateMut + ( + const word& fieldName, + const fvMesh& mesh + ); + + //- alphat + tmp<volScalarField> autoCreateAlphat + ( + const word& fieldName, + const fvMesh& mesh + ); + + //- epsilon + tmp<volScalarField> autoCreateEpsilon + ( + const word& fieldName, + const fvMesh& mesh + ); + + //- omega + tmp<volScalarField> autoCreateOmega + ( + const word& fieldName, + const fvMesh& mesh + ); + + //- k + tmp<volScalarField> autoCreateK + ( + const word& fieldName, + const fvMesh& mesh + ); + + //- Q + tmp<volScalarField> autoCreateQ + ( + const word& fieldName, + const fvMesh& mesh + ); + + //- R + tmp<volSymmTensorField> autoCreateR + ( + const word& fieldName, + const fvMesh& mesh + ); + + //- Helper function to create the new field + template<class Type, class PatchType> + tmp<GeometricField<Type, fvPatchField, volMesh> > + autoCreateWallFunctionField + ( + const word& fieldName, + const fvMesh& mesh + ); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace compressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "backwardsCompatibilityWallFunctionsTemplates.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/turbulenceModels/compressible/RAS/backwardsCompatibilityWallFunctions/backwardsCompatibilityWallFunctionsTemplates.C b/src/turbulenceModels/compressible/RAS/backwardsCompatibilityWallFunctions/backwardsCompatibilityWallFunctionsTemplates.C new file mode 100644 index 00000000000..d6b489ffeab --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/backwardsCompatibilityWallFunctions/backwardsCompatibilityWallFunctionsTemplates.C @@ -0,0 +1,166 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "backwardsCompatibilityWallFunctions.H" +#include "Time.H" + +#include "wallPolyPatch.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template<class Type, class PatchType> +tmp<GeometricField<Type, fvPatchField, volMesh> > +autoCreateWallFunctionField +( + const word& fieldName, + const fvMesh& mesh +) +{ + IOobject mutHeader + ( + "mut", + mesh.time().timeName(), + mesh, + IOobject::MUST_READ + ); + + typedef GeometricField<Type, fvPatchField, volMesh> fieldType; + + if (mutHeader.headerOk()) + { + return tmp<fieldType> + ( + new fieldType + ( + IOobject + ( + fieldName, + mesh.time().timeName(), + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE, + false + ), + mesh + ) + ); + } + else + { + Info<< "--> Upgrading " << fieldName << " to employ run-time " + << "selectable wall functions" << endl; + + // Read existing epsilon field + tmp<fieldType> fieldOrig + ( + new fieldType + ( + IOobject + ( + fieldName, + mesh.time().timeName(), + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE, + false + ), + mesh + ) + ); + + PtrList<fvPatchField<Type> > newPatchFields(mesh.boundary().size()); + + forAll(newPatchFields, patchI) + { + if (isType<wallPolyPatch>(mesh.boundaryMesh()[patchI])) + { + newPatchFields.set + ( + patchI, + new PatchType + ( + mesh.boundary()[patchI], + fieldOrig().dimensionedInternalField() + ) + ); + newPatchFields[patchI] == fieldOrig().boundaryField()[patchI]; + } + else + { + newPatchFields.set + ( + patchI, + fieldOrig().boundaryField()[patchI].clone() + ); + } + } + + tmp<fieldType> fieldNew + ( + new fieldType + ( + IOobject + ( + fieldName, + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE, + false + ), + mesh, + fieldOrig().dimensions(), + fieldOrig().internalField(), + newPatchFields + ) + ); + + Info<< " Writing backup of original " << fieldName << " to " + << fieldName << ".old" << endl; + fieldOrig().rename(fieldName + ".old"); + fieldOrig().write(); + + Info<< " Writing updated " << fieldName << endl; + fieldNew().write(); + + return fieldNew; + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace compressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C new file mode 100644 index 00000000000..9cd3901fe3d --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C @@ -0,0 +1,203 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "turbulentHeatFluxTemperatureFvPatchScalarField.H" +#include "addToRunTimeSelectionTable.H" +#include "fvPatchFieldMapper.H" +#include "volFields.H" +#include "RASModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +turbulentHeatFluxTemperatureFvPatchScalarField:: +turbulentHeatFluxTemperatureFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedGradientFvPatchScalarField(p, iF), + q_(p.size(), 0.0), + rhoName_("undefinedRho") +{} + + +turbulentHeatFluxTemperatureFvPatchScalarField:: +turbulentHeatFluxTemperatureFvPatchScalarField +( + const turbulentHeatFluxTemperatureFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + fixedGradientFvPatchScalarField(ptf, p, iF, mapper), + q_(ptf.q_, mapper), + rhoName_(ptf.rhoName_) +{} + + +turbulentHeatFluxTemperatureFvPatchScalarField:: +turbulentHeatFluxTemperatureFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + fixedGradientFvPatchScalarField(p, iF), + q_("q", dict, p.size()), + rhoName_(dict.lookup("rho")) +{ + fvPatchField<scalar>::operator=(patchInternalField()); + gradient() = 0.0; +} + + +turbulentHeatFluxTemperatureFvPatchScalarField:: +turbulentHeatFluxTemperatureFvPatchScalarField +( + const turbulentHeatFluxTemperatureFvPatchScalarField& thftpsf +) +: + fixedGradientFvPatchScalarField(thftpsf), + q_(thftpsf.q_), + rhoName_(thftpsf.rhoName_) +{} + + +turbulentHeatFluxTemperatureFvPatchScalarField:: +turbulentHeatFluxTemperatureFvPatchScalarField +( + const turbulentHeatFluxTemperatureFvPatchScalarField& thftpsf, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedGradientFvPatchScalarField(thftpsf, iF), + q_(thftpsf.q_), + rhoName_(thftpsf.rhoName_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void turbulentHeatFluxTemperatureFvPatchScalarField::autoMap +( + const fvPatchFieldMapper& m +) +{ + fixedGradientFvPatchScalarField::autoMap(m); + q_.autoMap(m); +} + + +void turbulentHeatFluxTemperatureFvPatchScalarField::rmap +( + const fvPatchScalarField& ptf, + const labelList& addr +) +{ + fixedGradientFvPatchScalarField::rmap(ptf, addr); + + const turbulentHeatFluxTemperatureFvPatchScalarField& thftptf = + refCast<const turbulentHeatFluxTemperatureFvPatchScalarField> + ( + ptf + ); + + q_.rmap(thftptf.q_, addr); +} + + +void turbulentHeatFluxTemperatureFvPatchScalarField::updateCoeffs() +{ + if (updated()) + { + return; + } + + const label patchI = patch().index(); + + const RASModel& ras = db().lookupObject<RASModel>("RASProperties"); + + const scalarField alphaEffp = ras.alphaEff()().boundaryField()[patchI]; + + const basicThermo& thermo = + db().lookupObject<basicThermo>("thermophysicalProperties"); + +// const scalarField& Tp = thermo.T().boundaryField()[patchI]; + const scalarField& Tp = *this; + + const scalarField Cpp = thermo.Cp(Tp, patchI); + + const scalarField& rhop = + patch().lookupPatchField<volScalarField, scalar>(rhoName_); + + const scalar Ap = gSum(patch().magSf()); + + gradient() = q_/(Ap*rhop*Cpp*alphaEffp); + + fixedGradientFvPatchScalarField::updateCoeffs(); +} + + +void turbulentHeatFluxTemperatureFvPatchScalarField::write +( + Ostream& os +) const +{ + fvPatchScalarField::write(os); + q_.writeEntry("q", os); + os.writeKeyword("rho") << rhoName_ << token::END_STATEMENT << nl; + gradient().writeEntry("gradient", os); + writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField +( + fvPatchScalarField, + turbulentHeatFluxTemperatureFvPatchScalarField +); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace compressible +} // End namespace Foam + + +// ************************************************************************* // + diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.H new file mode 100644 index 00000000000..c2ee7be0125 --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.H @@ -0,0 +1,176 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::turbulentHeatFluxTemperatureFvPatchScalarField + +Description + Fixed heat flux boundary condition for temperature. + +SourceFiles + turbulentHeatFluxTemperatureFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef turbulentHeatFluxTemperatureFvPatchScalarFields_H +#define turbulentHeatFluxTemperatureFvPatchScalarFields_H + +#include "fvPatchFields.H" +#include "fixedGradientFvPatchFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ + +/*---------------------------------------------------------------------------*\ + Class turbulentHeatFluxTemperatureFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class turbulentHeatFluxTemperatureFvPatchScalarField +: + public fixedGradientFvPatchScalarField +{ +// Private data + + //- Heat flux [W] + scalarField q_; + + //- Name of density field + word rhoName_; + + +public: + + //- Runtime type information + TypeName("turbulentHeatFluxTemperature"); + + + // Constructors + + //- Construct from patch and internal field + turbulentHeatFluxTemperatureFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + turbulentHeatFluxTemperatureFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given + // turbulentHeatFluxTemperatureFvPatchScalarField onto + // a new patch + turbulentHeatFluxTemperatureFvPatchScalarField + ( + const turbulentHeatFluxTemperatureFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + turbulentHeatFluxTemperatureFvPatchScalarField + ( + const turbulentHeatFluxTemperatureFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchScalarField> clone() const + { + return tmp<fvPatchScalarField> + ( + new turbulentHeatFluxTemperatureFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + turbulentHeatFluxTemperatureFvPatchScalarField + ( + const turbulentHeatFluxTemperatureFvPatchScalarField&, + 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 turbulentHeatFluxTemperatureFvPatchScalarField + ( + *this, + iF + ) + ); + } + + + // Member functions + + // Mapping functions + + //- Map (and resize as needed) from self given a mapping object + virtual void autoMap(const fvPatchFieldMapper&); + + //- Reverse map the given fvPatchField onto this fvPatchField + virtual void rmap + ( + const fvPatchScalarField&, + const labelList& + ); + + + // Evaluation functions + + //- Update the coefficients associated with the patch field + virtual void updateCoeffs(); + + + // I-O + + //- Write + virtual void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace compressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C new file mode 100644 index 00000000000..01b341748df --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C @@ -0,0 +1,152 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2006-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "turbulentMixingLengthDissipationRateInletFvPatchScalarField.H" +#include "addToRunTimeSelectionTable.H" +#include "fvPatchFieldMapper.H" +#include "surfaceFields.H" +#include "volFields.H" +#include "RASModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +turbulentMixingLengthDissipationRateInletFvPatchScalarField:: +turbulentMixingLengthDissipationRateInletFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchField<scalar>(p, iF), + mixingLength_(0.001) +{} + +turbulentMixingLengthDissipationRateInletFvPatchScalarField:: +turbulentMixingLengthDissipationRateInletFvPatchScalarField +( + const turbulentMixingLengthDissipationRateInletFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + fixedValueFvPatchField<scalar>(ptf, p, iF, mapper), + mixingLength_(ptf.mixingLength_) +{} + +turbulentMixingLengthDissipationRateInletFvPatchScalarField:: +turbulentMixingLengthDissipationRateInletFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + fixedValueFvPatchField<scalar>(p, iF, dict), + mixingLength_(readScalar(dict.lookup("mixingLength"))) +{} + +turbulentMixingLengthDissipationRateInletFvPatchScalarField:: +turbulentMixingLengthDissipationRateInletFvPatchScalarField +( + const turbulentMixingLengthDissipationRateInletFvPatchScalarField& ptf +) +: + fixedValueFvPatchField<scalar>(ptf), + mixingLength_(ptf.mixingLength_) +{} + +turbulentMixingLengthDissipationRateInletFvPatchScalarField:: +turbulentMixingLengthDissipationRateInletFvPatchScalarField +( + const turbulentMixingLengthDissipationRateInletFvPatchScalarField& ptf, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchField<scalar>(ptf, iF), + mixingLength_(ptf.mixingLength_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void turbulentMixingLengthDissipationRateInletFvPatchScalarField::updateCoeffs() +{ + if (updated()) + { + return; + } + + // Lookup Cmu corresponding to the turbulence model selected + const compressible::RASModel& RAS = + db().lookupObject<compressible::RASModel>("RASProperties"); + scalar Cmu = readScalar(RAS.coeffDict().lookup("Cmu")); + + scalar Cmu75 = pow(Cmu, 0.75); + + const fvPatchField<scalar>& k = + patch().lookupPatchField<volScalarField, scalar>("k"); + + operator==(Cmu75*k*sqrt(k)/mixingLength_); + + fixedValueFvPatchField<scalar>::updateCoeffs(); +} + + +void turbulentMixingLengthDissipationRateInletFvPatchScalarField::write +( + Ostream& os +) const +{ + fvPatchField<scalar>::write(os); + os.writeKeyword("mixingLength") + << mixingLength_ << token::END_STATEMENT << nl; + writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField +( + fvPatchScalarField, + turbulentMixingLengthDissipationRateInletFvPatchScalarField +); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace compressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.H new file mode 100644 index 00000000000..8b13df2af02 --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.H @@ -0,0 +1,167 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2006-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::compressible:: + turbulentMixingLengthDissipationRateInletFvPatchScalarField + +Description + Calculate epsilon via the mixing length [m] + + Example of the boundary condition specification: + @verbatim + inlet + { + type turbulentMixingLengthDissipationRateInlet; + mixingLength 0.005; // 5 mm + value uniform 200; // placeholder + } + @endverbatim + +SourceFiles + turbulentMixingLengthDissipationRateInletFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef compressibleturbulentMixingLengthDissipationRateInletFvPatchField_H +#define compressibleturbulentMixingLengthDissipationRateInletFvPatchField_H + +#include "fixedValueFvPatchFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ + +/*---------------------------------------------------------------------------*\ + Class turbulentMixingLengthDissipationRateInletFvPatch Declaration +\*---------------------------------------------------------------------------*/ + +class turbulentMixingLengthDissipationRateInletFvPatchScalarField +: + public fixedValueFvPatchScalarField +{ + // Private data + + //- turbulent length scale + scalar mixingLength_; + +public: + + //- Runtime type information + TypeName("turbulentMixingLengthDissipationRateInlet"); + + + // Constructors + + //- Construct from patch and internal field + turbulentMixingLengthDissipationRateInletFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + turbulentMixingLengthDissipationRateInletFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given + // turbulentMixingLengthDissipationRateInletFvPatchScalarField + // onto a new patch + turbulentMixingLengthDissipationRateInletFvPatchScalarField + ( + const turbulentMixingLengthDissipationRateInletFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + turbulentMixingLengthDissipationRateInletFvPatchScalarField + ( + const turbulentMixingLengthDissipationRateInletFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchScalarField> clone() const + { + return tmp<fvPatchScalarField> + ( + new turbulentMixingLengthDissipationRateInletFvPatchScalarField + ( + *this + ) + ); + } + + //- Construct as copy setting internal field reference + turbulentMixingLengthDissipationRateInletFvPatchScalarField + ( + const turbulentMixingLengthDissipationRateInletFvPatchScalarField&, + 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 turbulentMixingLengthDissipationRateInletFvPatchScalarField + ( + *this, + iF + ) + ); + } + + + // Member functions + + //- Update the coefficients associated with the patch field + virtual void updateCoeffs(); + + //- Write + virtual void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace compressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C new file mode 100644 index 00000000000..92f01a9a7b4 --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C @@ -0,0 +1,158 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2006-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "turbulentMixingLengthFrequencyInletFvPatchScalarField.H" +#include "addToRunTimeSelectionTable.H" +#include "fvPatchFieldMapper.H" +#include "surfaceFields.H" +#include "volFields.H" +#include "RASModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +turbulentMixingLengthFrequencyInletFvPatchScalarField:: +turbulentMixingLengthFrequencyInletFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchField<scalar>(p, iF), + mixingLength_(0.0), + kName_("undefined-k") +{} + +turbulentMixingLengthFrequencyInletFvPatchScalarField:: +turbulentMixingLengthFrequencyInletFvPatchScalarField +( + const turbulentMixingLengthFrequencyInletFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + fixedValueFvPatchField<scalar>(ptf, p, iF, mapper), + mixingLength_(ptf.mixingLength_), + kName_(ptf.kName_) +{} + +turbulentMixingLengthFrequencyInletFvPatchScalarField:: +turbulentMixingLengthFrequencyInletFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + fixedValueFvPatchField<scalar>(p, iF, dict), + mixingLength_(readScalar(dict.lookup("mixingLength"))), + kName_(dict.lookup("k")) +{} + +turbulentMixingLengthFrequencyInletFvPatchScalarField:: +turbulentMixingLengthFrequencyInletFvPatchScalarField +( + const turbulentMixingLengthFrequencyInletFvPatchScalarField& ptf +) +: + fixedValueFvPatchField<scalar>(ptf), + mixingLength_(ptf.mixingLength_), + kName_(ptf.kName_) +{} + +turbulentMixingLengthFrequencyInletFvPatchScalarField:: +turbulentMixingLengthFrequencyInletFvPatchScalarField +( + const turbulentMixingLengthFrequencyInletFvPatchScalarField& ptf, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchField<scalar>(ptf, iF), + mixingLength_(ptf.mixingLength_), + kName_(ptf.kName_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void turbulentMixingLengthFrequencyInletFvPatchScalarField::updateCoeffs() +{ + if (updated()) + { + return; + } + + // Lookup Cmu corresponding to the turbulence model selected + const compressible::RASModel& RAS = + db().lookupObject<compressible::RASModel>("RASProperties"); + scalar Cmu = readScalar(RAS.coeffDict().lookup("Cmu")); + + scalar Cmu25 = pow(Cmu, 0.25); + + const fvPatchField<scalar>& kp = + patch().lookupPatchField<volScalarField, scalar>(kName_); + + operator==(sqrt(kp)/(Cmu25*mixingLength_)); + + fixedValueFvPatchField<scalar>::updateCoeffs(); +} + + +void turbulentMixingLengthFrequencyInletFvPatchScalarField::write +( + Ostream& os +) const +{ + fvPatchField<scalar>::write(os); + os.writeKeyword("mixingLength") + << mixingLength_ << token::END_STATEMENT << nl; + os.writeKeyword("k") << kName_ << token::END_STATEMENT << nl; + writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField +( + fvPatchScalarField, + turbulentMixingLengthFrequencyInletFvPatchScalarField +); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace compressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H new file mode 100644 index 00000000000..ebba209f1ef --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H @@ -0,0 +1,171 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2006-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::compressible::turbulentMixingLengthFrequencyInletFvPatchScalarField + +Description + Calculate omega via the mixing length + + Example of the boundary condition specification: + @verbatim + inlet + { + type turbulentMixingLengthFrequencyInlet; + mixingLength 0.005; // 5 mm + k k; // turbulent k field + value uniform 5; // initial value + } + @endverbatim + +SourceFiles + turbulentMixingLengthFrequencyInletFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef compressibleturbulentMixingLengthFrequencyInletFvPatchScalarField_H +#define compressibleturbulentMixingLengthFrequencyInletFvPatchScalarField_H + +#include "fixedValueFvPatchFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ + +/*---------------------------------------------------------------------------*\ + Class turbulentMixingLengthFrequencyInletFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class turbulentMixingLengthFrequencyInletFvPatchScalarField +: + public fixedValueFvPatchScalarField +{ + // Private data + + //- Turbulent length scale + scalar mixingLength_; + + //- Name of the turbulent kinetic energy field + word kName_; + + +public: + + //- Runtime type information + TypeName("turbulentMixingLengthFrequencyInlet"); + + + // Constructors + + //- Construct from patch and internal field + turbulentMixingLengthFrequencyInletFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + turbulentMixingLengthFrequencyInletFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given + // turbulentMixingLengthFrequencyInletFvPatchScalarField + // onto a new patch + turbulentMixingLengthFrequencyInletFvPatchScalarField + ( + const turbulentMixingLengthFrequencyInletFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + turbulentMixingLengthFrequencyInletFvPatchScalarField + ( + const turbulentMixingLengthFrequencyInletFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchScalarField> clone() const + { + return tmp<fvPatchScalarField> + ( + new turbulentMixingLengthFrequencyInletFvPatchScalarField + ( + *this + ) + ); + } + + //- Construct as copy setting internal field reference + turbulentMixingLengthFrequencyInletFvPatchScalarField + ( + const turbulentMixingLengthFrequencyInletFvPatchScalarField&, + 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 turbulentMixingLengthFrequencyInletFvPatchScalarField + ( + *this, + iF + ) + ); + } + + + // Member functions + + //- Update the coefficients associated with the patch field + virtual void updateCoeffs(); + + //- Write + virtual void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace compressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.C new file mode 100644 index 00000000000..a34631cc3c2 --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.C @@ -0,0 +1,132 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "alphatWallFunctionFvPatchScalarField.H" +#include "RASModel.H" +#include "fvPatchFieldMapper.H" +#include "volFields.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace RASModels +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +alphatWallFunctionFvPatchScalarField:: +alphatWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchScalarField(p, iF) +{} + + +alphatWallFunctionFvPatchScalarField:: +alphatWallFunctionFvPatchScalarField +( + const alphatWallFunctionFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + fixedValueFvPatchScalarField(ptf, p, iF, mapper) +{} + + +alphatWallFunctionFvPatchScalarField:: +alphatWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + fixedValueFvPatchScalarField(p, iF, dict) +{} + + +alphatWallFunctionFvPatchScalarField:: +alphatWallFunctionFvPatchScalarField +( + const alphatWallFunctionFvPatchScalarField& awfpsf +) +: + fixedValueFvPatchScalarField(awfpsf) +{} + + +alphatWallFunctionFvPatchScalarField:: +alphatWallFunctionFvPatchScalarField +( + const alphatWallFunctionFvPatchScalarField& awfpsf, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchScalarField(awfpsf, iF) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void alphatWallFunctionFvPatchScalarField::updateCoeffs() +{ + const RASModel& ras = db().lookupObject<RASModel>("RASProperties"); + const scalar Prt = ras.Prt().value(); + + const scalarField& mutw = + patch().lookupPatchField<volScalarField, scalar>("mut"); + + operator==(mutw/Prt); +} + + +void alphatWallFunctionFvPatchScalarField::write(Ostream& os) const +{ + fvPatchField<scalar>::write(os); + writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField(fvPatchScalarField, alphatWallFunctionFvPatchScalarField); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace compressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.H new file mode 100644 index 00000000000..d94775a342e --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.H @@ -0,0 +1,155 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::compressible::RASModels::alphatWallFunctionFvPatchScalarField + +Description + Boundary condition for turbulent thermal diffusivity when using wall + functions + - replicates OpenFOAM v1.5 (and earlier) behaviour + +SourceFiles + alphatWallFunctionFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef alphatWallFunctionFvPatchScalarField_H +#define alphatWallFunctionFvPatchScalarField_H + +#include "fixedValueFvPatchFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class alphatWallFunctionFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class alphatWallFunctionFvPatchScalarField +: + public fixedValueFvPatchScalarField +{ + +public: + + //- Runtime type information + TypeName("alphatWallFunction"); + + + // Constructors + + //- Construct from patch and internal field + alphatWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + alphatWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given + // alphatWallFunctionFvPatchScalarField + // onto a new patch + alphatWallFunctionFvPatchScalarField + ( + const alphatWallFunctionFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + alphatWallFunctionFvPatchScalarField + ( + const alphatWallFunctionFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchScalarField> clone() const + { + return tmp<fvPatchScalarField> + ( + new alphatWallFunctionFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + alphatWallFunctionFvPatchScalarField + ( + const alphatWallFunctionFvPatchScalarField&, + 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 alphatWallFunctionFvPatchScalarField(*this, iF) + ); + } + + + // Member functions + + // Evaluation functions + + //- Update the coefficients associated with the patch field + virtual void updateCoeffs(); + + + // I-O + + //- Write + void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace compressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C new file mode 100644 index 00000000000..b22c101340d --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C @@ -0,0 +1,218 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "epsilonWallFunctionFvPatchScalarField.H" +#include "RASModel.H" +#include "fvPatchFieldMapper.H" +#include "volFields.H" +#include "addToRunTimeSelectionTable.H" +#include "wallFvPatch.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace RASModels +{ + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +void epsilonWallFunctionFvPatchScalarField::checkType() +{ + if (!isA<wallFvPatch>(patch())) + { + FatalErrorIn("epsilonWallFunctionFvPatchScalarField::checkType()") + << "Invalid wall function specification" << nl + << " Patch type for patch " << patch().name() + << " must be wall" << nl + << " Current patch type is " << patch().type() << nl << endl + << abort(FatalError); + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedInternalValueFvPatchField<scalar>(p, iF) +{ + checkType(); +} + + +epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField +( + const epsilonWallFunctionFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + fixedInternalValueFvPatchField<scalar>(ptf, p, iF, mapper) +{ + checkType(); +} + + +epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + fixedInternalValueFvPatchField<scalar>(p, iF, dict) +{ + checkType(); +} + + +epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField +( + const epsilonWallFunctionFvPatchScalarField& ewfpsf +) +: + fixedInternalValueFvPatchField<scalar>(ewfpsf) +{ + checkType(); +} + + +epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField +( + const epsilonWallFunctionFvPatchScalarField& ewfpsf, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedInternalValueFvPatchField<scalar>(ewfpsf, iF) +{ + checkType(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void epsilonWallFunctionFvPatchScalarField::updateCoeffs() +{ + const RASModel& ras = db().lookupObject<RASModel>("RASProperties"); + + const scalar Cmu = ras.Cmu().value(); + const scalar Cmu25 = pow(Cmu, 0.25); + const scalar Cmu75 = pow(Cmu, 0.75); + const scalar kappa = ras.kappa().value(); + const scalar yPlusLam = ras.yPlusLam(); + + const scalarField& y = ras.y()[patch().index()]; + + volScalarField& G = const_cast<volScalarField&> + (db().lookupObject<volScalarField>("G")); + + volScalarField& epsilon = const_cast<volScalarField&> + (db().lookupObject<volScalarField>("epsilon")); + + const volScalarField& k = db().lookupObject<volScalarField>("k"); + + const scalarField& rhow = + patch().lookupPatchField<volScalarField, scalar>("rho"); + + const scalarField& muw = + patch().lookupPatchField<volScalarField, scalar>("mu"); + + const scalarField& mutw = + patch().lookupPatchField<volScalarField, scalar>("mut"); + + const fvPatchVectorField& Uw = + patch().lookupPatchField<volVectorField, vector>("U"); + + const scalarField magGradUw = mag(Uw.snGrad()); + + // Set epsilon and G + forAll(mutw, faceI) + { + label faceCellI = patch().faceCells()[faceI]; + + scalar yPlus = + Cmu25*y[faceI]*sqrt(k[faceCellI]) + /(muw[faceI]/rhow[faceI]); + + epsilon[faceCellI] = Cmu75*pow(k[faceCellI], 1.5)/(kappa*y[faceI]); + + if (yPlus > yPlusLam) + { + G[faceCellI] = + (mutw[faceI] + muw[faceI]) + *magGradUw[faceI] + *Cmu25*sqrt(k[faceCellI]) + /(kappa*y[faceI]); + } + else + { + G[faceCellI] = 0.0; + } + } + + // TODO: perform averaging for cells sharing more than one boundary face +} + + +void epsilonWallFunctionFvPatchScalarField::evaluate +( + const Pstream::commsTypes commsType +) +{ + fixedInternalValueFvPatchField<scalar>::evaluate(commsType); +} + + +void epsilonWallFunctionFvPatchScalarField::write(Ostream& os) const +{ + fixedInternalValueFvPatchField<scalar>::write(os); + writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField +( + fvPatchScalarField, + epsilonWallFunctionFvPatchScalarField +); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace compressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.H new file mode 100644 index 00000000000..2cb6b336bfb --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.H @@ -0,0 +1,164 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::compressible::RASModels::epsilonWallFunctionFvPatchScalarField + +Description + Boundary condition for epsilon when using wall functions + - calculates epsilon and G + - epsilon values added directly into the matrix to act as a constraint + +SourceFiles + epsilonWallFunctionFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef epsilonWallFunctionFvPatchScalarField_H +#define epsilonWallFunctionFvPatchScalarField_H + +#include "fixedInternalValueFvPatchField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class epsilonWallFunctionFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class epsilonWallFunctionFvPatchScalarField +: + public fixedInternalValueFvPatchField<scalar> +{ + + // Private member functions + + //- Check the type of the patch + void checkType(); + + +public: + + //- Runtime type information + TypeName("epsilonWallFunction"); + + + // Constructors + + //- Construct from patch and internal field + epsilonWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + epsilonWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given + // epsilonWallFunctionFvPatchScalarField + // onto a new patch + epsilonWallFunctionFvPatchScalarField + ( + const epsilonWallFunctionFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + epsilonWallFunctionFvPatchScalarField + ( + const epsilonWallFunctionFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchScalarField> clone() const + { + return tmp<fvPatchScalarField> + ( + new epsilonWallFunctionFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + epsilonWallFunctionFvPatchScalarField + ( + const epsilonWallFunctionFvPatchScalarField&, + 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 epsilonWallFunctionFvPatchScalarField(*this, iF) + ); + } + + + // Member functions + + // Evaluation functions + + //- Update the coefficients associated with the patch field + virtual void updateCoeffs(); + + //- Evaluate the patchField + virtual void evaluate(const Pstream::commsTypes); + + + // I-O + + //- Write + void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace compressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kQRWallFunctions/kQRWallFunction/kQRWallFunctionFvPatchField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kQRWallFunctions/kQRWallFunction/kQRWallFunctionFvPatchField.C new file mode 100644 index 00000000000..9f6a7d71f99 --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kQRWallFunctions/kQRWallFunction/kQRWallFunctionFvPatchField.C @@ -0,0 +1,155 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "kQRWallFunctionFvPatchField.H" +#include "RASModel.H" +#include "fvPatchFieldMapper.H" +#include "volFields.H" +#include "addToRunTimeSelectionTable.H" +#include "wallFvPatch.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace RASModels +{ + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +template<class Type> +void kQRWallFunctionFvPatchField<Type>::checkType() +{ + if (!isA<wallFvPatch>(this->patch())) + { + FatalErrorIn("kQRWallFunctionFvPatchField::checkType()") + << "Invalid wall function specification" << nl + << " Patch type for patch " << this->patch().name() + << " must be wall" << nl + << " Current patch type is " << this->patch().type() + << nl << endl << abort(FatalError); + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class Type> +kQRWallFunctionFvPatchField<Type>::kQRWallFunctionFvPatchField +( + const fvPatch& p, + const DimensionedField<Type, volMesh>& iF +) +: + zeroGradientFvPatchField<Type>(p, iF) +{ + checkType(); +} + + +template<class Type> +kQRWallFunctionFvPatchField<Type>::kQRWallFunctionFvPatchField +( + const kQRWallFunctionFvPatchField& ptf, + const fvPatch& p, + const DimensionedField<Type, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + zeroGradientFvPatchField<Type>(ptf, p, iF, mapper) +{ + checkType(); +} + + +template<class Type> +kQRWallFunctionFvPatchField<Type>::kQRWallFunctionFvPatchField +( + const fvPatch& p, + const DimensionedField<Type, volMesh>& iF, + const dictionary& dict +) +: + zeroGradientFvPatchField<Type>(p, iF, dict) +{ + checkType(); +} + + +template<class Type> +kQRWallFunctionFvPatchField<Type>::kQRWallFunctionFvPatchField +( + const kQRWallFunctionFvPatchField& tkqrwfpf +) +: + zeroGradientFvPatchField<Type>(tkqrwfpf) +{ + checkType(); +} + + +template<class Type> +kQRWallFunctionFvPatchField<Type>::kQRWallFunctionFvPatchField +( + const kQRWallFunctionFvPatchField& tkqrwfpf, + const DimensionedField<Type, volMesh>& iF +) +: + zeroGradientFvPatchField<Type>(tkqrwfpf, iF) +{ + checkType(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class Type> +void kQRWallFunctionFvPatchField<Type>::evaluate +( + const Pstream::commsTypes commsType +) +{ + zeroGradientFvPatchField<Type>::evaluate(commsType); +} + + +template<class Type> +void kQRWallFunctionFvPatchField<Type>::write(Ostream& os) const +{ + zeroGradientFvPatchField<Type>::write(os); + this->writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace compressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kQRWallFunctions/kQRWallFunction/kQRWallFunctionFvPatchField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kQRWallFunctions/kQRWallFunction/kQRWallFunctionFvPatchField.H new file mode 100644 index 00000000000..05ed2fbcb81 --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kQRWallFunctions/kQRWallFunction/kQRWallFunctionFvPatchField.H @@ -0,0 +1,170 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::compressible::RASModels::kQRWallFunctionFvPatchField + +Description + Boundary condition for turbulence k, Q, and R when using wall functions. + Simply acts as a zero gradient condition. + +SourceFiles + kQRWallFunctionFvPatchField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef kQRWallFunctionFvPatchField_H +#define kQRWallFunctionFvPatchField_H + +#include "zeroGradientFvPatchField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class kQRWallFunctionFvPatchField Declaration +\*---------------------------------------------------------------------------*/ + +template<class Type> +class kQRWallFunctionFvPatchField +: + public zeroGradientFvPatchField<Type> +{ + + // Private member functions + + //- Check the type of the patch + void checkType(); + + +public: + + //- Runtime type information + TypeName("kQRWallFunction"); + + + // Constructors + + //- Construct from patch and internal field + kQRWallFunctionFvPatchField + ( + const fvPatch&, + const DimensionedField<Type, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + kQRWallFunctionFvPatchField + ( + const fvPatch&, + const DimensionedField<Type, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given + // kQRWallFunctionFvPatchField + // onto a new patch + kQRWallFunctionFvPatchField + ( + const kQRWallFunctionFvPatchField&, + const fvPatch&, + const DimensionedField<Type, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + kQRWallFunctionFvPatchField + ( + const kQRWallFunctionFvPatchField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchField<Type> > clone() const + { + return tmp<fvPatchField<Type> > + ( + new kQRWallFunctionFvPatchField(*this) + ); + } + + //- Construct as copy setting internal field reference + kQRWallFunctionFvPatchField + ( + const kQRWallFunctionFvPatchField&, + 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 kQRWallFunctionFvPatchField(*this, iF) + ); + } + + + // Member functions + + // Evaluation functions + + //- Evaluate the patchField + virtual void evaluate + ( + const Pstream::commsTypes commsType=Pstream::Pstream::blocking + ); + + + // I-O + + //- Write + void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace compressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "kQRWallFunctionFvPatchField.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kQRWallFunctions/kQRWallFunction/kQRWallFunctionFvPatchFields.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kQRWallFunctions/kQRWallFunction/kQRWallFunctionFvPatchFields.C new file mode 100644 index 00000000000..6942ba56b12 --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kQRWallFunctions/kQRWallFunction/kQRWallFunctionFvPatchFields.C @@ -0,0 +1,51 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "kQRWallFunctionFvPatchFields.H" +#include "fvPatchFields.H" +#include "addToRunTimeSelectionTable.H" +#include "volFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace RASModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +makePatchFields(kQRWallFunction); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace compressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kQRWallFunctions/kQRWallFunction/kQRWallFunctionFvPatchFields.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kQRWallFunctions/kQRWallFunction/kQRWallFunctionFvPatchFields.H new file mode 100644 index 00000000000..e1297548bee --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kQRWallFunctions/kQRWallFunction/kQRWallFunctionFvPatchFields.H @@ -0,0 +1,56 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#ifndef kQRWallFunctionFvPatchFields_H +#define kQRWallFunctionFvPatchFields_H + +#include "kQRWallFunctionFvPatchField.H" +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace RASModels +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeFieldTypedefs(kQRWallFunction) + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace compressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutRoughWallFunction/mutRoughWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutRoughWallFunction/mutRoughWallFunctionFvPatchScalarField.C new file mode 100644 index 00000000000..67ad5536df5 --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutRoughWallFunction/mutRoughWallFunctionFvPatchScalarField.C @@ -0,0 +1,248 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "mutRoughWallFunctionFvPatchScalarField.H" +#include "RASModel.H" +#include "fvPatchFieldMapper.H" +#include "volFields.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace RASModels +{ + + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +scalar mutRoughWallFunctionFvPatchScalarField::fnRough +( + const scalar KsPlus, + const scalar Cs, + const scalar kappa +) const +{ + // Set deltaB based on non-dimensional roughness height + scalar deltaB = 0.0; + if (KsPlus < 90.0) + { + deltaB = + 1.0/kappa + *log((KsPlus - 2.25)/87.75 + Cs*KsPlus) + *sin(0.4258*(log(KsPlus) - 0.811)); + } + else + { + deltaB = 1.0/kappa*log(1.0 + Cs*KsPlus); + } + + return exp(min(deltaB*kappa, 50.0)); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +mutRoughWallFunctionFvPatchScalarField:: +mutRoughWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchScalarField(p, iF), + Ks_(p.size(), 0.0), + Cs_(p.size(), 0.0) +{} + + +mutRoughWallFunctionFvPatchScalarField:: +mutRoughWallFunctionFvPatchScalarField +( + const mutRoughWallFunctionFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + fixedValueFvPatchScalarField(ptf, p, iF, mapper), + Ks_(ptf.Ks_, mapper), + Cs_(ptf.Cs_, mapper) +{} + + +mutRoughWallFunctionFvPatchScalarField:: +mutRoughWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + fixedValueFvPatchScalarField(p, iF, dict), + Ks_("Ks", dict, p.size()), + Cs_("Cs", dict, p.size()) +{} + + +mutRoughWallFunctionFvPatchScalarField:: +mutRoughWallFunctionFvPatchScalarField +( + const mutRoughWallFunctionFvPatchScalarField& nrwfpsf +) +: + fixedValueFvPatchScalarField(nrwfpsf), + Ks_(nrwfpsf.Ks_), + Cs_(nrwfpsf.Cs_) +{} + + +mutRoughWallFunctionFvPatchScalarField:: +mutRoughWallFunctionFvPatchScalarField +( + const mutRoughWallFunctionFvPatchScalarField& nrwfpsf, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchScalarField(nrwfpsf, iF), + Ks_(nrwfpsf.Ks_), + Cs_(nrwfpsf.Cs_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void mutRoughWallFunctionFvPatchScalarField::autoMap +( + const fvPatchFieldMapper& m +) +{ + fixedValueFvPatchScalarField::autoMap(m); + Ks_.autoMap(m); + Cs_.autoMap(m); +} + + +void mutRoughWallFunctionFvPatchScalarField::rmap +( + const fvPatchScalarField& ptf, + const labelList& addr +) +{ + fixedValueFvPatchScalarField::rmap(ptf, addr); + + const mutRoughWallFunctionFvPatchScalarField& nrwfpsf = + refCast<const mutRoughWallFunctionFvPatchScalarField>(ptf); + + Cs_.rmap(nrwfpsf.Cs_, addr); + Ks_.rmap(nrwfpsf.Ks_, addr); +} + + +void mutRoughWallFunctionFvPatchScalarField::updateCoeffs() +{ + const RASModel& ras = db().lookupObject<RASModel>("RASProperties"); + + const scalar Cmu = ras.Cmu().value(); + const scalar Cmu25 = pow(Cmu, 0.25); + const scalar kappa = ras.kappa().value(); + const scalar E = ras.E().value(); + scalar yPlusLam = ras.yPlusLam(); + + const scalarField& y = ras.y()[patch().index()]; + + const scalarField& rhow = + patch().lookupPatchField<volScalarField, scalar>("rho"); + + const scalarField& k = db().lookupObject<volScalarField>("k"); + + const scalarField& muw = + patch().lookupPatchField<volScalarField, scalar>("mu"); + + scalarField& mutw = *this; + + forAll(mutw, faceI) + { + label faceCellI = patch().faceCells()[faceI]; + + scalar uStar = Cmu25*sqrt(k[faceCellI]); + + scalar yPlus = uStar*y[faceI]/(muw[faceI]/rhow[faceI]); + + scalar KsPlus = uStar*Ks_[faceI]/(muw[faceI]/rhow[faceI]); + + scalar Edash = E; + scalar yPlusLamNew = yPlusLam; + if (KsPlus > 2.25) + { + Edash = E/fnRough(KsPlus, Cs_[faceI], kappa); + yPlusLam = ras.yPlusLam(kappa, Edash); + } + + if (debug) + { + Info<< "yPlus = " << yPlus + << ", KsPlus = " << KsPlus + << ", Edash = " << Edash + << ", yPlusLam = " << yPlusLam + << endl; + } + + if (yPlus > yPlusLamNew) + { + mutw[faceI] = muw[faceI]*(yPlus*kappa/log(Edash*yPlus) - 1); + } + else + { + mutw[faceI] = 0.0; + } + } +} + + +void mutRoughWallFunctionFvPatchScalarField::write(Ostream& os) const +{ + fvPatchField<scalar>::write(os); + Cs_.writeEntry("Cs", os); + Ks_.writeEntry("Ks", os); + writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField(fvPatchScalarField, mutRoughWallFunctionFvPatchScalarField); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace compressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutRoughWallFunction/mutRoughWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutRoughWallFunction/mutRoughWallFunctionFvPatchScalarField.H new file mode 100644 index 00000000000..830e320646c --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutRoughWallFunction/mutRoughWallFunctionFvPatchScalarField.H @@ -0,0 +1,194 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::compressible::RASModels::nutRoughWallFunctionFvPatchScalarField + +Description + Boundary condition for turbulent (kinematic) viscosity when using wall + functions for rough walls. + + Manipulates the E parameter to account for roughness effects, based on + KsPlus. + + - roughness height = sand-grain roughness (0 for smooth walls) + - roughness constant = 0.5-1.0 (0.5 default) + +SourceFiles + mutRoughWallFunctionFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef mutRoughWallFunctionFvPatchScalarField_H +#define mutRoughWallFunctionFvPatchScalarField_H + +#include "fixedValueFvPatchFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class mutRoughWallFunctionFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class mutRoughWallFunctionFvPatchScalarField +: + public fixedValueFvPatchScalarField +{ + // Private data + + //- Roughness height + scalarField Ks_; + + //- Roughness constant + scalarField Cs_; + + + // Private member functions + + //- Compute the roughness function + scalar fnRough + ( + const scalar KsPlus, + const scalar Cs, + const scalar kappa + ) const; + + +public: + + //- Runtime type information + TypeName("mutRoughWallFunction"); + + + // Constructors + + //- Construct from patch and internal field + mutRoughWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + mutRoughWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given + // mutRoughWallFunctionFvPatchScalarField + // onto a new patch + mutRoughWallFunctionFvPatchScalarField + ( + const mutRoughWallFunctionFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + mutRoughWallFunctionFvPatchScalarField + ( + const mutRoughWallFunctionFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchScalarField> clone() const + { + return tmp<fvPatchScalarField> + ( + new mutRoughWallFunctionFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + mutRoughWallFunctionFvPatchScalarField + ( + const mutRoughWallFunctionFvPatchScalarField&, + 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 mutRoughWallFunctionFvPatchScalarField(*this, iF) + ); + } + + + // Member functions + + // Mapping functions + + //- Map (and resize as needed) from self given a mapping object + virtual void autoMap + ( + const fvPatchFieldMapper& + ); + + //- Reverse map the given fvPatchField onto this fvPatchField + virtual void rmap + ( + const fvPatchScalarField&, + const labelList& + ); + + // Evaluation functions + + //- Update the coefficients associated with the patch field + virtual void updateCoeffs(); + + + // I-O + + //- Write + void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace compressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardRoughWallFunction/mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardRoughWallFunction/mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.C new file mode 100644 index 00000000000..8cff5793be3 --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardRoughWallFunction/mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.C @@ -0,0 +1,314 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.H" +#include "RASModel.H" +#include "fvPatchFieldMapper.H" +#include "volFields.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace RASModels +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField:: +mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchScalarField(p, iF), + roughnessHeight_(pTraits<scalar>::zero), + roughnessConstant_(pTraits<scalar>::zero), + roughnessFudgeFactor_(pTraits<scalar>::zero) +{} + + +mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField:: +mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField +( + const mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + fixedValueFvPatchScalarField(ptf, p, iF, mapper), + roughnessHeight_(ptf.roughnessHeight_), + roughnessConstant_(ptf.roughnessConstant_), + roughnessFudgeFactor_(ptf.roughnessFudgeFactor_) +{} + + +mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField:: +mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + fixedValueFvPatchScalarField(p, iF, dict), + roughnessHeight_(readScalar(dict.lookup("roughnessHeight"))), + roughnessConstant_(readScalar(dict.lookup("roughnessConstant"))), + roughnessFudgeFactor_(readScalar(dict.lookup("roughnessFudgeFactor"))) +{} + + +mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField:: +mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField +( + const mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField& tppsf +) +: + fixedValueFvPatchScalarField(tppsf), + roughnessHeight_(tppsf.roughnessHeight_), + roughnessConstant_(tppsf.roughnessConstant_), + roughnessFudgeFactor_(tppsf.roughnessFudgeFactor_) +{} + + +mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField:: +mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField +( + const mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField& tppsf, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchScalarField(tppsf, iF), + roughnessHeight_(tppsf.roughnessHeight_), + roughnessConstant_(tppsf.roughnessConstant_), + roughnessFudgeFactor_(tppsf.roughnessFudgeFactor_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::evaluate +( + const Pstream::commsTypes +) +{ + const RASModel& rasModel + = db().lookupObject<RASModel>("RASProperties"); + + const scalar kappa = rasModel.kappa().value(); + const scalar E = rasModel.E().value(); + const scalar yPlusLam = 11.225; + + // The reciprical of the distance to the adjacent cell centre. + const scalarField& ry = patch().deltaCoeffs(); + + const fvPatchVectorField& U = + patch().lookupPatchField<volVectorField, vector>("U"); + + const fvPatchScalarField& rho = + patch().lookupPatchField<volScalarField, scalar>("rho"); + + // The flow velocity at the adjacent cell centre. + scalarField magUp = mag(U.patchInternalField() - U); + + const scalarField& muw = + patch().lookupPatchField<volScalarField, scalar>("mu"); + scalarField& mutw = *this; + + scalarField magFaceGradU = mag(U.snGrad()); + + if(roughnessHeight_ > 0.0) + { + // Rough Walls. + const scalar c_1 = 1/(90 - 2.25) + roughnessConstant_; + static const scalar c_2 = 2.25/(90 - 2.25); + static const scalar c_3 = 2.0*atan(1.0)/log(90/2.25); + static const scalar c_4 = c_3*log(2.25); + + //if (KsPlusBasedOnYPlus_) + { + // If KsPlus is based on YPlus the extra term added to the law + // of the wall will depend on yPlus. + forAll(mutw, facei) + { + const scalar magUpara = magUp[facei]; + const scalar Re = rho[facei]*magUpara/(muw[facei]*ry[facei]); + const scalar kappaRe = kappa*Re; + + scalar yPlus = yPlusLam; + const scalar ryPlusLam = 1.0/yPlus; + + int iter = 0; + scalar yPlusLast = 0.0; + scalar dKsPlusdYPlus = roughnessHeight_*ry[facei]; + + // Enforce the roughnessHeight to be less than the distance to + // the first cell centre. + if(dKsPlusdYPlus > 1) + { + dKsPlusdYPlus = 1; + } + + // Fudge factor to get results to be similar to fluent + // (at least difference between rough and smooth). + dKsPlusdYPlus *= roughnessFudgeFactor_; + + do + { + yPlusLast = yPlus; + + // The non-dimensional roughness height. + scalar KsPlus = yPlus*dKsPlusdYPlus; + + // The extra term in the law-of-the-wall. + scalar G = 0.0; + + scalar yPlusGPrime = 0.0; + + if (KsPlus >= 90) + { + const scalar t_1 = 1 + roughnessConstant_*KsPlus; + G = log(t_1); + yPlusGPrime = roughnessConstant_*KsPlus/t_1; + } + else if (KsPlus > 2.25) + { + const scalar t_1 = c_1*KsPlus - c_2; + const scalar t_2 = c_3*log(KsPlus) - c_4; + const scalar sint_2 = sin(t_2); + const scalar logt_1 = log(t_1); + G = logt_1*sint_2; + yPlusGPrime = + (c_1*sint_2*KsPlus/t_1) + (c_3*logt_1*cos(t_2)); + } + + scalar denom = 1.0 + log(E* yPlus) - G - yPlusGPrime; + if(mag(denom) > VSMALL) + { + yPlus = (kappaRe + yPlus*(1 - yPlusGPrime))/denom; + if( yPlus < 0 ) + { + yPlus = 0; + } + } + else + { + // Ensure immediate end and mutw = 0. + yPlus = 0; + } + + } while + ( + mag(ryPlusLam*(yPlus - yPlusLast)) > 0.0001 + && ++iter < 10 + && yPlus > VSMALL + ); + + if (yPlus > yPlusLam) + { + mutw[facei] = muw[facei]*(yPlus*yPlus/Re - 1); + } + else + { + mutw[facei] = 0.0; + } + } + } + } + else + { + // Smooth Walls. + forAll(mutw, facei) + { + const scalar magUpara = magUp[facei]; + const scalar Re = rho[facei]*magUpara/(muw[facei]*ry[facei]); + const scalar kappaRe = kappa*Re; + + scalar yPlus = yPlusLam; + const scalar ryPlusLam = 1.0/yPlus; + + int iter = 0; + scalar yPlusLast = 0.0; + + do + { + yPlusLast = yPlus; + yPlus = (kappaRe + yPlus)/(1.0 + log(E*yPlus)); + + } while + ( + mag(ryPlusLam*(yPlus - yPlusLast)) > 0.0001 + && ++iter < 10 + ); + + if (yPlus > yPlusLam) + { + mutw[facei] = muw[facei]*(yPlus*yPlus/Re - 1); + } + else + { + mutw[facei] = 0.0; + } + } + } +} + + +void mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::write +( + Ostream& os +) const +{ + fixedValueFvPatchScalarField::write(os); + os.writeKeyword("roughnessHeight") + << roughnessHeight_ << token::END_STATEMENT << nl; + os.writeKeyword("roughnessConstant") + << roughnessConstant_ << token::END_STATEMENT << nl; + os.writeKeyword("roughnessFudgeFactor") + << roughnessFudgeFactor_ << token::END_STATEMENT << nl; +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField +( + fvPatchScalarField, + mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField +); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace compressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardRoughWallFunction/mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardRoughWallFunction/mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.H new file mode 100644 index 00000000000..7341cea2417 --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardRoughWallFunction/mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.H @@ -0,0 +1,208 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::compressible::RASModels:: + mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField + +Description + Wall function boundary condition for rough walls + +SourceFiles + mutSpalartAllamarasStandardWallFunctionFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField_H +#define mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField_H + +#include "fixedValueFvPatchFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ +Class mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField +: + public fixedValueFvPatchScalarField +{ + // Private data + + scalar roughnessHeight_; + scalar roughnessConstant_; + scalar roughnessFudgeFactor_; + + +public: + + //- Runtime type information + TypeName("mutSpalartAllmarasStandardRoughWallFunction"); + + + // Constructors + + //- Construct from patch and internal field + mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given + // mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField + // onto a new patch + mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField + ( + const mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField + ( + const mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchScalarField> clone() const + { + return tmp<fvPatchScalarField> + ( + new mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField + ( + *this + ) + ); + } + + //- Construct as copy setting internal field reference + mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField + ( + const mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField&, + 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 mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField + ( + *this, + iF + ) + ); + } + + + // Member functions + + // Access + + //- Return the fluctuation scale + const scalar& roughnessHeight() const + { + return roughnessHeight_; + } + + //- Return reference to the fluctuation scale to allow adjustment + scalar& roughnessHeight() + { + return roughnessHeight_; + } + + + //- Return the fluctuation scale + const scalar& roughnessConstant() const + { + return roughnessConstant_; + } + + //- Return reference to the fluctuation scale to allow adjustment + scalar& roughnessConstant() + { + return roughnessConstant_; + } + + //- Return the fluctuation scale + const scalar& roughnessFudgeFactor() const + { + return roughnessFudgeFactor_; + } + + //- Return reference to the fluctuation scale to allow adjustment + scalar& roughnessFudgeFactor() + { + return roughnessFudgeFactor_; + } + + + // Evaluation functions + + //- Evaluate the patchField + virtual void evaluate + ( + const Pstream::commsTypes commsType=Pstream::blocking + ); + + + //- Write + virtual void write(Ostream& os) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace compressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardWallFunction/mutSpalartAllmarasStandardWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardWallFunction/mutSpalartAllmarasStandardWallFunctionFvPatchScalarField.C new file mode 100644 index 00000000000..669d0e72f84 --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardWallFunction/mutSpalartAllmarasStandardWallFunctionFvPatchScalarField.C @@ -0,0 +1,175 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "mutSpalartAllmarasStandardWallFunctionFvPatchScalarField.H" +#include "RASModel.H" +#include "fvPatchFieldMapper.H" +#include "volFields.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace RASModels +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +mutSpalartAllmarasStandardWallFunctionFvPatchScalarField:: +mutSpalartAllmarasStandardWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchScalarField(p, iF) +{} + + +mutSpalartAllmarasStandardWallFunctionFvPatchScalarField:: +mutSpalartAllmarasStandardWallFunctionFvPatchScalarField +( + const mutSpalartAllmarasStandardWallFunctionFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + fixedValueFvPatchScalarField(ptf, p, iF, mapper) +{} + + +mutSpalartAllmarasStandardWallFunctionFvPatchScalarField:: +mutSpalartAllmarasStandardWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + fixedValueFvPatchScalarField(p, iF, dict) +{} + + +mutSpalartAllmarasStandardWallFunctionFvPatchScalarField:: +mutSpalartAllmarasStandardWallFunctionFvPatchScalarField +( + const mutSpalartAllmarasStandardWallFunctionFvPatchScalarField& tppsf +) +: + fixedValueFvPatchScalarField(tppsf) +{} + + +mutSpalartAllmarasStandardWallFunctionFvPatchScalarField:: +mutSpalartAllmarasStandardWallFunctionFvPatchScalarField +( + const mutSpalartAllmarasStandardWallFunctionFvPatchScalarField& tppsf, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchScalarField(tppsf, iF) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void mutSpalartAllmarasStandardWallFunctionFvPatchScalarField::evaluate +( + const Pstream::commsTypes +) +{ + const RASModel& ras = db().lookupObject<RASModel>("RASProperties"); + + scalar kappa = ras.kappa().value(); + scalar E = ras.E().value(); + scalar yPlusLam = ras.yPlusLam(); + + const scalarField& ry = patch().deltaCoeffs(); + + const fvPatchVectorField& U = + patch().lookupPatchField<volVectorField, vector>("U"); + + scalarField magUp = mag(U.patchInternalField() - U); + + const scalarField& rhow = + patch().lookupPatchField<volScalarField, scalar>("rho"); + + const scalarField& muw = + patch().lookupPatchField<volScalarField, scalar>("mu"); + scalarField& mutw = *this; + + scalarField magFaceGradU = mag(U.snGrad()); + + forAll(mutw, faceI) + { + scalar magUpara = magUp[faceI]; + + scalar kappaRe = kappa*magUpara/((muw[faceI]/rhow[faceI])*ry[faceI]); + + scalar yPlus = yPlusLam; + scalar ryPlusLam = 1.0/yPlus; + + int iter = 0; + scalar yPlusLast = 0.0; + + do + { + yPlusLast = yPlus; + yPlus = (kappaRe + yPlus)/(1.0 + log(E*yPlus)); + + } while(mag(ryPlusLam*(yPlus - yPlusLast)) > 0.01 && ++iter < 10 ); + + if (yPlus > yPlusLam) + { + mutw[faceI] = muw[faceI]*(yPlus*kappa/log(E*yPlus) - 1); + } + else + { + mutw[faceI] = 0.0; + } + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField +( + fvPatchScalarField, + mutSpalartAllmarasStandardWallFunctionFvPatchScalarField +); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace compressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardWallFunction/mutSpalartAllmarasStandardWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardWallFunction/mutSpalartAllmarasStandardWallFunctionFvPatchScalarField.H new file mode 100644 index 00000000000..c55a1fb0c6a --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardWallFunction/mutSpalartAllmarasStandardWallFunctionFvPatchScalarField.H @@ -0,0 +1,158 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::compressible::RASModels:: + mutSpalartAllmarasStandardWallFunctionFvPatchScalarField + +Description + Wall function boundary condition for walls + +SourceFiles + mutSpalartAllmarasStandardWallFunctionFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef mutSpalartAllmarasStandardWallFunctionFvPatchScalarField_H +#define mutSpalartAllmarasStandardWallFunctionFvPatchScalarField_H + +#include "fixedValueFvPatchFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class mutSpalartAllmarasStandardWallFunctionFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class mutSpalartAllmarasStandardWallFunctionFvPatchScalarField +: + public fixedValueFvPatchScalarField +{ + +public: + + //- Runtime type information + TypeName("mutSpalartAllmarasStandardWallFunction"); + + + // Constructors + + //- Construct from patch and internal field + mutSpalartAllmarasStandardWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + mutSpalartAllmarasStandardWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given + // mutSpalartAllmarasStandardWallFunctionFvPatchScalarField + // onto a new patch + mutSpalartAllmarasStandardWallFunctionFvPatchScalarField + ( + const mutSpalartAllmarasStandardWallFunctionFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + mutSpalartAllmarasStandardWallFunctionFvPatchScalarField + ( + const mutSpalartAllmarasStandardWallFunctionFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchScalarField> clone() const + { + return tmp<fvPatchScalarField> + ( + new mutSpalartAllmarasStandardWallFunctionFvPatchScalarField + ( + *this + ) + ); + } + + //- Construct as copy setting internal field reference + mutSpalartAllmarasStandardWallFunctionFvPatchScalarField + ( + const mutSpalartAllmarasStandardWallFunctionFvPatchScalarField&, + 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 mutSpalartAllmarasStandardWallFunctionFvPatchScalarField + ( + *this, + iF + ) + ); + } + + + // Member functions + + // Evaluation functions + + //- Evaluate the patchField + virtual void evaluate + ( + const Pstream::commsTypes commsType=Pstream::blocking + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace compressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasWallFunction/mutSpalartAllmarasWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasWallFunction/mutSpalartAllmarasWallFunctionFvPatchScalarField.C new file mode 100644 index 00000000000..f9e92d19bae --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasWallFunction/mutSpalartAllmarasWallFunctionFvPatchScalarField.C @@ -0,0 +1,187 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "mutSpalartAllmarasWallFunctionFvPatchScalarField.H" +#include "RASModel.H" +#include "fvPatchFieldMapper.H" +#include "volFields.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace RASModels +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +mutSpalartAllmarasWallFunctionFvPatchScalarField:: +mutSpalartAllmarasWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchScalarField(p, iF) +{} + + +mutSpalartAllmarasWallFunctionFvPatchScalarField:: +mutSpalartAllmarasWallFunctionFvPatchScalarField +( + const mutSpalartAllmarasWallFunctionFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + fixedValueFvPatchScalarField(ptf, p, iF, mapper) +{} + + +mutSpalartAllmarasWallFunctionFvPatchScalarField:: +mutSpalartAllmarasWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + fixedValueFvPatchScalarField(p, iF, dict) +{} + + +mutSpalartAllmarasWallFunctionFvPatchScalarField:: +mutSpalartAllmarasWallFunctionFvPatchScalarField +( + const mutSpalartAllmarasWallFunctionFvPatchScalarField& tppsf +) +: + fixedValueFvPatchScalarField(tppsf) +{} + + +mutSpalartAllmarasWallFunctionFvPatchScalarField:: +mutSpalartAllmarasWallFunctionFvPatchScalarField +( + const mutSpalartAllmarasWallFunctionFvPatchScalarField& tppsf, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchScalarField(tppsf, iF) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void mutSpalartAllmarasWallFunctionFvPatchScalarField::evaluate +( + const Pstream::commsTypes +) +{ + const RASModel& ras = db().lookupObject<RASModel>("RASProperties"); + + scalar kappa = ras.kappa().value(); + scalar E = ras.E().value(); + + const scalarField& ry = patch().deltaCoeffs(); + + const fvPatchVectorField& U = + patch().lookupPatchField<volVectorField, vector>("U"); + + scalarField magUp = mag(U.patchInternalField() - U); + + const scalarField& rhow = + patch().lookupPatchField<volScalarField, scalar>("rho"); + + const scalarField& muw = + patch().lookupPatchField<volScalarField, scalar>("mu"); + + scalarField& mutw = *this; + + scalarField magFaceGradU = mag(U.snGrad()); + + forAll(mutw, faceI) + { + scalar magUpara = magUp[faceI]; + + scalar utau = + sqrt((mutw[faceI] + muw[faceI])*magFaceGradU[faceI]/rhow[faceI]); + + if (utau > VSMALL) + { + int iter = 0; + scalar err = GREAT; + + do + { + scalar kUu = min(kappa*magUpara/utau, 50); + scalar fkUu = exp(kUu) - 1 - kUu*(1 + 0.5*kUu); + + scalar f = + - utau/(ry[faceI]*(muw[faceI]/rhow[faceI])) + + magUpara/utau + + 1/E*(fkUu - 1.0/6.0*kUu*sqr(kUu)); + + scalar df = + 1.0/(ry[faceI]*(muw[faceI]/rhow[faceI])) + + magUpara/sqr(utau) + + 1/E*kUu*fkUu/utau; + + scalar utauNew = utau + f/df; + err = mag((utau - utauNew)/utau); + utau = utauNew; + + } while (utau > VSMALL && err > 0.01 && ++iter < 10); + + mutw[faceI] = max + ( + rhow[faceI]*sqr(max(utau, 0))/magFaceGradU[faceI]- muw[faceI], + 0.0 + ); + } + else + { + mutw[faceI] = 0; + } + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField(fvPatchScalarField, mutSpalartAllmarasWallFunctionFvPatchScalarField); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace compressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasWallFunction/mutSpalartAllmarasWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasWallFunction/mutSpalartAllmarasWallFunctionFvPatchScalarField.H new file mode 100644 index 00000000000..8967a243c2a --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasWallFunction/mutSpalartAllmarasWallFunctionFvPatchScalarField.H @@ -0,0 +1,150 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::compressible::RASModels:: + mutSpalartAllmarasWallFunctionFvPatchScalarField + +Description + Wall function boundary condition for walls + +SourceFiles + mutSpalartAllmarasWallFunctionFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef mutSpalartAllmarasWallFunctionFvPatchScalarField_H +#define mutSpalartAllmarasWallFunctionFvPatchScalarField_H + +#include "fixedValueFvPatchFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class mutSpalartAllmarasWallFunctionFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class mutSpalartAllmarasWallFunctionFvPatchScalarField +: + public fixedValueFvPatchScalarField +{ +public: + + //- Runtime type information + TypeName("mutSpalartAllmarasWallFunction"); + + + // Constructors + + //- Construct from patch and internal field + mutSpalartAllmarasWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + mutSpalartAllmarasWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given + // mutSpalartAllmarasWallFunctionFvPatchScalarField + // onto a new patch + mutSpalartAllmarasWallFunctionFvPatchScalarField + ( + const mutSpalartAllmarasWallFunctionFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + mutSpalartAllmarasWallFunctionFvPatchScalarField + ( + const mutSpalartAllmarasWallFunctionFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchScalarField> clone() const + { + return tmp<fvPatchScalarField> + ( + new mutSpalartAllmarasWallFunctionFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + mutSpalartAllmarasWallFunctionFvPatchScalarField + ( + const mutSpalartAllmarasWallFunctionFvPatchScalarField&, + 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 mutSpalartAllmarasWallFunctionFvPatchScalarField(*this, iF) + ); + } + + + // Member functions + + // Evaluation functions + + //- Evaluate the patchField + virtual void evaluate + ( + const Pstream::commsTypes commsType=Pstream::blocking + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace compressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutWallFunction/mutWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutWallFunction/mutWallFunctionFvPatchScalarField.C new file mode 100644 index 00000000000..f73e5b2a899 --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutWallFunction/mutWallFunctionFvPatchScalarField.C @@ -0,0 +1,162 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "mutWallFunctionFvPatchScalarField.H" +#include "RASModel.H" +#include "fvPatchFieldMapper.H" +#include "volFields.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace RASModels +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +mutWallFunctionFvPatchScalarField:: +mutWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchScalarField(p, iF) +{} + + +mutWallFunctionFvPatchScalarField:: +mutWallFunctionFvPatchScalarField +( + const mutWallFunctionFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + fixedValueFvPatchScalarField(ptf, p, iF, mapper) +{} + + +mutWallFunctionFvPatchScalarField:: +mutWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + fixedValueFvPatchScalarField(p, iF, dict) +{} + + +mutWallFunctionFvPatchScalarField:: +mutWallFunctionFvPatchScalarField +( + const mutWallFunctionFvPatchScalarField& tppsf +) +: + fixedValueFvPatchScalarField(tppsf) +{} + + +mutWallFunctionFvPatchScalarField:: +mutWallFunctionFvPatchScalarField +( + const mutWallFunctionFvPatchScalarField& tppsf, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchScalarField(tppsf, iF) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void mutWallFunctionFvPatchScalarField::updateCoeffs() +{ + const RASModel& ras = db().lookupObject<RASModel>("RASProperties"); + + const scalar Cmu = ras.Cmu().value(); + const scalar Cmu25 = pow(Cmu, 0.25); + const scalar kappa = ras.kappa().value(); + const scalar E = ras.E().value(); + const scalar yPlusLam = ras.yPlusLam(); + + const scalarField& y = ras.y()[patch().index()]; + + const scalarField& rhow = + patch().lookupPatchField<volScalarField, scalar>("rho"); + + const volScalarField& k = db().lookupObject<volScalarField>("k"); + + const scalarField& muw = + patch().lookupPatchField<volScalarField, scalar>("mu"); + + scalarField& mutw = *this; + + forAll(mutw, faceI) + { + label faceCellI = patch().faceCells()[faceI]; + + scalar yPlus = + Cmu25*y[faceI]*sqrt(k[faceCellI]) + /(muw[faceI]/rhow[faceI]); + + if (yPlus > yPlusLam) + { + mutw[faceI] = muw[faceI]*(yPlus*kappa/log(E*yPlus) - 1); + } + else + { + mutw[faceI] = 0.0; + } + } +} + + +void mutWallFunctionFvPatchScalarField::write(Ostream& os) const +{ + fvPatchField<scalar>::write(os); + writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField(fvPatchScalarField, mutWallFunctionFvPatchScalarField); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace compressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutWallFunction/mutWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutWallFunction/mutWallFunctionFvPatchScalarField.H new file mode 100644 index 00000000000..815e50ca700 --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutWallFunction/mutWallFunctionFvPatchScalarField.H @@ -0,0 +1,155 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::compressible::RASModels::mutWallFunctionFvPatchScalarField + +Description + Boundary condition for turbulent (kinematic) viscosity when using wall + functions + - replicates OpenFOAM v1.5 (and earlier) behaviour + +SourceFiles + mutWallFunctionFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef mutWallFunctionFvPatchScalarField_H +#define mutWallFunctionFvPatchScalarField_H + +#include "fixedValueFvPatchFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class mutWallFunctionFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class mutWallFunctionFvPatchScalarField +: + public fixedValueFvPatchScalarField +{ + +public: + + //- Runtime type information + TypeName("mutWallFunction"); + + + // Constructors + + //- Construct from patch and internal field + mutWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + mutWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given + // mutWallFunctionFvPatchScalarField + // onto a new patch + mutWallFunctionFvPatchScalarField + ( + const mutWallFunctionFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + mutWallFunctionFvPatchScalarField + ( + const mutWallFunctionFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchScalarField> clone() const + { + return tmp<fvPatchScalarField> + ( + new mutWallFunctionFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + mutWallFunctionFvPatchScalarField + ( + const mutWallFunctionFvPatchScalarField&, + 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 mutWallFunctionFvPatchScalarField(*this, iF) + ); + } + + + // Member functions + + // Evaluation functions + + //- Update the coefficients associated with the patch field + virtual void updateCoeffs(); + + + // I-O + + //- Write + void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace compressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C new file mode 100644 index 00000000000..5b0ee67630f --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C @@ -0,0 +1,209 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "omegaWallFunctionFvPatchScalarField.H" +#include "RASModel.H" +#include "fvPatchFieldMapper.H" +#include "volFields.H" +#include "addToRunTimeSelectionTable.H" +#include "wallFvPatch.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace RASModels +{ + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +void omegaWallFunctionFvPatchScalarField::checkType() +{ + if (!isA<wallFvPatch>(patch())) + { + FatalErrorIn("omegaWallFunctionFvPatchScalarField::checkType()") + << "Invalid wall function specification" << nl + << " Patch type for patch " << patch().name() + << " must be wall" << nl + << " Current patch type is " << patch().type() << nl << endl + << abort(FatalError); + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedInternalValueFvPatchField<scalar>(p, iF) +{ + checkType(); +} + + +omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField +( + const omegaWallFunctionFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + fixedInternalValueFvPatchField<scalar>(ptf, p, iF, mapper) +{ + checkType(); +} + + +omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + fixedInternalValueFvPatchField<scalar>(p, iF, dict) +{ + checkType(); +} + + +omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField +( + const omegaWallFunctionFvPatchScalarField& ewfpsf +) +: + fixedInternalValueFvPatchField<scalar>(ewfpsf) +{ + checkType(); +} + + +omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField +( + const omegaWallFunctionFvPatchScalarField& ewfpsf, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedInternalValueFvPatchField<scalar>(ewfpsf, iF) +{ + checkType(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void omegaWallFunctionFvPatchScalarField::updateCoeffs() +{ + const RASModel& ras = db().lookupObject<RASModel>("RASProperties"); + + const scalar Cmu = ras.Cmu().value(); + const scalar Cmu25 = pow(Cmu, 0.25); + + const scalar kappa = ras.kappa().value(); + const scalar yPlusLam = ras.yPlusLam(); + + const scalarField& y = ras.y()[patch().index()]; + + volScalarField& G = const_cast<volScalarField&> + (db().lookupObject<volScalarField>("G")); + + volScalarField& omega = const_cast<volScalarField&> + (db().lookupObject<volScalarField>("omega")); + + const scalarField& k = db().lookupObject<volScalarField>("k"); + + const scalarField& rhow = + patch().lookupPatchField<volScalarField, scalar>("rho"); + + const scalarField& muw = + patch().lookupPatchField<volScalarField, scalar>("mu"); + + const scalarField& mutw = + patch().lookupPatchField<volScalarField, scalar>("mut"); + + const fvPatchVectorField& Uw = + patch().lookupPatchField<volVectorField, vector>("U"); + + const scalarField magGradUw = mag(Uw.snGrad()); + + // Set epsilon and G + forAll(mutw, faceI) + { + label faceCellI = patch().faceCells()[faceI]; + + scalar yPlus = + Cmu25*y[faceI]*sqrt(k[faceCellI]) + /(muw[faceI]/rhow[faceI]); + + omega[faceCellI] = sqrt(k[faceCellI])/(Cmu25*kappa*y[faceI]); + + if (yPlus > yPlusLam) + { + G[faceCellI] = + (mutw[faceI] + muw[faceI]) + *magGradUw[faceI] + *Cmu25*sqrt(k[faceCellI]) + /(kappa*y[faceI]); + } + else + { + G[faceCellI] = 0.0; + } + } + + // TODO: perform averaging for cells sharing more than one boundary face +} + + +void omegaWallFunctionFvPatchScalarField::write(Ostream& os) const +{ + fixedInternalValueFvPatchField<scalar>::write(os); + writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField +( + fvPatchScalarField, + omegaWallFunctionFvPatchScalarField +); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace compressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.H new file mode 100644 index 00000000000..266e7987d54 --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.H @@ -0,0 +1,159 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::compressible::RASModels::omegaWallFunctionFvPatchScalarField + +Description + Replaces functionality in wallFunctionsI.H + +SourceFiles + omegaWallFunctionFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef omegaWallFunctionFvPatchScalarField_H +#define omegaWallFunctionFvPatchScalarField_H + +#include "fixedInternalValueFvPatchField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class omegaWallFunctionFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class omegaWallFunctionFvPatchScalarField +: + public fixedInternalValueFvPatchField<scalar> +{ + + // Private member functions + + //- Check the type of the patch + void checkType(); + + +public: + + //- Runtime type information + TypeName("omegaWallFunction"); + + + // Constructors + + //- Construct from patch and internal field + omegaWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + omegaWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given + // omegaWallFunctionFvPatchScalarField + // onto a new patch + omegaWallFunctionFvPatchScalarField + ( + const omegaWallFunctionFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + omegaWallFunctionFvPatchScalarField + ( + const omegaWallFunctionFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchScalarField> clone() const + { + return tmp<fvPatchScalarField> + ( + new omegaWallFunctionFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + omegaWallFunctionFvPatchScalarField + ( + const omegaWallFunctionFvPatchScalarField&, + 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 omegaWallFunctionFvPatchScalarField(*this, iF) + ); + } + + + // Member functions + + // Evaluation functions + + //- Update the coefficients associated with the patch field + virtual void updateCoeffs(); + + + // I-O + + //- Write + void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace compressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/include/wallDissipationI.H b/src/turbulenceModels/compressible/RAS/include/wallDissipationI.H new file mode 100644 index 00000000000..5eb3f49171c --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/include/wallDissipationI.H @@ -0,0 +1,51 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Global + wallDissipation + +Description + Set wall dissipation in the epsilon matrix + +\*---------------------------------------------------------------------------*/ + +{ + const fvPatchList& patches = mesh_.boundary(); + + forAll(patches, patchi) + { + const fvPatch& p = patches[patchi]; + + if (isType<wallFvPatch>(p)) + { + epsEqn().setValues + ( + p.faceCells(), + epsilon_.boundaryField()[patchi].patchInternalField() + ); + } + } +} + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/include/wallFunctionsI.H b/src/turbulenceModels/compressible/RAS/include/wallFunctionsI.H new file mode 100644 index 00000000000..19aa023b1ce --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/include/wallFunctionsI.H @@ -0,0 +1,128 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Global + wallFunctions + +Description + Calculate wall dissipation from wall-functions. + +\*---------------------------------------------------------------------------*/ + +{ + labelList cellBoundaryFaceCount(epsilon_.size(), 0); + + scalar Cmu25 = pow(Cmu_.value(), 0.25); + scalar Cmu75 = pow(Cmu_.value(), 0.75); + + const fvPatchList& patches = mesh_.boundary(); + + //- Initialise the near-wall G field to zero + forAll(patches, patchi) + { + const fvPatch& curPatch = patches[patchi]; + + if (isType<wallFvPatch>(curPatch)) + { + forAll(curPatch, facei) + { + label faceCelli = curPatch.faceCells()[facei]; + + epsilon_[faceCelli] = 0.0; + G[faceCelli] = 0.0; + } + } + } + + //- Accumulate the wall face contributions to epsilon and G + // Increment cellBoundaryFaceCount for each face for averaging + forAll(patches, patchi) + { + const fvPatch& curPatch = patches[patchi]; + + if (isType<wallFvPatch>(curPatch)) + { +# include "checkPatchFieldTypes.H" + + const scalarField& rhow = rho_.boundaryField()[patchi]; + + const scalarField& muw = mu().boundaryField()[patchi]; + const scalarField& mutw = mut_.boundaryField()[patchi]; + + scalarField magFaceGradU = + mag(U_.boundaryField()[patchi].snGrad()); + + forAll(curPatch, facei) + { + label faceCelli = curPatch.faceCells()[facei]; + + scalar yPlus = + Cmu25*RASModel::y_[patchi][facei] + *sqrt(k_[faceCelli]) + /(muw[facei]/rhow[facei]); + + // For corner cells (with two boundary or more faces), + // epsilon and G in the near-wall cell are calculated + // as an average + + cellBoundaryFaceCount[faceCelli]++; + + epsilon_[faceCelli] += + Cmu75*pow(k_[faceCelli], 1.5) + /(kappa_.value()*RASModel::y_[patchi][facei]); + + if (yPlus > yPlusLam_) + { + G[faceCelli] += + (mutw[facei] + muw[facei]) + *magFaceGradU[facei] + *Cmu25*sqrt(k_[faceCelli]) + /(kappa_.value()*RASModel::y_[patchi][facei]); + } + } + } + } + + + // Perform the averaging + + forAll(patches, patchi) + { + const fvPatch& curPatch = patches[patchi]; + + if (isType<wallFvPatch>(curPatch)) + { + forAll(curPatch, facei) + { + label faceCelli = curPatch.faceCells()[facei]; + + epsilon_[faceCelli] /= cellBoundaryFaceCount[faceCelli]; + G[faceCelli] /= cellBoundaryFaceCount[faceCelli]; + } + } + } +} + + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/include/wallViscosityI.H b/src/turbulenceModels/compressible/RAS/include/wallViscosityI.H new file mode 100644 index 00000000000..38992cb5134 --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/include/wallViscosityI.H @@ -0,0 +1,73 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Global + wallViscosity + +Description + Calculate wall viscosity from wall-functions. + +\*---------------------------------------------------------------------------*/ + +{ + scalar Cmu25 = pow(Cmu_.value(), 0.25); + + const fvPatchList& patches = mesh_.boundary(); + + forAll(patches, patchi) + { + const fvPatch& curPatch = patches[patchi]; + + if (isType<wallFvPatch>(curPatch)) + { + const scalarField& rhow = rho_.boundaryField()[patchi]; + + const scalarField& muw = mu().boundaryField()[patchi]; + scalarField& mutw = mut_.boundaryField()[patchi]; + + forAll(curPatch, facei) + { + label faceCelli = curPatch.faceCells()[facei]; + + scalar yPlus = + Cmu25*RASModel::y_[patchi][facei] + *sqrt(k_[faceCelli])/(muw[facei]/rhow[facei]); + + if (yPlus > yPlusLam_) + { + mutw[facei] = + muw[facei] + *(yPlus*kappa_.value()/log(E_.value()*yPlus) - 1); + } + else + { + mutw[facei] = 0.0; + } + } + } + } +} + + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/kEpsilon/kEpsilon.C b/src/turbulenceModels/compressible/RAS/kEpsilon/kEpsilon.C new file mode 100644 index 00000000000..cb0fecc03dc --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/kEpsilon/kEpsilon.C @@ -0,0 +1,341 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "kEpsilon.H" +#include "addToRunTimeSelectionTable.H" +#include "wallFvPatch.H" + +#include "backwardsCompatibilityWallFunctions.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace RASModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(kEpsilon, 0); +addToRunTimeSelectionTable(RASModel, kEpsilon, dictionary); + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +kEpsilon::kEpsilon +( + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& phi, + basicThermo& thermophysicalModel +) +: + RASModel(typeName, rho, U, phi, thermophysicalModel), + + Cmu_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Cmu", + coeffDict_, + 0.09 + ) + ), + C1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "C1", + coeffDict_, + 1.44 + ) + ), + C2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "C2", + coeffDict_, + 1.92 + ) + ), + C3_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "C3", + coeffDict_, + -0.33 + ) + ), + alphak_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphak", + coeffDict_, + 1.0 + ) + ), + alphaEps_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphaEps", + coeffDict_, + 0.76923 + ) + ), + alphah_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphah", + coeffDict_, + 1.0 + ) + ), + + k_ + ( + IOobject + ( + "k", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + autoCreateK("k", mesh_) + ), + epsilon_ + ( + IOobject + ( + "epsilon", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + autoCreateEpsilon("epsilon", mesh_) + ), + mut_ + ( + IOobject + ( + "mut", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + autoCreateMut("mut", mesh_) + ), + alphat_ + ( + IOobject + ( + "alphat", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + autoCreateAlphat("alphat", mesh_) + ) +{ + mut_ == Cmu_*rho_*sqr(k_)/(epsilon_ + epsilonSmall_); + mut_.correctBoundaryConditions(); + + alphat_ == mut_/Prt_; + alphat_.correctBoundaryConditions(); + + printCoeffs(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +tmp<volSymmTensorField> kEpsilon::R() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + "R", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + ((2.0/3.0)*I)*k_ - (mut_/rho_)*dev(twoSymm(fvc::grad(U_))), + k_.boundaryField().types() + ) + ); +} + + +tmp<volSymmTensorField> kEpsilon::devRhoReff() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + "devRhoReff", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + -muEff()*dev(twoSymm(fvc::grad(U_))) + ) + ); +} + + +tmp<fvVectorMatrix> kEpsilon::divDevRhoReff(volVectorField& U) const +{ + return + ( + - fvm::laplacian(muEff(), U) + - fvc::div(muEff()*dev2(fvc::grad(U)().T())) + ); +} + + +bool kEpsilon::read() +{ + if (RASModel::read()) + { + Cmu_.readIfPresent(coeffDict_); + C1_.readIfPresent(coeffDict_); + C2_.readIfPresent(coeffDict_); + C3_.readIfPresent(coeffDict_); + alphak_.readIfPresent(coeffDict_); + alphaEps_.readIfPresent(coeffDict_); + alphah_.readIfPresent(coeffDict_); + + return true; + } + else + { + return false; + } +} + + +void kEpsilon::correct() +{ + if (!turbulence_) + { + // Re-calculate viscosity + mut_ == rho_*Cmu_*sqr(k_)/(epsilon_ + epsilonSmall_); + mut_.correctBoundaryConditions(); + + // Re-calculate thermal diffusivity + alphat_ = mut_/Prt_; + alphat_.correctBoundaryConditions(); + + return; + } + + RASModel::correct(); + + volScalarField divU = fvc::div(phi_/fvc::interpolate(rho_)); + + if (mesh_.moving()) + { + divU += fvc::div(mesh_.phi()); + } + + tmp<volTensorField> tgradU = fvc::grad(U_); + volScalarField G("G", mut_*(tgradU() && dev(twoSymm(tgradU())))); + tgradU.clear(); + + // Update espsilon and G at the wall + epsilon_.boundaryField().updateCoeffs(); + + // Dissipation equation + tmp<fvScalarMatrix> epsEqn + ( + fvm::ddt(rho_, epsilon_) + + fvm::div(phi_, epsilon_) + - fvm::laplacian(DepsilonEff(), epsilon_) + == + C1_*G*epsilon_/k_ + - fvm::SuSp(((2.0/3.0)*C1_ + C3_)*rho_*divU, epsilon_) + - fvm::Sp(C2_*rho_*epsilon_/k_, epsilon_) + ); + + epsEqn().relax(); + + epsEqn().boundaryManipulate(epsilon_.boundaryField()); + + solve(epsEqn); + bound(epsilon_, epsilon0_); + + + // Turbulent kinetic energy equation + + tmp<fvScalarMatrix> kEqn + ( + fvm::ddt(rho_, k_) + + fvm::div(phi_, k_) + - fvm::laplacian(DkEff(), k_) + == + G + - fvm::SuSp((2.0/3.0)*rho_*divU, k_) + - fvm::Sp(rho_*epsilon_/k_, k_) + ); + + kEqn().relax(); + solve(kEqn); + bound(k_, k0_); + + + // Re-calculate viscosity + mut_ == rho_*Cmu_*sqr(k_)/epsilon_; + mut_.correctBoundaryConditions(); + + // Re-calculate thermal diffusivity + alphat_ = mut_/Prt_; + alphat_.correctBoundaryConditions(); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace compressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/kEpsilon/kEpsilon.H b/src/turbulenceModels/compressible/RAS/kEpsilon/kEpsilon.H new file mode 100644 index 00000000000..76d952d40da --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/kEpsilon/kEpsilon.H @@ -0,0 +1,190 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::compressible::RASModels::kEpsilon + +Description + Standard k-epsilon turbulence model for compressible flows + + The default model coefficients correspond to the following: + @verbatim + kEpsilonCoeffs + { + Cmu 0.09; + C1 1.44; + C2 1.92; + C3 -0.33; // only for compressible + alphak 1.0; // only for compressible + alphaEps 0.76923; + alphah 1.0; // only for compressible + } + @endverbatim + +SourceFiles + kEpsilon.C + kEpsilonCorrect.C + +\*---------------------------------------------------------------------------*/ + +#ifndef compressiblekEpsilon_H +#define compressiblekEpsilon_H + +#include "RASModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class kEpsilon Declaration +\*---------------------------------------------------------------------------*/ + +class kEpsilon +: + public RASModel +{ + // Private data + + // Model coefficients + + dimensionedScalar Cmu_; + dimensionedScalar C1_; + dimensionedScalar C2_; + dimensionedScalar C3_; + dimensionedScalar alphak_; + dimensionedScalar alphaEps_; + dimensionedScalar alphah_; + + // Fields + + volScalarField k_; + volScalarField epsilon_; + volScalarField mut_; + volScalarField alphat_; + + +public: + + //- Runtime type information + TypeName("kEpsilon"); + + // Constructors + + //- from components + kEpsilon + ( + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& phi, + basicThermo& thermophysicalModel + ); + + + // Destructor + + ~kEpsilon() + {} + + + // Member Functions + + //- Return the turbulence viscosity + tmp<volScalarField> mut() const + { + return mut_; + } + + //- Return the effective diffusivity for k + tmp<volScalarField> DkEff() const + { + return tmp<volScalarField> + ( + new volScalarField("DkEff", alphak_*mut_ + mu()) + ); + } + + //- Return the effective diffusivity for epsilon + tmp<volScalarField> DepsilonEff() const + { + return tmp<volScalarField> + ( + new volScalarField("DepsilonEff", alphaEps_*mut_ + mu()) + ); + } + + //- Return the effective turbulent thermal diffusivity + tmp<volScalarField> alphaEff() const + { + return tmp<volScalarField> + ( + new volScalarField("alphaEff", alphah_*alphat_ + alpha()) + ); + } + + //- Return the turbulence kinetic energy + tmp<volScalarField> k() const + { + return k_; + } + + //- Return the turbulence kinetic energy dissipation rate + tmp<volScalarField> epsilon() const + { + return epsilon_; + } + + //- Return the Reynolds stress tensor + tmp<volSymmTensorField> R() const; + + //- Return the effective stress tensor including the laminar stress + tmp<volSymmTensorField> devRhoReff() const; + + //- Return the source term for the momentum equation + tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const; + + //- Solve the turbulence equations and correct the turbulence viscosity + void correct(); + + //- Read turbulenceProperties dictionary + bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace compressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.C b/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.C new file mode 100644 index 00000000000..1181169f879 --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.C @@ -0,0 +1,467 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "kOmegaSST.H" +#include "addToRunTimeSelectionTable.H" +#include "wallFvPatch.H" + +#include "backwardsCompatibilityWallFunctions.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace RASModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(kOmegaSST, 0); +addToRunTimeSelectionTable(RASModel, kOmegaSST, dictionary); + +// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // + +tmp<volScalarField> kOmegaSST::F1(const volScalarField& CDkOmega) const +{ + volScalarField CDkOmegaPlus = max + ( + CDkOmega, + dimensionedScalar("1.0e-10", dimless/sqr(dimTime), 1.0e-10) + ); + + volScalarField arg1 = min + ( + min + ( + max + ( + (scalar(1)/betaStar_)*sqrt(k_)/(omega_*y_), + scalar(500)*(mu()/rho_)/(sqr(y_)*omega_) + ), + (4*alphaOmega2_)*k_/(CDkOmegaPlus*sqr(y_)) + ), + scalar(10) + ); + + return tanh(pow4(arg1)); +} + +tmp<volScalarField> kOmegaSST::F2() const +{ + volScalarField arg2 = min + ( + max + ( + (scalar(2)/betaStar_)*sqrt(k_)/(omega_*y_), + scalar(500)*(mu()/rho_)/(sqr(y_)*omega_) + ), + scalar(100) + ); + + return tanh(sqr(arg2)); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +kOmegaSST::kOmegaSST +( + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& phi, + basicThermo& thermophysicalModel +) +: + RASModel(typeName, rho, U, phi, thermophysicalModel), + + alphaK1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphaK1", + coeffDict_, + 0.85034 + ) + ), + alphaK2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphaK2", + coeffDict_, + 1.0 + ) + ), + alphaOmega1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphaOmega1", + coeffDict_, + 0.5 + ) + ), + alphaOmega2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphaOmega2", + coeffDict_, + 0.85616 + ) + ), + alphah_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphah", + coeffDict_, + 1.0 + ) + ), + gamma1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "gamma1", + coeffDict_, + 0.5532 + ) + ), + gamma2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "gamma2", + coeffDict_, + 0.4403 + ) + ), + beta1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "beta1", + coeffDict_, + 0.075 + ) + ), + beta2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "beta2", + coeffDict_, + 0.0828 + ) + ), + betaStar_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "betaStar", + coeffDict_, + 0.09 + ) + ), + a1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "a1", + coeffDict_, + 0.31 + ) + ), + c1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "c1", + coeffDict_, + 10.0 + ) + ), + + omega0_("omega0", dimless/dimTime, SMALL), + omegaSmall_("omegaSmall", dimless/dimTime, SMALL), + + Cmu_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Cmu", + coeffDict_, + 0.09 + ) + ), + + y_(mesh_), + + k_ + ( + IOobject + ( + "k", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + autoCreateK("k", mesh_) + ), + omega_ + ( + IOobject + ( + "omega", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + autoCreateOmega("omega", mesh_) + ), + mut_ + ( + IOobject + ( + "mut", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + autoCreateMut("mut", mesh_) + ), + alphat_ + ( + IOobject + ( + "alphat", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + autoCreateAlphat("alphat", mesh_) + ) +{ + mut_ == a1_*rho_*k_/max(a1_*omega_, F2()*sqrt(magSqr(symm(fvc::grad(U_))))); + mut_.correctBoundaryConditions(); + + alphat_ == mut_/Prt_; + alphat_.correctBoundaryConditions(); + + printCoeffs(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +tmp<volSymmTensorField> kOmegaSST::R() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + "R", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + ((2.0/3.0)*I)*k_ - (mut_/rho_)*dev(twoSymm(fvc::grad(U_))), + k_.boundaryField().types() + ) + ); +} + + +tmp<volSymmTensorField> kOmegaSST::devRhoReff() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + "devRhoReff", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + -muEff()*dev(twoSymm(fvc::grad(U_))) + ) + ); +} + + +tmp<fvVectorMatrix> kOmegaSST::divDevRhoReff(volVectorField& U) const +{ + return + ( + - fvm::laplacian(muEff(), U) - fvc::div(muEff()*dev2(fvc::grad(U)().T())) + ); +} + + +bool kOmegaSST::read() +{ + if (RASModel::read()) + { + alphaK1_.readIfPresent(coeffDict_); + alphaK2_.readIfPresent(coeffDict_); + alphaOmega1_.readIfPresent(coeffDict_); + alphaOmega2_.readIfPresent(coeffDict_); + alphah_.readIfPresent(coeffDict_); + gamma1_.readIfPresent(coeffDict_); + gamma2_.readIfPresent(coeffDict_); + beta1_.readIfPresent(coeffDict_); + beta2_.readIfPresent(coeffDict_); + betaStar_.readIfPresent(coeffDict_); + a1_.readIfPresent(coeffDict_); + c1_.readIfPresent(coeffDict_); + Cmu_.readIfPresent(coeffDict_); + + return true; + } + else + { + return false; + } +} + + +void kOmegaSST::correct() +{ + if (!turbulence_) + { + // Re-calculate viscosity + mut_ == + a1_*rho_*k_ + /max(a1_*omega_, F2()*sqrt(magSqr(symm(fvc::grad(U_))))); + mut_.correctBoundaryConditions(); + + // Re-calculate thermal diffusivity + alphat_ = mut_/Prt_; + alphat_.correctBoundaryConditions(); + + return; + } + + RASModel::correct(); + + volScalarField divU = fvc::div(phi_/fvc::interpolate(rho_)); + + if (mesh_.changing()) + { + y_.correct(); + } + + if (mesh_.moving()) + { + divU += fvc::div(mesh_.phi()); + } + + tmp<volTensorField> tgradU = fvc::grad(U_); + volScalarField S2 = magSqr(symm(tgradU())); + volScalarField GbyMu = (tgradU() && dev(twoSymm(tgradU()))); + volScalarField G("G", mut_*GbyMu); + tgradU.clear(); + + // Update omega and G at the wall + omega_.boundaryField().updateCoeffs(); + + volScalarField CDkOmega = + (2*alphaOmega2_)*(fvc::grad(k_) & fvc::grad(omega_))/omega_; + + volScalarField F1 = this->F1(CDkOmega); + volScalarField rhoGammaF1 = rho_*gamma(F1); + + // Turbulent frequency equation + tmp<fvScalarMatrix> omegaEqn + ( + fvm::ddt(rho_, omega_) + + fvm::div(phi_, omega_) + - fvm::laplacian(DomegaEff(F1), omega_) + == + rhoGammaF1*GbyMu + - fvm::SuSp((2.0/3.0)*rhoGammaF1*divU, omega_) + - fvm::Sp(rho_*beta(F1)*omega_, omega_) + - fvm::SuSp + ( + rho_*(F1 - scalar(1))*CDkOmega/omega_, + omega_ + ) + ); + + omegaEqn().relax(); + + omegaEqn().boundaryManipulate(omega_.boundaryField()); + + solve(omegaEqn); + bound(omega_, omega0_); + + // Turbulent kinetic energy equation + tmp<fvScalarMatrix> kEqn + ( + fvm::ddt(rho_, k_) + + fvm::div(phi_, k_) + - fvm::laplacian(DkEff(F1), k_) + == + min(G, (c1_*betaStar_)*rho_*k_*omega_) + - fvm::SuSp(2.0/3.0*rho_*divU, k_) + - fvm::Sp(rho_*betaStar_*omega_, k_) + ); + + kEqn().relax(); + solve(kEqn); + bound(k_, k0_); + + + // Re-calculate viscosity + mut_ == a1_*rho_*k_/max(a1_*omega_, F2()*sqrt(S2)); + mut_.correctBoundaryConditions(); + + // Re-calculate thermal diffusivity + alphat_ = mut_/Prt_; + alphat_.correctBoundaryConditions(); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace compressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.H b/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.H new file mode 100644 index 00000000000..3f9c1486d3e --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.H @@ -0,0 +1,303 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::compressible::RASModels::kOmegaSST + +Description + Implementation of the k-omega-SST turbulence model for compressible flows. + + Turbulence model described in: + @verbatim + Menter, F., Esch, T. + "Elements of Industrial Heat Transfer Prediction" + 16th Brazilian Congress of Mechanical Engineering (COBEM), + Nov. 2001 + @endverbatim + + Note that this implementation is written in terms of alpha diffusion + coefficients rather than the more traditional sigma (alpha = 1/sigma) so + that the blending can be applied to all coefficuients in a consistent + manner. The paper suggests that sigma is blended but this would not be + consistent with the blending of the k-epsilon and k-omega models. + + Also note that the error in the last term of equation (2) relating to + sigma has been corrected. + + Wall-functions are applied in this implementation by using equations (14) + to specify the near-wall omega as appropriate. + + The blending functions (15) and (16) are not currently used because of the + uncertainty in their origin, range of applicability and that is y+ becomes + sufficiently small blending u_tau in this manner clearly becomes nonsense. + + The default model coefficients correspond to the following: + @verbatim + kOmegaSST + { + Cmu 0.09; + alphaK1 0.85034; + alphaK2 1.0; + alphaOmega1 0.5; + alphaOmega2 0.85616; + alphah 1.0; // only for compressible + beta1 0.075; + beta2 0.0828; + betaStar 0.09; + gamma1 0.5532; + gamma2 0.4403; + a1 0.31; + c1 10.0; + } + @endverbatim + +SourceFiles + kOmegaSST.C + kOmegaWallFunctionsI.H + kOmegaWallViscosityI.H + wallOmegaI.H + +\*---------------------------------------------------------------------------*/ + +#ifndef compressiblekOmegaSST_H +#define compressiblekOmegaSST_H + +#include "RASModel.H" +#include "wallDist.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class kOmega Declaration +\*---------------------------------------------------------------------------*/ + +class kOmegaSST +: + public RASModel +{ + // Private data + + dimensionedScalar alphaK1_; + dimensionedScalar alphaK2_; + + dimensionedScalar alphaOmega1_; + dimensionedScalar alphaOmega2_; + + dimensionedScalar alphah_; + + dimensionedScalar gamma1_; + dimensionedScalar gamma2_; + + dimensionedScalar beta1_; + dimensionedScalar beta2_; + + dimensionedScalar betaStar_; + + dimensionedScalar a1_; + dimensionedScalar c1_; + + dimensionedScalar omega0_; + dimensionedScalar omegaSmall_; + + dimensionedScalar Cmu_; + + wallDist y_; + + volScalarField k_; + volScalarField omega_; + volScalarField mut_; + volScalarField alphat_; + + + // Private member functions + + tmp<volScalarField> F1(const volScalarField& CDkOmega) const; + tmp<volScalarField> F2() const; + + tmp<volScalarField> blend + ( + const volScalarField& F1, + const dimensionedScalar& psi1, + const dimensionedScalar& psi2 + ) const + { + return F1*(psi1 - psi2) + psi2; + } + + tmp<volScalarField> alphaK + ( + const volScalarField& F1 + ) const + { + return blend(F1, alphaK1_, alphaK2_); + } + + tmp<volScalarField> alphaOmega + ( + const volScalarField& F1 + ) const + { + return blend(F1, alphaOmega1_, alphaOmega2_); + } + + tmp<volScalarField> beta + ( + const volScalarField& F1 + ) const + { + return blend(F1, beta1_, beta2_); + } + + tmp<volScalarField> gamma + ( + const volScalarField& F1 + ) const + { + return blend(F1, gamma1_, gamma2_); + } + + +public: + + //- Runtime type information + TypeName("kOmegaSST"); + + + // Constructors + + //- Construct from components + kOmegaSST + ( + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& phi, + basicThermo& thermophysicalModel + ); + + + // Destructor + + ~kOmegaSST() + {} + + + // Member Functions + + tmp<volScalarField> mut() const + { + return mut_; + } + + //- Return the effective diffusivity for k + tmp<volScalarField> DkEff(const volScalarField& F1) const + { + return tmp<volScalarField> + ( + new volScalarField("DkEff", alphaK(F1)*mut_ + mu()) + ); + } + + //- Return the effective diffusivity for omega + tmp<volScalarField> DomegaEff(const volScalarField& F1) const + { + return tmp<volScalarField> + ( + new volScalarField("DomegaEff", alphaOmega(F1)*mut_ + mu()) + ); + } + + //- Return the effective turbulent thermal diffusivity + tmp<volScalarField> alphaEff() const + { + return tmp<volScalarField> + ( + new volScalarField("alphaEff", alphah_*alphat_ + alpha()) + ); + } + + //- Return the turbulence kinetic energy + tmp<volScalarField> k() const + { + return k_; + } + + tmp<volScalarField> omega() const + { + return omega_; + } + + //- Return the turbulence kinetic energy dissipation rate + tmp<volScalarField> epsilon() const + { + return tmp<volScalarField> + ( + new volScalarField + ( + IOobject + ( + "epsilon", + mesh_.time().timeName(), + mesh_ + ), + betaStar_*k_*omega_, + omega_.boundaryField().types() + ) + ); + } + + //- Return the Reynolds stress tensor + tmp<volSymmTensorField> R() const; + + //- Return the effective stress tensor including the laminar stress + tmp<volSymmTensorField> devRhoReff() const; + + //- Return the source term for the momentum equation + tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const; + + //- Solve the turbulence equations and correct the turbulence viscosity + void correct(); + + //- Read turbulenceProperties dictionary + bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace compressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/laminar/laminar.C b/src/turbulenceModels/compressible/RAS/laminar/laminar.C new file mode 100644 index 00000000000..7a24cacc7ad --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/laminar/laminar.C @@ -0,0 +1,195 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "laminar.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace RASModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(laminar, 0); +addToRunTimeSelectionTable(RASModel, laminar, dictionary); + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +laminar::laminar +( + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& phi, + basicThermo& thermophysicalModel +) +: + RASModel(typeName, rho, U, phi, thermophysicalModel) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +tmp<volScalarField> laminar::mut() const +{ + return tmp<volScalarField> + ( + new volScalarField + ( + IOobject + ( + "mut", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensionedScalar("mut", mu().dimensions(), 0.0) + ) + ); +} + + +tmp<volScalarField> laminar::k() const +{ + return tmp<volScalarField> + ( + new volScalarField + ( + IOobject + ( + "k", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensionedScalar("k", sqr(U_.dimensions()), 0.0) + ) + ); +} + + +tmp<volScalarField> laminar::epsilon() const +{ + return tmp<volScalarField> + ( + new volScalarField + ( + IOobject + ( + "epsilon", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensionedScalar + ( + "epsilon", sqr(U_.dimensions())/dimTime, 0.0 + ) + ) + ); +} + + +tmp<volSymmTensorField> laminar::R() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + "R", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensionedSymmTensor + ( + "R", sqr(U_.dimensions()), symmTensor::zero + ) + ) + ); +} + + +tmp<volSymmTensorField> laminar::devRhoReff() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + "devRhoReff", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + -mu()*dev(twoSymm(fvc::grad(U_))) + ) + ); +} + + +tmp<fvVectorMatrix> laminar::divDevRhoReff(volVectorField& U) const +{ + return + ( + - fvm::laplacian(muEff(), U) - fvc::div(muEff()*dev2(fvc::grad(U)().T())) + ); +} + + +bool laminar::read() +{ + return RASModel::read(); +} + + +void laminar::correct() +{} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace compressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/laminar/laminar.H b/src/turbulenceModels/compressible/RAS/laminar/laminar.H new file mode 100644 index 00000000000..dda7f731179 --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/laminar/laminar.H @@ -0,0 +1,135 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::compressible::RASModels::laminar + +Description + Dummy turbulence model for laminar compressible flow. + +SourceFiles + laminar.C + laminarCorrect.C + +\*---------------------------------------------------------------------------*/ + +#ifndef compressibleLaminar_H +#define compressibleLaminar_H + +#include "RASModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class laminar Declaration +\*---------------------------------------------------------------------------*/ + +class laminar +: + public RASModel +{ + +public: + + //- Runtime type information + TypeName("laminar"); + + // Constructors + + //- from components + laminar + ( + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& phi, + basicThermo& thermophysicalModel + ); + + + // Destructor + + ~laminar() + {} + + + // Member Functions + + //- Return the turbulence viscosity, i.e. 0 for laminar flow + tmp<volScalarField> mut() const; + + //- Return the effective viscosity, i.e. the laminar viscosity + tmp<volScalarField> muEff() const + { + return tmp<volScalarField>(new volScalarField("muEff", mu())); + } + + //- Return the effective turbulent thermal diffusivity, + // i.e. the laminar thermal diffusivity + tmp<volScalarField> alphaEff() const + { + return tmp<volScalarField>(new volScalarField("alphaEff", alpha())); + } + + //- Return the turbulence kinetic energy, i.e. 0 for laminar flow + tmp<volScalarField> k() const; + + //- Return the turbulence kinetic energy dissipation rate, + // i.e. 0 for laminar flow + tmp<volScalarField> epsilon() const; + + //- Return the Reynolds stress tensor, i.e. 0 for laminar flow + tmp<volSymmTensorField> R() const; + + //- Return the effective stress tensor, i.e. the laminar stress + tmp<volSymmTensorField> devRhoReff() const; + + //- Return the source term for the momentum equation + tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const; + + //- Correct the laminar viscosity + void correct(); + + //- Read turbulenceProperties dictionary + bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace compressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/realizableKE/realizableKE.C b/src/turbulenceModels/compressible/RAS/realizableKE/realizableKE.C new file mode 100644 index 00000000000..1e762433f3e --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/realizableKE/realizableKE.C @@ -0,0 +1,380 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "realizableKE.H" +#include "addToRunTimeSelectionTable.H" +#include "wallFvPatch.H" + +#include "backwardsCompatibilityWallFunctions.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace RASModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(realizableKE, 0); +addToRunTimeSelectionTable(RASModel, realizableKE, dictionary); + +// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // + +tmp<volScalarField> realizableKE::rCmu +( + const volTensorField& gradU, + const volScalarField& S2, + const volScalarField& magS +) +{ + tmp<volSymmTensorField> tS = dev(symm(gradU)); + const volSymmTensorField& S = tS(); + + volScalarField W = + (2*sqrt(2.0))*((S&S)&&S) + /( + magS*S2 + + dimensionedScalar("small", dimensionSet(0, 0, -3, 0, 0), SMALL) + ); + + tS.clear(); + + volScalarField phis = + (1.0/3.0)*acos(min(max(sqrt(6.0)*W, -scalar(1)), scalar(1))); + volScalarField As = sqrt(6.0)*cos(phis); + volScalarField Us = sqrt(S2/2.0 + magSqr(skew(gradU))); + + return 1.0/(A0_ + As*Us*k_/(epsilon_ + epsilonSmall_)); +} + + +tmp<volScalarField> realizableKE::rCmu +( + const volTensorField& gradU +) +{ + volScalarField S2 = 2*magSqr(dev(symm(gradU))); + volScalarField magS = sqrt(S2); + return rCmu(gradU, S2, magS); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +realizableKE::realizableKE +( + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& phi, + basicThermo& thermophysicalModel +) +: + RASModel(typeName, rho, U, phi, thermophysicalModel), + + Cmu_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Cmu", + coeffDict_, + 0.09 + ) + ), + A0_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "A0", + coeffDict_, + 4.0 + ) + ), + C2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "C2", + coeffDict_, + 1.9 + ) + ), + alphak_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphak", + coeffDict_, + 1.0 + ) + ), + alphaEps_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphaEps", + coeffDict_, + 0.833333 + ) + ), + alphah_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphah", + coeffDict_, + 1.0 + ) + ), + + k_ + ( + IOobject + ( + "k", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + autoCreateK("k", mesh_) + ), + epsilon_ + ( + IOobject + ( + "epsilon", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + autoCreateEpsilon("epsilon", mesh_) + ), + mut_ + ( + IOobject + ( + "mut", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + autoCreateMut("mut", mesh_) + ), + alphat_ + ( + IOobject + ( + "alphat", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + autoCreateAlphat("alphat", mesh_) + ) +{ + bound(k_, k0_); + bound(epsilon_, epsilon0_); + + mut_ == rCmu(fvc::grad(U_))*rho_*sqr(k_)/(epsilon_ + epsilonSmall_); + mut_.correctBoundaryConditions(); + + alphat_ == mut_/Prt_; + alphat_.correctBoundaryConditions(); + + printCoeffs(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +tmp<volSymmTensorField> realizableKE::R() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + "R", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + ((2.0/3.0)*I)*k_ - (mut_/rho_)*dev(twoSymm(fvc::grad(U_))), + k_.boundaryField().types() + ) + ); +} + + +tmp<volSymmTensorField> realizableKE::devRhoReff() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + "devRhoReff", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + -muEff()*dev(twoSymm(fvc::grad(U_))) + ) + ); +} + + +tmp<fvVectorMatrix> realizableKE::divDevRhoReff(volVectorField& U) const +{ + return + ( + - fvm::laplacian(muEff(), U) - fvc::div(muEff()*dev2(fvc::grad(U)().T())) + ); +} + + +bool realizableKE::read() +{ + if (RASModel::read()) + { + Cmu_.readIfPresent(coeffDict_); + A0_.readIfPresent(coeffDict_); + C2_.readIfPresent(coeffDict_); + alphak_.readIfPresent(coeffDict_); + alphaEps_.readIfPresent(coeffDict_); + alphah_.readIfPresent(coeffDict_); + + return true; + } + else + { + return false; + } +} + + +void realizableKE::correct() +{ + if (!turbulence_) + { + // Re-calculate viscosity + mut_ == rCmu(fvc::grad(U_))*rho_*sqr(k_)/epsilon_; + mut_.correctBoundaryConditions(); + + // Re-calculate thermal diffusivity + alphat_ = mut_/Prt_; + alphat_.correctBoundaryConditions(); + + return; + } + + RASModel::correct(); + + volScalarField divU = fvc::div(phi_/fvc::interpolate(rho_)); + + if (mesh_.moving()) + { + divU += fvc::div(mesh_.phi()); + } + + volTensorField gradU = fvc::grad(U_); + volScalarField S2 = 2*magSqr(dev(symm(gradU))); + volScalarField magS = sqrt(S2); + + volScalarField eta = magS*k_/epsilon_; + volScalarField C1 = max(eta/(scalar(5) + eta), scalar(0.43)); + + volScalarField G("G", mut_*(gradU && dev(twoSymm(gradU)))); + + // Update espsilon and G at the wall + epsilon_.boundaryField().updateCoeffs(); + + // Dissipation equation + tmp<fvScalarMatrix> epsEqn + ( + fvm::ddt(rho_, epsilon_) + + fvm::div(phi_, epsilon_) + - fvm::laplacian(DepsilonEff(), epsilon_) + == + C1*rho_*magS*epsilon_ + - fvm::Sp + ( + C2_*rho_*epsilon_/(k_ + sqrt((mu()/rho_)*epsilon_)), + epsilon_ + ) + ); + + epsEqn().relax(); + + epsEqn().boundaryManipulate(epsilon_.boundaryField()); + + solve(epsEqn); + bound(epsilon_, epsilon0_); + + + // Turbulent kinetic energy equation + + tmp<fvScalarMatrix> kEqn + ( + fvm::ddt(rho_, k_) + + fvm::div(phi_, k_) + - fvm::laplacian(DkEff(), k_) + == + G - fvm::SuSp(2.0/3.0*rho_*divU, k_) + - fvm::Sp(rho_*(epsilon_)/k_, k_) + ); + + kEqn().relax(); + solve(kEqn); + bound(k_, k0_); + + // Re-calculate viscosity + mut_ == rCmu(gradU, S2, magS)*rho_*sqr(k_)/epsilon_; + mut_.correctBoundaryConditions(); + + // Re-calculate thermal diffusivity + alphat_ = mut_/Prt_; + alphat_.correctBoundaryConditions(); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace compressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/realizableKE/realizableKE.H b/src/turbulenceModels/compressible/RAS/realizableKE/realizableKE.H new file mode 100644 index 00000000000..f997efdd5f8 --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/realizableKE/realizableKE.H @@ -0,0 +1,204 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::compressible::RASModels::realizableKE + +Description + Realizable k-epsilon turbulence model for compressible flows. + + Model described in the paper: + @verbatim + "A New k-epsilon Eddy Viscosity Model for High Reynolds Number + Turbulent Flows" + + Tsan-Hsing Shih, William W. Liou, Aamir Shabbir, Zhigang Tang and + Jiang Zhu + + Computers and Fluids Vol. 24, No. 3, pp. 227-238, 1995 + @endverbatim + + The default model coefficients correspond to the following: + @verbatim + realizableKE + { + Cmu 0.09; + A0 4.0; + C2 1.9; + alphak 1.0; + alphaEps 0.833333; + alphah 1.0; // only for compressible + } + @endverbatim + +SourceFiles + realizableKE.C + +\*---------------------------------------------------------------------------*/ + +#ifndef realizableKE_H +#define realizableKE_H + +#include "RASModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class realizableKE Declaration +\*---------------------------------------------------------------------------*/ + +class realizableKE +: + public RASModel +{ + // Private data + + dimensionedScalar Cmu_; + dimensionedScalar A0_; + dimensionedScalar C2_; + dimensionedScalar alphak_; + dimensionedScalar alphaEps_; + dimensionedScalar alphah_; + + volScalarField k_; + volScalarField epsilon_; + volScalarField mut_; + volScalarField alphat_; + + tmp<volScalarField> rCmu + ( + const volTensorField& gradU, + const volScalarField& S2, + const volScalarField& magS + ); + + tmp<volScalarField> rCmu + ( + const volTensorField& gradU + ); + +public: + + //- Runtime type information + TypeName("realizableKE"); + + // Constructors + + //- from components + realizableKE + ( + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& phi, + basicThermo& thermophysicalModel + ); + + + // Destructor + + ~realizableKE(){} + + + // Member Functions + + //- Return the turbulence viscosity + tmp<volScalarField> mut() const + { + return mut_; + } + + //- Return the effective diffusivity for k + tmp<volScalarField> DkEff() const + { + return tmp<volScalarField> + ( + new volScalarField("DkEff", alphak_*mut_ + mu()) + ); + } + + //- Return the effective diffusivity for epsilon + tmp<volScalarField> DepsilonEff() const + { + return tmp<volScalarField> + ( + new volScalarField("DepsilonEff", alphaEps_*mut_ + mu()) + ); + } + + //- Return the effective turbulent thermal diffusivity + tmp<volScalarField> alphaEff() const + { + return tmp<volScalarField> + ( + new volScalarField("alphaEff", alphah_*alphat_ + alpha()) + ); + } + + //- Return the turbulence kinetic energy + tmp<volScalarField> k() const + { + return k_; + } + + //- Return the turbulence kinetic energy dissipation rate + tmp<volScalarField> epsilon() const + { + return epsilon_; + } + + //- Return the Reynolds stress tensor + tmp<volSymmTensorField> R() const; + + //- Return the effective stress tensor including the laminar stress + tmp<volSymmTensorField> devRhoReff() const; + + //- Return the source term for the momentum equation + tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const; + + //- Solve the turbulence equations and correct the turbulence viscosity + void correct(); + + //- Read turbulenceProperties dictionary + bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace compressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/Allwmake b/src/turbulenceModels/incompressible/Allwmake new file mode 100755 index 00000000000..ddff4170182 --- /dev/null +++ b/src/turbulenceModels/incompressible/Allwmake @@ -0,0 +1,9 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory +set -x + +wmake libso turbulenceModel +wmake libso RAS +wmake libso LES + +# ----------------------------------------------------------------- end-of-file diff --git a/src/turbulenceModels/incompressible/LES/DeardorffDiffStress/DeardorffDiffStress.C b/src/turbulenceModels/incompressible/LES/DeardorffDiffStress/DeardorffDiffStress.C new file mode 100644 index 00000000000..aa7e5b7cc62 --- /dev/null +++ b/src/turbulenceModels/incompressible/LES/DeardorffDiffStress/DeardorffDiffStress.C @@ -0,0 +1,151 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "DeardorffDiffStress.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace LESModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(DeardorffDiffStress, 0); +addToRunTimeSelectionTable(LESModel, DeardorffDiffStress, dictionary); + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +DeardorffDiffStress::DeardorffDiffStress +( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport +) +: + LESModel(typeName, U, phi, transport), + GenSGSStress(U, phi, transport), + + ck_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "ck", + coeffDict(), + 0.094 + ) + ), + cm_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "cm", + coeffDict(), + 4.13 + ) + ) +{ + printCoeffs(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void DeardorffDiffStress::correct(const tmp<volTensorField>& tgradU) +{ + const volTensorField& gradU = tgradU(); + + GenSGSStress::correct(gradU); + + volSymmTensorField D = symm(gradU); + + volSymmTensorField P = -twoSymm(B_ & gradU); + + volScalarField K = 0.5*tr(B_); + volScalarField Epsilon = 2*nuEff()*magSqr(D); + + fvSymmTensorMatrix BEqn + ( + fvm::ddt(B_) + + fvm::div(phi(), B_) + - fvm::laplacian(DBEff(), B_) + + fvm::Sp(cm_*sqrt(K)/delta(), B_) + == + P + + 0.8*K*D + - (2*ce_ - 0.667*cm_)*I*Epsilon + ); + + BEqn.relax(); + BEqn.solve(); + + // Bounding the component kinetic energies + + forAll(B_, celli) + { + B_[celli].component(symmTensor::XX) = + max(B_[celli].component(symmTensor::XX), k0().value()); + B_[celli].component(symmTensor::YY) = + max(B_[celli].component(symmTensor::YY), k0().value()); + B_[celli].component(symmTensor::ZZ) = + max(B_[celli].component(symmTensor::ZZ), k0().value()); + } + + K = 0.5*tr(B_); + bound(K, k0()); + + nuSgs_ = ck_*sqrt(K)*delta(); + nuSgs_.correctBoundaryConditions(); +} + + +bool DeardorffDiffStress::read() +{ + if (GenSGSStress::read()) + { + ck_.readIfPresent(coeffDict()); + cm_.readIfPresent(coeffDict()); + + return true; + } + else + { + return false; + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/LES/DeardorffDiffStress/DeardorffDiffStress.H b/src/turbulenceModels/incompressible/LES/DeardorffDiffStress/DeardorffDiffStress.H new file mode 100644 index 00000000000..713189bbdd6 --- /dev/null +++ b/src/turbulenceModels/incompressible/LES/DeardorffDiffStress/DeardorffDiffStress.H @@ -0,0 +1,139 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::incompressible::LESModels::DeardorffDiffStress + +Description + Differential SGS Stress Equation Model for incompressible flows + + The DSEM uses a model version of the full balance equation for the SGS + stress tensor to simulate the behaviour of B. + Thus, + @verbatim + d/dt(B) + div(U*B) - div(nuSgs*grad(B)) + = + P - c1*epsilon/k*B - 0.667*(1 - c1)*epsilon*I - c2*(P - 0.333*trP*I) + + where + + k = 0.5*tr(B), + epsilon = ce*k^3/2/delta, + epsilon/k = ce*k^1/2/delta + P = -(B'L + L'B) + nuSgs = ck*sqrt(k)*delta + nuEff = nuSgs + nu + @endverbatim + +SourceFiles + DeardorffDiffStress.C + +\*---------------------------------------------------------------------------*/ + +#ifndef DeardorffDiffStress_H +#define DeardorffDiffStress_H + +#include "GenSGSStress.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace LESModels +{ + +/*---------------------------------------------------------------------------*\ + Class DeardorffDiffStress Declaration +\*---------------------------------------------------------------------------*/ + +class DeardorffDiffStress +: + public GenSGSStress +{ + // Private data + + dimensionedScalar ck_; + dimensionedScalar cm_; + + + // Private Member Functions + + // Disallow default bitwise copy construct and assignment + DeardorffDiffStress(const DeardorffDiffStress&); + DeardorffDiffStress& operator=(const DeardorffDiffStress&); + + +public: + + //- Runtime type information + TypeName("DeardorffDiffStress"); + + // Constructors + + //- Construct from components + DeardorffDiffStress + ( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport + ); + + + //- Destructor + virtual ~DeardorffDiffStress() + {} + + + // Member Functions + + //- Return the effective diffusivity for B + tmp<volScalarField> DBEff() const + { + return tmp<volScalarField> + ( + new volScalarField("DBEff", nuSgs_ + nu()) + ); + } + + //- Correct Eddy-Viscosity and related properties + virtual void correct(const tmp<volTensorField>& gradU); + + //- Read turbulenceProperties dictionary + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/LES/GenEddyVisc/GenEddyVisc.C b/src/turbulenceModels/incompressible/LES/GenEddyVisc/GenEddyVisc.C new file mode 100644 index 00000000000..7cf9d6a2f37 --- /dev/null +++ b/src/turbulenceModels/incompressible/LES/GenEddyVisc/GenEddyVisc.C @@ -0,0 +1,126 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "GenEddyVisc.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace LESModels +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +GenEddyVisc::GenEddyVisc +( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport +) +: + LESModel(word("GenEddyVisc"), U, phi, transport), + + ce_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "ce", + coeffDict(), + 1.048 + ) + ), + + nuSgs_ + ( + IOobject + ( + "nuSgs", + runTime_.timeName(), + mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh_ + ) +{ +// printCoeffs(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +tmp<volSymmTensorField> GenEddyVisc::B() const +{ + return ((2.0/3.0)*I)*k() - nuSgs_*twoSymm(fvc::grad(U())); +} + + +tmp<volSymmTensorField> GenEddyVisc::devBeff() const +{ + return -nuEff()*dev(twoSymm(fvc::grad(U()))); +} + + +tmp<fvVectorMatrix> GenEddyVisc::divDevBeff(volVectorField& U) const +{ + return + ( + - fvm::laplacian(nuEff(), U) - fvc::div(nuEff()*dev(fvc::grad(U)().T())) + ); +} + + +void GenEddyVisc::correct(const tmp<volTensorField>& gradU) +{ + LESModel::correct(gradU); +} + + +bool GenEddyVisc::read() +{ + if (LESModel::read()) + { + ce_.readIfPresent(coeffDict()); + + return true; + } + else + { + return false; + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/LES/GenEddyVisc/GenEddyVisc.H b/src/turbulenceModels/incompressible/LES/GenEddyVisc/GenEddyVisc.H new file mode 100644 index 00000000000..5c16c961473 --- /dev/null +++ b/src/turbulenceModels/incompressible/LES/GenEddyVisc/GenEddyVisc.H @@ -0,0 +1,140 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::incompressible::LESModels::GenEddyVisc + +Description + General base class for all incompressible models that can be implemented + as an eddy viscosity, i.e. algebraic and one-equation models. + + Contains fields for k (SGS turbulent kinetic energy), gamma + (modelled viscosity) and epsilon (SGS dissipation). + +SourceFiles + GenEddyVisc.C + +\*---------------------------------------------------------------------------*/ + +#ifndef GenEddyVisc_H +#define GenEddyVisc_H + +#include "LESModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace LESModels +{ + +/*---------------------------------------------------------------------------*\ + Class GenEddyVisc Declaration +\*---------------------------------------------------------------------------*/ + +class GenEddyVisc +: + virtual public LESModel +{ + // Private Member Functions + + // Disallow default bitwise copy construct and assignment + GenEddyVisc(const GenEddyVisc&); + GenEddyVisc& operator=(const GenEddyVisc&); + + +protected: + + dimensionedScalar ce_; + + volScalarField nuSgs_; + + +public: + + // Constructors + + //- Construct from components + GenEddyVisc + ( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport + ); + + + //- Destructor + virtual ~GenEddyVisc() + {} + + + // Member Functions + + //- Return SGS kinetic energy + virtual tmp<volScalarField> k() const = 0; + + //- Return sub-grid disipation rate + virtual tmp<volScalarField> epsilon() const + { + return ce_*k()*sqrt(k())/delta(); + } + + //- Return the SGS viscosity. + virtual tmp<volScalarField> nuSgs() const + { + return nuSgs_; + } + + //- Return the sub-grid stress tensor. + virtual tmp<volSymmTensorField> B() const; + + //- Return the effective sub-grid turbulence stress tensor + // including the laminar stress + virtual tmp<volSymmTensorField> devBeff() const; + + //- Return the deviatoric part of the effective sub-grid + // turbulence stress tensor including the laminar stress + virtual tmp<fvVectorMatrix> divDevBeff(volVectorField& U) const; + + //- Correct Eddy-Viscosity and related properties + virtual void correct(const tmp<volTensorField>& gradU); + + //- Read turbulenceProperties dictionary + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/LES/GenSGSStress/GenSGSStress.C b/src/turbulenceModels/incompressible/LES/GenSGSStress/GenSGSStress.C new file mode 100644 index 00000000000..469bb17b43e --- /dev/null +++ b/src/turbulenceModels/incompressible/LES/GenSGSStress/GenSGSStress.C @@ -0,0 +1,192 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "GenSGSStress.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace LESModels +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +GenSGSStress::GenSGSStress +( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport +) +: + LESModel(word("GenSGSStress"), U, phi, transport), + + ce_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "ce", + coeffDict(), + 1.048 + ) + ), + + couplingFactor_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "couplingFactor", + coeffDict(), + 0.0 + ) + ), + + B_ + ( + IOobject + ( + "B", + runTime_.timeName(), + mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh_ + ), + + nuSgs_ + ( + IOobject + ( + "nuSgs", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + nu(), + B_.boundaryField().types() + ) +{ + if (couplingFactor_.value() < 0.0 || couplingFactor_.value() > 1.0) + { + FatalErrorIn + ( + "GenSGSStress::GenSGSStress" + "(const volVectorField& U, const surfaceScalarField& phi," + "transportModel& lamTransportModel)" + ) << "couplingFactor = " << couplingFactor_ + << " is not in range 0 - 1" << nl + << exit(FatalError); + } +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +tmp<volSymmTensorField> GenSGSStress::devBeff() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + "devRhoReff", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + B_ - nu()*dev(twoSymm(fvc::grad(U()))) + ) + ); +} + + +tmp<fvVectorMatrix> GenSGSStress::divDevBeff +( + volVectorField& U +) const +{ + if (couplingFactor_.value() > 0.0) + { + return + ( + fvc::div(B_ + couplingFactor_*nuSgs_*fvc::grad(U)) + + fvc::laplacian + ( + (1.0 - couplingFactor_)*nuSgs_, U, "laplacian(nuEff,U)" + ) + - fvm::laplacian(nuEff(), U) + ); + } + else + { + return + ( + fvc::div(B_) + + fvc::laplacian(nuSgs_, U, "laplacian(nuEff,U)") + - fvm::laplacian(nuEff(), U) + ); + } +} + + +bool GenSGSStress::read() +{ + if (LESModel::read()) + { + ce_.readIfPresent(coeffDict()); + + couplingFactor_.readIfPresent(coeffDict()); + + if (couplingFactor_.value() < 0.0 || couplingFactor_.value() > 1.0) + { + FatalErrorIn("GenSGSStress::read()") + << "couplingFactor = " << couplingFactor_ + << " is not in range 0 - 1" + << exit(FatalError); + } + + return true; + } + else + { + return false; + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/LES/GenSGSStress/GenSGSStress.H b/src/turbulenceModels/incompressible/LES/GenSGSStress/GenSGSStress.H new file mode 100644 index 00000000000..38073d08b62 --- /dev/null +++ b/src/turbulenceModels/incompressible/LES/GenSGSStress/GenSGSStress.H @@ -0,0 +1,148 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::incompressible::LESModels::GenSGSStress + +Description + General base class for all incompressible models that directly + solve for the SGS stress tensor B. + + Contains tensor fields B (the SGS stress tensor) as well as scalar + fields for k (SGS turbulent energy) gamma (SGS viscosity) and epsilon + (SGS dissipation). + +SourceFiles + GenSGSStress.C + +\*---------------------------------------------------------------------------*/ + +#ifndef GenSGSStress_H +#define GenSGSStress_H + +#include "LESModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace LESModels +{ + +/*---------------------------------------------------------------------------*\ + Class GenSGSStress Declaration +\*---------------------------------------------------------------------------*/ + +class GenSGSStress +: + virtual public LESModel +{ + // Private Member Functions + + // Disallow default bitwise copy construct and assignment + GenSGSStress(const GenSGSStress&); + GenSGSStress& operator=(const GenSGSStress&); + + +protected: + + dimensionedScalar ce_; + + dimensionedScalar couplingFactor_; + + volSymmTensorField B_; + volScalarField nuSgs_; + + +public: + + // Constructors + + //- Construct from components + GenSGSStress + ( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport + ); + + + //- Destructor + virtual ~GenSGSStress() + {} + + + // Member Functions + + //- Return the SGS turbulent kinetic energy. + virtual tmp<volScalarField> k() const + { + return 0.5*tr(B_); + } + + //- Return the SGS turbulent dissipation. + virtual tmp<volScalarField> epsilon() const + { + volScalarField K = k(); + return ce_*K*sqrt(K)/delta(); + } + + //- Return the SGS viscosity. + virtual tmp<volScalarField> nuSgs() const + { + return nuSgs_; + } + + //- Return the sub-grid stress tensor. + virtual tmp<volSymmTensorField> B() const + { + return B_; + } + + //- Return the effective sub-grid turbulence stress tensor + // including the laminar stress + virtual tmp<volSymmTensorField> devBeff() const; + + //- Returns div(B). + // This is the additional term due to the filtering of the NSE. + virtual tmp<fvVectorMatrix> divDevBeff(volVectorField& U) const; + + //- Read turbulenceProperties dictionary + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/LES/LESModel/LESModel.C b/src/turbulenceModels/incompressible/LES/LESModel/LESModel.C new file mode 100644 index 00000000000..e55a55b47ed --- /dev/null +++ b/src/turbulenceModels/incompressible/LES/LESModel/LESModel.C @@ -0,0 +1,186 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "LESModel.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(LESModel, 0); +defineRunTimeSelectionTable(LESModel, dictionary); +addToRunTimeSelectionTable(turbulenceModel, LESModel, turbulenceModel); + +// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * // + +void LESModel::printCoeffs() +{ + if (printCoeffs_) + { + Info<< type() << "Coeffs" << coeffDict_ << endl; + } +} + + +// * * * * * * * * * * * * * * * Constructor * * * * * * * * * * * * * * * * // + +LESModel::LESModel +( + const word& type, + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& lamTransportModel +) +: + turbulenceModel(U, phi, lamTransportModel), + + IOdictionary + ( + IOobject + ( + "LESProperties", + U.time().constant(), + U.db(), + IOobject::MUST_READ, + IOobject::NO_WRITE + ) + ), + + turbulence_(lookup("turbulence")), + printCoeffs_(lookupOrDefault<Switch>("printCoeffs", false)), + coeffDict_(subDict(type + "Coeffs")), + + k0_("k0", dimVelocity*dimVelocity, SMALL), + delta_(LESdelta::New("delta", U.mesh(), *this)) +{ + readIfPresent("k0", k0_); +} + + +// * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * // + +autoPtr<LESModel> LESModel::New +( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport +) +{ + word LESModelTypeName; + + // Enclose the creation of the turbulencePropertiesDict to ensure it is + // deleted before the turbulenceModel is created otherwise the dictionary + // is entered in the database twice + { + IOdictionary turbulencePropertiesDict + ( + IOobject + ( + "LESProperties", + U.time().constant(), + U.db(), + IOobject::MUST_READ, + IOobject::NO_WRITE + ) + ); + + turbulencePropertiesDict.lookup("LESModel") >> LESModelTypeName; + } + + Info<< "Selecting LES turbulence model " << LESModelTypeName << endl; + + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(LESModelTypeName); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalErrorIn + ( + "LESModel::select(const volVectorField&, const " + "surfaceScalarField&, transportModel&)" + ) << "Unknown LESModel type " << LESModelTypeName + << endl << endl + << "Valid LESModel types are :" << endl + << dictionaryConstructorTablePtr_->toc() + << exit(FatalError); + } + + return autoPtr<LESModel>(cstrIter()(U, phi, transport)); +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +LESModel::~LESModel() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void LESModel::correct(const tmp<volTensorField>&) +{ + turbulenceModel::correct(); + delta_().correct(); +} + + +void LESModel::correct() +{ + correct(fvc::grad(U_)); +} + + +bool LESModel::read() +{ + if (regIOobject::read()) + { + coeffDict_ = subDict(type() + "Coeffs"); + + delta_().read(*this); + + readIfPresent("k0", k0_); + + return true; + } + else + { + return false; + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/LES/LESModel/LESModel.H b/src/turbulenceModels/incompressible/LES/LESModel/LESModel.H new file mode 100644 index 00000000000..776328d3a22 --- /dev/null +++ b/src/turbulenceModels/incompressible/LES/LESModel/LESModel.H @@ -0,0 +1,277 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Namespace + Foam::incompressible::LESModels + +Description + Namespace for incompressible LES models. + +Class + Foam::incompressible::LESModel + +Description + Base class for all incompressible flow LES SGS models. + + This class defines the basic interface for an incompressible flow SGS + model, and encapsulates data of value to all possible models. In + particular this includes references to all the dependent fields (U, + phi), the physical viscosity nu, and the turbulenceProperties + dictionary which contains the model selection and model coefficients. + +SourceFiles + LESModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef LESModel_H +#define LESModel_H + +#include "turbulenceModel.H" +#include "LESdelta.H" +#include "fvm.H" +#include "fvc.H" +#include "fvMatrices.H" +#include "incompressible/transportModel/transportModel.H" +#include "wallFvPatch.H" +#include "bound.H" +#include "autoPtr.H" +#include "runTimeSelectionTables.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ + +/*---------------------------------------------------------------------------*\ + Class LESModel Declaration +\*---------------------------------------------------------------------------*/ + +class LESModel +: + public turbulenceModel, + public IOdictionary +{ + +protected: + + // Protected data + + Switch turbulence_; + Switch printCoeffs_; + dictionary coeffDict_; + + dimensionedScalar k0_; + + autoPtr<LESdelta> delta_; + + + // Protected member functions + + //- Print model coefficients + virtual void printCoeffs(); + + +private: + + // Private Member Functions + + //- Disallow default bitwise copy construct + LESModel(const LESModel&); + + //- Disallow default bitwise assignment + LESModel& operator=(const LESModel&); + + +public: + + //- Runtime type information + TypeName("LESModel"); + + + // Declare run-time constructor selection table + + declareRunTimeSelectionTable + ( + autoPtr, + LESModel, + dictionary, + ( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& lamTransportModel + ), + (U, phi, lamTransportModel) + ); + + + // Constructors + + //- Construct from components + LESModel + ( + const word& type, + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& lamTransportModel + ); + + + // Selectors + + //- Return a reference to the selected LES model + static autoPtr<LESModel> New + ( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& lamTransportModel + ); + + + //- Destructor + virtual ~LESModel(); + + + // Member Functions + + //- Access function to velocity field + inline const volVectorField& U() const + { + return U_; + } + + //- Access function to flux field + inline const surfaceScalarField& phi() const + { + return phi_; + } + + //- Access the dictionary which provides info. about choice of + // models, and all related data (particularly model coefficients). + inline dictionary& coeffDict() + { + return coeffDict_; + } + + //- Access function to filter width + inline const volScalarField& delta() const + { + return delta_(); + } + + //- Return the value of k0 which k is not allowed to be less than + const dimensionedScalar& k0() const + { + return k0_; + } + + //- Allow k0 to be changed + dimensionedScalar& k0() + { + return k0_; + } + + + //- Return the SGS turbulent kinetic energy. + virtual tmp<volScalarField> k() const = 0; + + //- Return the SGS turbulent dissipation. + virtual tmp<volScalarField> epsilon() const = 0; + + //- Return the SGS viscosity. + virtual tmp<volScalarField> nuSgs() const = 0; + + //- Return the effective viscosity + virtual tmp<volScalarField> nuEff() const + { + return tmp<volScalarField> + ( + new volScalarField("nuEff", nuSgs() + nu()) + ); + } + + //- Return the sub-grid stress tensor. + virtual tmp<volSymmTensorField> B() const = 0; + + //- Return the deviatoric part of the effective sub-grid + // turbulence stress tensor including the laminar stress + virtual tmp<volSymmTensorField> devBeff() const = 0; + + //- Returns div(dev(Beff)). + // This is the additional term due to the filtering of the NSE. + virtual tmp<fvVectorMatrix> divDevBeff(volVectorField& U) const = 0; + + + // RAS compatibility functions for the turbulenceModel base class + + //- Return the turbulence viscosity + virtual tmp<volScalarField> nut() const + { + return nuSgs(); + } + + //- Return the Reynolds stress tensor + virtual tmp<volSymmTensorField> R() const + { + return B(); + } + + //- Return the effective stress tensor including the laminar stress + virtual tmp<volSymmTensorField> devReff() const + { + return devBeff(); + } + + //- Return the source term for the momentum equation + virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const + { + return divDevBeff(U); + } + + + //- Correct Eddy-Viscosity and related properties + virtual void correct(const tmp<volTensorField>& gradU); + + //- Correct Eddy-Viscosity and related properties. + // This calls correct(const tmp<volTensorField>& gradU) by supplying + // gradU calculated locally. + void correct(); + + //- Read turbulenceProperties dictionary + virtual bool read() = 0; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/LES/LRRDiffStress/LRRDiffStress.C b/src/turbulenceModels/incompressible/LES/LRRDiffStress/LRRDiffStress.C new file mode 100644 index 00000000000..f6aa1f536e9 --- /dev/null +++ b/src/turbulenceModels/incompressible/LES/LRRDiffStress/LRRDiffStress.C @@ -0,0 +1,162 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "LRRDiffStress.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace LESModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(LRRDiffStress, 0); +addToRunTimeSelectionTable(LESModel, LRRDiffStress, dictionary); + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +LRRDiffStress::LRRDiffStress +( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport +) +: + LESModel(typeName, U, phi, transport), + GenSGSStress(U, phi, transport), + + ck_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "ck", + coeffDict(), + 0.09 + ) + ), + c1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "c1", + coeffDict(), + 1.8 + ) + ), + c2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "c2", + coeffDict(), + 0.6 + ) + ) +{ + printCoeffs(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void LRRDiffStress::correct(const tmp<volTensorField>& tgradU) +{ + const volTensorField& gradU = tgradU(); + + GenSGSStress::correct(gradU); + + volSymmTensorField D = symm(gradU); + + volSymmTensorField P = -twoSymm(B_ & gradU); + + volScalarField K = 0.5*tr(B_); + volScalarField Epsilon = 2*nuEff()*magSqr(D); + + fvSymmTensorMatrix BEqn + ( + fvm::ddt(B_) + + fvm::div(phi(), B_) + - fvm::laplacian(DBEff(), B_) + + fvm::Sp(c1_*Epsilon/K, B_) + == + P + - (0.667*(1.0 - c1_)*I)*Epsilon + - c2_*(P - 0.333*I*tr(P)) + - (0.667 - 2*c1_)*I*pow(K, 1.5)/delta() + ); + + BEqn.relax(); + BEqn.solve(); + + // Bounding the component kinetic energies + + forAll(B_, celli) + { + B_[celli].component(symmTensor::XX) = + max(B_[celli].component(symmTensor::XX), k0().value()); + B_[celli].component(symmTensor::YY) = + max(B_[celli].component(symmTensor::YY), k0().value()); + B_[celli].component(symmTensor::ZZ) = + max(B_[celli].component(symmTensor::ZZ), k0().value()); + } + + K = 0.5*tr(B_); + bound(K, k0()); + + nuSgs_ = ck_*sqrt(K)*delta(); + nuSgs_.correctBoundaryConditions(); +} + + +bool LRRDiffStress::read() +{ + if (GenSGSStress::read()) + { + ck_.readIfPresent(coeffDict()); + c1_.readIfPresent(coeffDict()); + c2_.readIfPresent(coeffDict()); + + return true; + } + else + { + return false; + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/LES/LRRDiffStress/LRRDiffStress.H b/src/turbulenceModels/incompressible/LES/LRRDiffStress/LRRDiffStress.H new file mode 100644 index 00000000000..a61ea1a49a6 --- /dev/null +++ b/src/turbulenceModels/incompressible/LES/LRRDiffStress/LRRDiffStress.H @@ -0,0 +1,138 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::incompressible::LESModels::LRRDiffStress + +Description + Differential SGS Stress Equation Model for incompressible flows. + + The DSEM uses a model version of the full balance equation for the SGS + stress tensor to simulate the behaviour of B, hence, + @verbatim + d/dt(B) + div(U*B) - div(nuSgs*grad(B)) + = + P - c1*e/k*B - 0.667*(1 - c1)*e*I - c2*(P - 0.333*trP*I) + where + k = 0.5*trB, + epsilon = ce*k^3/2/delta + epsilon/k = ce*k^1/2/delta + P = -(B'L + L'B) + nuEff = ck*sqrt(k)*delta + nu + @endverbatim + + This version from Launder, Rece & Rodi 1975 + +SourceFiles + LRRDiffStress.C + +\*---------------------------------------------------------------------------*/ + +#ifndef LRRDiffStress_H +#define LRRDiffStress_H + +#include "GenSGSStress.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace LESModels +{ + +/*---------------------------------------------------------------------------*\ + Class LRRDiffStress Declaration +\*---------------------------------------------------------------------------*/ + +class LRRDiffStress +: + public GenSGSStress +{ + // Private data + + dimensionedScalar ck_; + dimensionedScalar c1_; + dimensionedScalar c2_; + + + // Private Member Functions + + // Disallow default bitwise copy construct and assignment + LRRDiffStress(const LRRDiffStress&); + LRRDiffStress& operator=(const LRRDiffStress&); + + +public: + + //- Runtime type information + TypeName("LRRDiffStress"); + + // Constructors + + //- Construct from components + LRRDiffStress + ( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport + ); + + + //- Destructor + virtual ~LRRDiffStress() + {} + + + // Member Functions + + //- Return the effective diffusivity for B + tmp<volScalarField> DBEff() const + { + return tmp<volScalarField> + ( + new volScalarField("DBEff", nuSgs_ + nu()) + ); + } + + //- Correct Eddy-Viscosity and related properties + virtual void correct(const tmp<volTensorField>& gradU); + + //- Read turbulenceProperties dictionary + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/LES/Make/files b/src/turbulenceModels/incompressible/LES/Make/files new file mode 100644 index 00000000000..bd97e2c1ecd --- /dev/null +++ b/src/turbulenceModels/incompressible/LES/Make/files @@ -0,0 +1,38 @@ +vanDriestDelta/vanDriestDelta.C + +LESModel/LESModel.C + +GenEddyVisc/GenEddyVisc.C +GenSGSStress/GenSGSStress.C + +laminar/laminar.C +SpalartAllmaras/SpalartAllmaras.C +SpalartAllmarasDDES/SpalartAllmarasDDES.C +SpalartAllmarasIDDES/SpalartAllmarasIDDES.C +SpalartAllmarasIDDES/IDDESDelta/IDDESDelta.C + +oneEqEddy/oneEqEddy.C +dynOneEqEddy/dynOneEqEddy.C +locDynOneEqEddy/locDynOneEqEddy.C +Smagorinsky/Smagorinsky.C +dynSmagorinsky/dynSmagorinsky.C +LRRDiffStress/LRRDiffStress.C +DeardorffDiffStress/DeardorffDiffStress.C +spectEddyVisc/spectEddyVisc.C + +scaleSimilarity/scaleSimilarity.C +mixedSmagorinsky/mixedSmagorinsky.C +dynMixedSmagorinsky/dynMixedSmagorinsky.C + +/*Smagorinsky2/Smagorinsky2.C*/ + +kOmegaSSTSAS/kOmegaSSTSAS.C + +/* Wall functions */ +wallFunctions=derivedFvPatchFields/wallFunctions + +nuSgsWallFunctions=$(wallFunctions)/nuSgsWallFunctions +$(nuSgsWallFunctions)/nuSgsSpalartAllmarasWallFunction/nuSgsSpalartAllmarasWallFunctionFvPatchScalarField.C + + +LIB = $(FOAM_LIBBIN)/libincompressibleLESModels diff --git a/src/turbulenceModels/incompressible/LES/Make/options b/src/turbulenceModels/incompressible/LES/Make/options new file mode 100644 index 00000000000..8772261e70f --- /dev/null +++ b/src/turbulenceModels/incompressible/LES/Make/options @@ -0,0 +1,14 @@ +EXE_INC = \ + -I../turbulenceModel/lnInclude \ + -I../../LES/LESdeltas/lnInclude \ + -I../../LES/LESfilters/lnInclude \ + -I$(LIB_SRC)/transportModels \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude + +LIB_LIBS = \ + -lincompressibleTurbulenceModel \ + -lLESdeltas \ + -lLESfilters\ + -lfiniteVolume \ + -lmeshTools diff --git a/src/turbulenceModels/incompressible/LES/Smagorinsky/Smagorinsky.C b/src/turbulenceModels/incompressible/LES/Smagorinsky/Smagorinsky.C new file mode 100644 index 00000000000..30116770648 --- /dev/null +++ b/src/turbulenceModels/incompressible/LES/Smagorinsky/Smagorinsky.C @@ -0,0 +1,100 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "Smagorinsky.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace LESModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(Smagorinsky, 0); +addToRunTimeSelectionTable(LESModel, Smagorinsky, dictionary); + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Smagorinsky::Smagorinsky +( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport +) +: + LESModel(typeName, U, phi, transport), + GenEddyVisc(U, phi, transport), + + ck_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "ck", + coeffDict(), + 0.094 + ) + ) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Smagorinsky::correct(const tmp<volTensorField>& gradU) +{ + GenEddyVisc::correct(gradU); + + nuSgs_ = ck_*delta()*sqrt(k(gradU)); + nuSgs_.correctBoundaryConditions(); +} + + +bool Smagorinsky::read() +{ + if (GenEddyVisc::read()) + { + ck_.readIfPresent(coeffDict()); + + return true; + } + else + { + return false; + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/LES/Smagorinsky/Smagorinsky.H b/src/turbulenceModels/incompressible/LES/Smagorinsky/Smagorinsky.H new file mode 100644 index 00000000000..3dcb5b28a4d --- /dev/null +++ b/src/turbulenceModels/incompressible/LES/Smagorinsky/Smagorinsky.H @@ -0,0 +1,140 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::incompressible::LESModels::Smagorinsky + +Description + The Isochoric Smagorinsky Model for incompressible flows. + + Algebraic eddy viscosity SGS model founded on the assumption that + local equilibrium prevails. + Thus, + @verbatim + B = 2/3*k*I - 2*nuSgs*dev(D) + Beff = 2/3*k*I - 2*nuEff*dev(D) + + where + + D = symm(grad(U)); + k = (2*ck/ce)*delta^2*||D||^2 + nuSgs = ck*sqrt(k)*delta + nuEff = nuSgs + nu + @endverbatim + +SourceFiles + Smagorinsky.C + +\*---------------------------------------------------------------------------*/ + +#ifndef Smagorinsky_H +#define Smagorinsky_H + +#include "GenEddyVisc.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace LESModels +{ + +/*---------------------------------------------------------------------------*\ + Class Smagorinsky Declaration +\*---------------------------------------------------------------------------*/ + +class Smagorinsky +: + public GenEddyVisc +{ + // Private data + + dimensionedScalar ck_; + + + // Private Member Functions + + // Disallow default bitwise copy construct and assignment + Smagorinsky(const Smagorinsky&); + Smagorinsky& operator=(const Smagorinsky&); + + +public: + + //- Runtime type information + TypeName("Smagorinsky"); + + // Constructors + + //- Construct from components + Smagorinsky + ( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport + ); + + + //- Destructor + virtual ~Smagorinsky() + {} + + + // Member Functions + + //- Return SGS kinetic energy + // calculated from the given velocity gradient + tmp<volScalarField> k(const tmp<volTensorField>& gradU) const + { + return (2.0*ck_/ce_)*sqr(delta())*magSqr(dev(symm(gradU))); + } + + //- Return SGS kinetic energy + virtual tmp<volScalarField> k() const + { + return k(fvc::grad(U())); + } + + + //- Correct Eddy-Viscosity and related properties + virtual void correct(const tmp<volTensorField>& gradU); + + //- Read turbulenceProperties dictionary + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/LES/Smagorinsky2/Smagorinsky2.C b/src/turbulenceModels/incompressible/LES/Smagorinsky2/Smagorinsky2.C new file mode 100644 index 00000000000..351db3526e7 --- /dev/null +++ b/src/turbulenceModels/incompressible/LES/Smagorinsky2/Smagorinsky2.C @@ -0,0 +1,124 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "Smagorinsky2.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace LESModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(Smagorinsky2, 0); +addToRunTimeSelectionTable(LESModel, Smagorinsky2, dictionary); + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Smagorinsky2::Smagorinsky2 +( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport +) +: + LESModel(typeName, U, phi, transport), + Smagorinsky(U, phi, transport), + + cD2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "cD2", + coeffDict(), + 0.02 + ) + ) +{ + printCoeffs(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +// Evaluate B (from the definition of an eddy viscosity model) and +// return it. + +tmp<volSymmTensorField> Smagorinsky2::B() const +{ + volSymmTensorField D = dev(symm(fvc::grad(U()))); + + return (((2.0/3.0)*I)*k() - 2.0*nuSgs_*D - (2.0*cD2_)*delta()*(D&D)); +} + + +tmp<fvVectorMatrix> Smagorinsky2::divDevBeff +( + volVectorField& U +) const +{ + volTensorField gradU = fvc::grad(U); + + volSymmTensorField aniNuEff + ( + "aniNuEff", + I*nuEff() + cD2_*delta()*symm(gradU) + ); + + return + ( + - fvm::laplacian(aniNuEff, U) - fvc::div(nuEff()*dev(fvc::grad(U)().T())) + ); +} + + +bool Smagorinsky2::read() +{ + if (Smagorinsky::read()) + { + cD2.readIfPresent(coeffDict()); + + return true; + } + else + { + return false; + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/LES/Smagorinsky2/Smagorinsky2.H b/src/turbulenceModels/incompressible/LES/Smagorinsky2/Smagorinsky2.H new file mode 100644 index 00000000000..330bfd8b28c --- /dev/null +++ b/src/turbulenceModels/incompressible/LES/Smagorinsky2/Smagorinsky2.H @@ -0,0 +1,130 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::incompressible::LESModels::Smagorinsky2 + +Description + The Isochoric Smagorinsky Model for incompressible flows + + Algebraic eddy viscosity SGS model founded on the assumption that + local equilibrium prevails, hence + @verbatim + B = 2/3*k*I - 2*nuSgs*dev(D) - 2*cD2*delta*(D.dev(D)); + Beff = 2/3*k*I - 2*nuEff*dev(D) - 2*cD2*delta*(D.dev(D)); + + where + + D = symm(grad(U)); + k = cI*delta^2*||D||^2 + nuSgs = ck*sqrt(k)*delta + nuEff = nuSgs + nu + @endverbatim + +SourceFiles + Smagorinsky2.C + +\*---------------------------------------------------------------------------*/ + +#ifndef Smagorinsky2_H +#define Smagorinsky2_H + +#include "Smagorinsky.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace LESModels +{ + +/*---------------------------------------------------------------------------*\ + Class Smagorinsky2 Declaration +\*---------------------------------------------------------------------------*/ + +class Smagorinsky2 +: + public Smagorinsky +{ + // Private data + + dimensionedScalar cD2_; + + + // Private Member Functions + + // Disallow default bitwise copy construct and assignment + Smagorinsky2(const Smagorinsky2&); + Smagorinsky2& operator=(const Smagorinsky2&); + + +public: + + //- Runtime type information + TypeName("Smagorinsky2"); + + + // Constructors + + //- Construct from components + Smagorinsky2 + ( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport + ); + + + //- Destructor + virtual ~Smagorinsky2() + {} + + + // Member Functions + + //- Return B. + virtual tmp<volSymmTensorField> B() const; + + //- Returns div(B). + // This is the additional term due to the filtering of the NSE. + virtual tmp<fvVectorMatrix> divDevBeff(volVectorField& U) const; + + //- Read turbulenceProperties dictionary + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/LES/SpalartAllmaras/SpalartAllmaras.C b/src/turbulenceModels/incompressible/LES/SpalartAllmaras/SpalartAllmaras.C new file mode 100644 index 00000000000..11843958d5b --- /dev/null +++ b/src/turbulenceModels/incompressible/LES/SpalartAllmaras/SpalartAllmaras.C @@ -0,0 +1,371 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "SpalartAllmaras.H" +#include "addToRunTimeSelectionTable.H" +#include "wallDist.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace LESModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(SpalartAllmaras, 0); +addToRunTimeSelectionTable(LESModel, SpalartAllmaras, dictionary); + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +tmp<volScalarField> SpalartAllmaras::fv1() const +{ + volScalarField chi3 = pow3(nuTilda_/nu()); + return chi3/(chi3 + pow3(Cv1_)); +} + + +tmp<volScalarField> SpalartAllmaras::fv2() const +{ + volScalarField chi = nuTilda_/nu(); + return 1.0/pow3(scalar(1) + chi/Cv2_); +} + + +tmp<volScalarField> SpalartAllmaras::fv3() const +{ + volScalarField chi = nuTilda_/nu(); + volScalarField chiByCv2 = (1/Cv2_)*chi; + + return + (scalar(1) + chi*fv1()) + *(1/Cv2_) + *(3*(scalar(1) + chiByCv2) + sqr(chiByCv2)) + /pow3(scalar(1) + chiByCv2); +} + + +tmp<volScalarField> SpalartAllmaras::calcS(const volTensorField& gradU) +{ + return ::sqrt(2.0)*mag(skew(gradU)); +} + + +tmp<volScalarField> SpalartAllmaras::calcSTilda(const volTensorField& gradU) +{ + return fv3()*calcS(gradU) + fv2()*nuTilda_/sqr(kappa_*dTilda_); +} + + +tmp<volScalarField> SpalartAllmaras::r +( + const volScalarField& visc, + const volScalarField& S +) const +{ + tmp<volScalarField> tr + ( + new volScalarField + ( + min + ( + visc + /( + max + ( + S, + dimensionedScalar("SMALL", S.dimensions(), SMALL) + ) + *sqr(kappa_*dTilda_) + + dimensionedScalar + ( + "ROOTVSMALL", + dimensionSet(0, 2 , -1, 0, 0), + ROOTVSMALL + ) + ), + scalar(10.0) + ) + ) + ); + + return tr; +} + + +tmp<volScalarField> SpalartAllmaras::fw(const volScalarField& S) const +{ + volScalarField r = this->r(nuTilda_, S); + + volScalarField g = r + Cw2_*(pow6(r) - r); + + return g*pow((1.0 + pow6(Cw3_))/(pow6(g) + pow6(Cw3_)), 1.0/6.0); +} + + +void SpalartAllmaras::dTildaUpdate(const volScalarField&) +{ + if (mesh_.changing()) + { + dTilda_ = min(CDES_*delta(), wallDist(mesh_).y()); + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +SpalartAllmaras::SpalartAllmaras +( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport, + const word& modelName +) +: + LESModel(modelName, U, phi, transport), + + alphaNut_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphaNut", + coeffDict(), + 1.5 + ) + ), + kappa_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "kappa", + *this, + 0.4187 + ) + ), + Cb1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Cb1", + coeffDict(), + 0.1355 + ) + ), + Cb2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Cb2", + coeffDict(), + 0.622 + ) + ), + Cv1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Cv1", + coeffDict(), + 7.1 + ) + ), + Cv2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Cv2", + coeffDict(), + 5.0 + ) + ), + CDES_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "CDES", + coeffDict(), + 0.65 + ) + ), + ck_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "ck", + coeffDict(), + 0.07 + ) + ), + Cw1_(Cb1_/sqr(kappa_) + alphaNut_*(1.0 + Cb2_)), + Cw2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Cw2", + coeffDict(), + 0.3 + ) + ), + Cw3_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Cw3", + coeffDict(), + 2.0 + ) + ), + + nuTilda_ + ( + IOobject + ( + "nuTilda", + runTime_.timeName(), + mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh_ + ), + + dTilda_(min(CDES_*delta(), wallDist(mesh_).y())), + + nuSgs_ + ( + IOobject + ( + "nuSgs", + runTime_.timeName(), + mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh_ + ) +{} + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void SpalartAllmaras::correct(const tmp<volTensorField>& gradU) +{ + LESModel::correct(gradU); + + const volScalarField STilda = calcSTilda(gradU); + + const volScalarField S = calcS(gradU); + + dTildaUpdate(S); + + fvScalarMatrix nuTildaEqn + ( + fvm::ddt(nuTilda_) + + fvm::div(phi(), nuTilda_) + - fvm::laplacian + ( + alphaNut_*(nuTilda_ + nu()), + nuTilda_, + "laplacian(DnuTildaEff,nuTilda)" + ) + - alphaNut_*Cb2_*magSqr(fvc::grad(nuTilda_)) + == + Cb1_*STilda*nuTilda_ + - fvm::Sp(Cw1_*fw(STilda)*nuTilda_/sqr(dTilda_), nuTilda_) + ); + + nuTildaEqn.relax(); + nuTildaEqn.solve(); + + bound(nuTilda_, dimensionedScalar("zero", nuTilda_.dimensions(), 0.0)); + nuTilda_.correctBoundaryConditions(); + + nuSgs_.internalField() = fv1()*nuTilda_.internalField(); + nuSgs_.correctBoundaryConditions(); +} + + +tmp<volScalarField> SpalartAllmaras::epsilon() const +{ + return 2.0*nuEff()*magSqr(symm(fvc::grad(U()))); +} + + +tmp<volSymmTensorField> SpalartAllmaras::B() const +{ + return ((2.0/3.0)*I)*k() - nuSgs()*twoSymm(fvc::grad(U())); +} + + +tmp<volSymmTensorField> SpalartAllmaras::devBeff() const +{ + return -nuEff()*dev(twoSymm(fvc::grad(U()))); +} + + +tmp<fvVectorMatrix> SpalartAllmaras::divDevBeff(volVectorField& U) const +{ + return + ( + - fvm::laplacian(nuEff(), U) - fvc::div(nuEff()*dev(fvc::grad(U)().T())) + ); +} + + +bool SpalartAllmaras::read() +{ + if (LESModel::read()) + { + alphaNut_.readIfPresent(coeffDict()); + kappa_.readIfPresent(*this); + Cb1_.readIfPresent(coeffDict()); + Cb2_.readIfPresent(coeffDict()); + Cv1_.readIfPresent(coeffDict()); + Cv2_.readIfPresent(coeffDict()); + CDES_.readIfPresent(coeffDict()); + ck_.readIfPresent(coeffDict()); + Cw1_ = Cb1_/sqr(kappa_) + alphaNut_*(1.0 + Cb2_); + Cw2_.readIfPresent(coeffDict()); + Cw3_.readIfPresent(coeffDict()); + + return true; + } + else + { + return false; + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/LES/SpalartAllmaras/SpalartAllmaras.H b/src/turbulenceModels/incompressible/LES/SpalartAllmaras/SpalartAllmaras.H new file mode 100644 index 00000000000..aa721b1b5c4 --- /dev/null +++ b/src/turbulenceModels/incompressible/LES/SpalartAllmaras/SpalartAllmaras.H @@ -0,0 +1,189 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::LESmodels::SpalartAllmaras + +Description + SpalartAllmaras DES (SA + LES) turbulence model for incompressible flows + +SourceFiles + SpalartAllmaras.C + +\*---------------------------------------------------------------------------*/ + +#ifndef SpalartAllmaras_H +#define SpalartAllmaras_H + +#include "LESModel.H" +#include "volFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace LESModels +{ + +/*---------------------------------------------------------------------------*\ + Class SpalartAllmaras Declaration +\*---------------------------------------------------------------------------*/ + +class SpalartAllmaras +: + public LESModel +{ + // Private member functions + + // Disallow default bitwise copy construct and assignment + SpalartAllmaras(const SpalartAllmaras&); + SpalartAllmaras& operator=(const SpalartAllmaras&); + + +protected: + + // Protected data + + dimensionedScalar alphaNut_; + dimensionedScalar kappa_; + + + // Model constants + + dimensionedScalar Cb1_; + dimensionedScalar Cb2_; + dimensionedScalar Cv1_; + dimensionedScalar Cv2_; + dimensionedScalar CDES_; + dimensionedScalar ck_; + dimensionedScalar Cw1_; + dimensionedScalar Cw2_; + dimensionedScalar Cw3_; + + + // Fields + + volScalarField nuTilda_; + volScalarField dTilda_; + volScalarField nuSgs_; + + + // Protected member functions + + // Helper functions + + virtual tmp<volScalarField> fv1() const; + virtual tmp<volScalarField> fv2() const; + virtual tmp<volScalarField> fv3() const; + //- + virtual tmp<volScalarField> calcS(const volTensorField& gradU); + virtual tmp<volScalarField> calcSTilda(const volTensorField& gradU); + virtual tmp<volScalarField> r + ( + const volScalarField& visc, + const volScalarField& S + ) const; + virtual tmp<volScalarField> fw(const volScalarField& S) const; + + //- Length scale calculation + virtual void dTildaUpdate(const volScalarField& S); + + +public: + + //- Runtime type information + TypeName("SpalartAllmaras"); + + + // Constructors + + //- Construct from components + SpalartAllmaras + ( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport, + const word& modelName = typeName + ); + + + //- Destructor + virtual ~SpalartAllmaras() + {} + + + // Member Functions + + //- Return SGS kinetic energy + virtual tmp<volScalarField> k() const + { + return sqr(nuSgs()/ck_/dTilda_); + } + + //- Return sub-grid disipation rate + virtual tmp<volScalarField> epsilon() const; + + tmp<volScalarField> nuTilda() const + { + return nuTilda_; + } + + //- Return SGS viscosity + virtual tmp<volScalarField> nuSgs() const + { + return nuSgs_; + } + + //- Return the sub-grid stress tensor. + virtual tmp<volSymmTensorField> B() const; + + //- Return the effective sub-grid turbulence stress tensor + // including the laminar stress + virtual tmp<volSymmTensorField> devBeff() const; + + //- Return the deviatoric part of the divergence of Beff + // i.e. the additional term in the filtered NSE. + virtual tmp<fvVectorMatrix> divDevBeff(volVectorField& U) const; + + //- Correct nuTilda and related properties + virtual void correct(const tmp<volTensorField>& gradU); + + //- Read turbulenceProperties dictionary + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/LES/SpalartAllmarasDDES/SpalartAllmarasDDES.C b/src/turbulenceModels/incompressible/LES/SpalartAllmarasDDES/SpalartAllmarasDDES.C new file mode 100644 index 00000000000..6f5435a2681 --- /dev/null +++ b/src/turbulenceModels/incompressible/LES/SpalartAllmarasDDES/SpalartAllmarasDDES.C @@ -0,0 +1,120 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "SpalartAllmarasDDES.H" +#include "addToRunTimeSelectionTable.H" +#include "wallDist.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace LESModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(SpalartAllmarasDDES, 0); +addToRunTimeSelectionTable(LESModel, SpalartAllmarasDDES, dictionary); + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +tmp<volScalarField> SpalartAllmarasDDES::rd +( + const volScalarField& visc, + const volScalarField& S +) const +{ + volScalarField d = wallDist(mesh_).y(); + + tmp<volScalarField> trd + ( + new volScalarField + ( + min + ( + visc + /( + max + ( + S, + dimensionedScalar("SMALL", S.dimensions(), SMALL) + )*sqr(kappa_*d) + + dimensionedScalar + ( + "ROOTVSMALL", + dimensionSet(0, 2 , -1, 0, 0), + ROOTVSMALL + ) + ), scalar(10.0) + ) + ) + ); + + return trd; +} + + +tmp<volScalarField> SpalartAllmarasDDES::fd(const volScalarField& S) +{ + return 1.0 - tanh(pow3(8.0*rd(nuSgs_ + transport().nu(), S))); +} + + +void SpalartAllmarasDDES::dTildaUpdate(const volScalarField& S) +{ + dTilda_ = + wallDist(mesh_).y() + - fd(S)*max + ( + dimensionedScalar("zero", dimLength, 0.0), + wallDist(mesh_).y() - CDES_*delta() + ); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +SpalartAllmarasDDES::SpalartAllmarasDDES +( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport +) +: + SpalartAllmaras(U, phi, transport, typeName) +{} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/LES/SpalartAllmarasDDES/SpalartAllmarasDDES.H b/src/turbulenceModels/incompressible/LES/SpalartAllmarasDDES/SpalartAllmarasDDES.H new file mode 100644 index 00000000000..ec7eeda68c7 --- /dev/null +++ b/src/turbulenceModels/incompressible/LES/SpalartAllmarasDDES/SpalartAllmarasDDES.H @@ -0,0 +1,118 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::LESmodels::SpalartAllmarasDDES + +Description + SpalartAllmaras DDES LES turbulence model for incompressible flows + + Reference: + P.R. Spalart, S. Deck, S., M.L.Shur, K.D. Squires, M.Kh Strelets, and + A. Travin. `A new version of detached-eddy simulation, resistant to + ambiguous grid densities'. Theor. Comp. Fluid Dyn., 20:181-195, 2006. + +SourceFiles + SpalartAllmarasDDES.C + +\*---------------------------------------------------------------------------*/ + +#ifndef SpalartAllmarasDDES_H +#define SpalartAllmarasDDES_H + +#include "SpalartAllmaras.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace LESModels +{ + +/*---------------------------------------------------------------------------*\ + Class SpalartAllmarasDDES Declaration +\*---------------------------------------------------------------------------*/ + +class SpalartAllmarasDDES +: + public SpalartAllmaras +{ + // Private member functions + + // Disallow default bitwise copy construct and assignment + SpalartAllmarasDDES(const SpalartAllmarasDDES&); + SpalartAllmarasDDES& operator=(const SpalartAllmarasDDES&); + + +protected: + + // Protected member functions + + tmp<volScalarField> fd(const volScalarField& S); + tmp<volScalarField> rd + ( + const volScalarField& visc, + const volScalarField& S + ) const; + + //- Length scale calculation + virtual void dTildaUpdate(const volScalarField& S); + + +public: + + //- Runtime type information + TypeName("SpalartAllmarasDDES"); + + + // Constructors + + //- Construct from components + SpalartAllmarasDDES + ( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport + ); + + + //- Destructor + virtual ~SpalartAllmarasDDES() + {} +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/LES/SpalartAllmarasIDDES/IDDESDelta/IDDESDelta.C b/src/turbulenceModels/incompressible/LES/SpalartAllmarasIDDES/IDDESDelta/IDDESDelta.C new file mode 100644 index 00000000000..36e6a46a4eb --- /dev/null +++ b/src/turbulenceModels/incompressible/LES/SpalartAllmarasIDDES/IDDESDelta/IDDESDelta.C @@ -0,0 +1,140 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "IDDESDelta.H" +#include "addToRunTimeSelectionTable.H" +#include "wallDist.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(IDDESDelta, 0); + addToRunTimeSelectionTable(LESdelta, IDDESDelta, dictionary); +} + + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +void Foam::IDDESDelta::calcDelta() +{ + const Vector<label>& directions = mesh().directions(); + label nD = (directions.nComponents + cmptSum(directions))/2; + + // - Init hwn as wall distant. + volScalarField hwn = wallDist(mesh()).y(); + + scalar deltamaxTmp = 0.; + + const cellList& cells = mesh().cells(); + + forAll(cells,cellI) + { + scalar deltaminTmp = 1.e10; + const labelList& cFaces = mesh().cells()[cellI]; + const point& centrevector = mesh().cellCentres()[cellI]; + + forAll(cFaces, cFaceI) + { + label faceI = cFaces[cFaceI]; + const point& facevector = mesh().faceCentres()[faceI]; + scalar tmp = mag(facevector-centrevector); + if (tmp > deltamaxTmp) + { + deltamaxTmp = tmp; + } + if (tmp < deltaminTmp) + { + deltaminTmp = tmp; + } + } + hwn[cellI] = 2.0*deltaminTmp; + } + + dimensionedScalar deltamax("deltamax",dimLength,2.0*deltamaxTmp); + + if (nD == 3) + { + delta_.internalField() = + deltaCoeff_ + *min(max(max(cw_*wallDist(mesh()).y(),cw_*deltamax),hwn),deltamax); + } + else if (nD == 2) + { + WarningIn("IDDESDelta::calcDelta()") + << "Case is 2D, LES is not strictly applicable\n" + << endl; + + delta_.internalField() = + deltaCoeff_ + *min(max(max(cw_*wallDist(mesh()).y(),cw_*deltamax),hwn),deltamax); + } + else + { + FatalErrorIn("IDDESDelta::calcDelta()") + << "Case is not 3D or 2D, LES is not applicable" + << exit(FatalError); + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::IDDESDelta::IDDESDelta +( + const word& name, + const fvMesh& mesh, + const dictionary& dd +) +: + LESdelta(name, mesh), + deltaCoeff_(readScalar(dd.subDict(type() + "Coeffs").lookup("deltaCoeff"))), + cw_(0) +{ + dd.subDict(type() + "Coeffs").readIfPresent("cw", cw_); + calcDelta(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::IDDESDelta::read(const dictionary& dd) +{ + dd.subDict(type() + "Coeffs").lookup("deltaCoeff") >> deltaCoeff_; + calcDelta(); +} + + +void Foam::IDDESDelta::correct() +{ + if (mesh_.changing()) + { + calcDelta(); + } +} + + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/LES/SpalartAllmarasIDDES/IDDESDelta/IDDESDelta.H b/src/turbulenceModels/incompressible/LES/SpalartAllmarasIDDES/IDDESDelta/IDDESDelta.H new file mode 100644 index 00000000000..a53d1127d28 --- /dev/null +++ b/src/turbulenceModels/incompressible/LES/SpalartAllmarasIDDES/IDDESDelta/IDDESDelta.H @@ -0,0 +1,113 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::IDDESDelta + +Description + IDDESDelta used by the IDDES (improved low Re Spalart-Allmaras DES model) + The min and max delta are calculated using the double distance of the min or + max from the face centre to the cell centre. + +SourceFiles + IDDESDelta.C + +\*---------------------------------------------------------------------------*/ + +#ifndef IDDESDeltaDelta_H +#define IDDESDeltaDelta_H + +#include "LESdelta.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class IDDESDelta Declaration +\*---------------------------------------------------------------------------*/ + +class IDDESDelta +: + public LESdelta +{ + // Private data + + scalar deltaCoeff_; + scalar cw_; + + + // Private Member Functions + + //- Disallow default bitwise copy construct and assignment + IDDESDelta(const IDDESDelta&); + void operator=(const IDDESDelta&); + + //- Calculate the delta values + void calcDelta(); + + +public: + + //- Runtime type information + TypeName("IDDESDelta"); + + + // Constructors + + //- Construct from name, mesh and IOdictionary + IDDESDelta + ( + const word& name, + const fvMesh& mesh, + const dictionary& + ); + + + // Destructor + + ~IDDESDelta() + {} + + + // Member Functions + + //- Read the LESdelta dictionary + void read(const dictionary&); + + // Correct values + void correct(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/LES/SpalartAllmarasIDDES/SpalartAllmarasIDDES.C b/src/turbulenceModels/incompressible/LES/SpalartAllmarasIDDES/SpalartAllmarasIDDES.C new file mode 100644 index 00000000000..b58c9557d44 --- /dev/null +++ b/src/turbulenceModels/incompressible/LES/SpalartAllmarasIDDES/SpalartAllmarasIDDES.C @@ -0,0 +1,214 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "SpalartAllmarasIDDES.H" +#include "addToRunTimeSelectionTable.H" +#include "wallDist.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace LESModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(SpalartAllmarasIDDES, 0); +addToRunTimeSelectionTable(LESModel, SpalartAllmarasIDDES, dictionary); + +// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // + +tmp<volScalarField> SpalartAllmarasIDDES::alpha() const +{ + return + 0.25 + - wallDist(mesh_).y() + /dimensionedScalar("hMax", dimLength, max(cmptMax(delta()))); +} + + +tmp<volScalarField> SpalartAllmarasIDDES::ft(const volScalarField& S) const +{ + return tanh(pow3(sqr(ct_)*r(nuSgs_, S))); +} + + +tmp<volScalarField> SpalartAllmarasIDDES::fl(const volScalarField& S) const +{ + return tanh(pow(sqr(cl_)*r(transport().nu(), S), 10)); +} + + +tmp<volScalarField> SpalartAllmarasIDDES::rd +( + const volScalarField& visc, + const volScalarField& S +) const +{ + volScalarField d = wallDist(mesh_).y(); + + tmp<volScalarField> trd + ( + new volScalarField + ( + min + ( + visc + /( + max + ( + S, + dimensionedScalar("SMALL", S.dimensions(), SMALL) + )*sqr(kappa_*d) + + dimensionedScalar + ( + "ROOTVSMALL", + dimensionSet(0, 2 , -1, 0, 0), + ROOTVSMALL + ) + ), scalar(10.0) + ) + ) + ); + + return trd; +} + + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +tmp<volScalarField> SpalartAllmarasIDDES::fd(const volScalarField& S) const +{ + return 1.0 - tanh(pow3(8.0*rd(nuSgs_+transport().nu(), S))); +} + + +void SpalartAllmarasIDDES::dTildaUpdate(const volScalarField& S) +{ + volScalarField alpha = this->alpha(); + + volScalarField expTerm = exp(sqr(alpha)); + + volScalarField fHill = + 2.0*(pos(alpha)*pow(expTerm, -11.09) + neg(alpha)*pow(expTerm, -9.0)); + + + volScalarField fStep = min(2.0*pow(expTerm, -9.0), 1.0); + volScalarField fHyb = max(1.0 - fd(S), fStep); + + volScalarField fAmp = 1.0 - max(ft(S), fl(S)); + + volScalarField fRestore = max(fHill - 1.0, 0.0)*fAmp; + + // volScalarField ft2 = IGNORING ft2 terms + + volScalarField Psi = sqrt + ( + min + ( + 100.0, + (1.0 - Cb1_/(Cw1_*sqr(kappa_)*fwStar_)*fv2())/max(SMALL, fv1()) + ) + ); + + dTilda_ = max + ( + dimensionedScalar("zero", dimLength, 0.0), + fHyb*(1.0 + fRestore*Psi)*wallDist(mesh_).y() + + (1.0 - fHyb)*CDES_*Psi*delta() + ); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +SpalartAllmarasIDDES::SpalartAllmarasIDDES +( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport +) +: + SpalartAllmaras(U, phi, transport, typeName), + + fwStar_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "fwStar", + coeffDict(), + 0.424 + ) + ), + cl_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "cl", + coeffDict(), + 3.55 + ) + ), + ct_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "ct", + coeffDict(), + 1.63 + ) + ) + +{} + + +bool SpalartAllmarasIDDES::read() +{ + if (SpalartAllmaras::read()) + { + fwStar_.readIfPresent(coeffDict()); + cl_.readIfPresent(coeffDict()); + ct_.readIfPresent(coeffDict()); + + return true; + } + else + { + return false; + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/LES/SpalartAllmarasIDDES/SpalartAllmarasIDDES.H b/src/turbulenceModels/incompressible/LES/SpalartAllmarasIDDES/SpalartAllmarasIDDES.H new file mode 100644 index 00000000000..815d2c28a6e --- /dev/null +++ b/src/turbulenceModels/incompressible/LES/SpalartAllmarasIDDES/SpalartAllmarasIDDES.H @@ -0,0 +1,132 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::LESmodels::SpalartAllmarasIDDES + +Description + SpalartAllmarasIDDES LES turbulence model for incompressible flows + +SourceFiles + SpalartAllmarasIDDES.C + +\*---------------------------------------------------------------------------*/ + +#ifndef SpalartAllmarasIDDES_H +#define SpalartAllmarasIDDES_H + +#include "SpalartAllmaras.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace LESModels +{ + +/*---------------------------------------------------------------------------*\ + Class SpalartAllmarasIDDES Declaration +\*---------------------------------------------------------------------------*/ + +class SpalartAllmarasIDDES +: + public SpalartAllmaras +{ + // Private data + + // Model constants + + dimensionedScalar fwStar_; + dimensionedScalar cl_; + dimensionedScalar ct_; + + + // Private member functions + + tmp<volScalarField> alpha() const; + tmp<volScalarField> ft(const volScalarField& S) const; + tmp<volScalarField> fl(const volScalarField& S) const; + tmp<volScalarField> rd + ( + const volScalarField& visc, + const volScalarField& S + ) const; + + // Disallow default bitwise copy construct and assignment + SpalartAllmarasIDDES(const SpalartAllmarasIDDES&); + SpalartAllmarasIDDES& operator=(const SpalartAllmarasIDDES&); + + +protected: + + // Protected member functions + + //- Delay function + tmp<volScalarField> fd(const volScalarField& S) const; + + //- Length scale calculation + virtual void dTildaUpdate(const volScalarField& S); + +public: + + //- Runtime type information + TypeName("SpalartAllmarasIDDES"); + + + // Constructors + + //- Construct from components + SpalartAllmarasIDDES + ( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport + ); + + + //- Destructor + virtual ~SpalartAllmarasIDDES() + {} + + + // Member Functions + + //- Read turbulenceProperties dictionary + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsSpalartAllmarasWallFunction/nuSgsSpalartAllmarasWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsSpalartAllmarasWallFunction/nuSgsSpalartAllmarasWallFunctionFvPatchScalarField.C new file mode 100644 index 00000000000..ab02061c5d2 --- /dev/null +++ b/src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsSpalartAllmarasWallFunction/nuSgsSpalartAllmarasWallFunctionFvPatchScalarField.C @@ -0,0 +1,186 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "nuSgsSpalartAllmarasWallFunctionFvPatchScalarField.H" +#include "LESModel.H" +#include "fvPatchFieldMapper.H" +#include "volFields.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace LESModels +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +nuSgsSpalartAllmarasWallFunctionFvPatchScalarField:: +nuSgsSpalartAllmarasWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchScalarField(p, iF) +{} + + +nuSgsSpalartAllmarasWallFunctionFvPatchScalarField:: +nuSgsSpalartAllmarasWallFunctionFvPatchScalarField +( + const nuSgsSpalartAllmarasWallFunctionFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + fixedValueFvPatchScalarField(ptf, p, iF, mapper) +{} + + +nuSgsSpalartAllmarasWallFunctionFvPatchScalarField:: +nuSgsSpalartAllmarasWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + fixedValueFvPatchScalarField(p, iF, dict) +{} + + +nuSgsSpalartAllmarasWallFunctionFvPatchScalarField:: +nuSgsSpalartAllmarasWallFunctionFvPatchScalarField +( + const nuSgsSpalartAllmarasWallFunctionFvPatchScalarField& tppsf +) +: + fixedValueFvPatchScalarField(tppsf) +{} + + +nuSgsSpalartAllmarasWallFunctionFvPatchScalarField:: +nuSgsSpalartAllmarasWallFunctionFvPatchScalarField +( + const nuSgsSpalartAllmarasWallFunctionFvPatchScalarField& tppsf, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchScalarField(tppsf, iF) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void nuSgsSpalartAllmarasWallFunctionFvPatchScalarField::evaluate +( + const Pstream::commsTypes +) +{ + const LESModel& sgsModel + = db().lookupObject<LESModel>("LESProperties"); + + scalar kappa = readScalar(sgsModel.lookup("kappa")); + + scalar E = readScalar(sgsModel.subDict("wallFunctionCoeffs").lookup("E")); + + const scalarField& ry = patch().deltaCoeffs(); + + const fvPatchVectorField& U = + patch().lookupPatchField<volVectorField, vector>("U"); + + scalarField magUp = mag(U.patchInternalField() - U); + + const scalarField& nuw = + patch().lookupPatchField<volScalarField, scalar>("nu"); + scalarField& nuSgsw = *this; + + + scalarField magFaceGradU = mag(U.snGrad()); + + forAll(nuSgsw, facei) + { + scalar magUpara = magUp[facei]; + + scalar utau = sqrt((nuSgsw[facei] + nuw[facei])*magFaceGradU[facei]); + + if(utau > VSMALL) + { + int iter = 0; + scalar err = GREAT; + + do + { + scalar kUu = min(kappa*magUpara/utau, 100); + scalar fkUu = exp(kUu) - 1 - kUu*(1 + 0.5*kUu); + + scalar f = + - utau/(ry[facei]*nuw[facei]) + + magUpara/utau + + 1/E*(fkUu - 1.0/6.0*kUu*sqr(kUu)); + + scalar df = + - 1.0/(ry[facei]*nuw[facei]) + - magUpara/sqr(utau) + - 1/E*kUu*fkUu/utau; + + scalar utauNew = utau - f/df; + err = mag((utau - utauNew)/utau); + utau = utauNew; + + } while (utau > VSMALL && err > 0.01 && ++iter < 10); + + nuSgsw[facei] = + max(sqr(max(utau, 0))/magFaceGradU[facei] - nuw[facei], 0.0); + } + else + { + nuSgsw[facei] = 0; + } + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField +( + fvPatchScalarField, + nuSgsSpalartAllmarasWallFunctionFvPatchScalarField +); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsSpalartAllmarasWallFunction/nuSgsSpalartAllmarasWallFunctionFvPatchScalarField.H b/src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsSpalartAllmarasWallFunction/nuSgsSpalartAllmarasWallFunctionFvPatchScalarField.H new file mode 100644 index 00000000000..ecb1830757e --- /dev/null +++ b/src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsSpalartAllmarasWallFunction/nuSgsSpalartAllmarasWallFunctionFvPatchScalarField.H @@ -0,0 +1,157 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::incompressible::LESModels:: + nuSgsSpalartAllmarasWallFunctionFvPatchScalarField + +Description + Spalart Allmaras wall function boundary condition for incompressible flows + +SourceFiles + nuSgsSpalartAllmarasWallFunctionFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef nuSgsSpalartAllmarasWallFunctionFvPatchScalarField_H +#define nuSgsSpalartAllmarasWallFunctionFvPatchScalarField_H + +#include "fixedValueFvPatchFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace LESModels +{ + +/*---------------------------------------------------------------------------*\ + Class nuSgsSpalartAllmarasWallFunctionFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class nuSgsSpalartAllmarasWallFunctionFvPatchScalarField +: + public fixedValueFvPatchScalarField +{ + // Private data + + +public: + + //- Runtime type information + TypeName("nuSgsSpalartAllmarasWallFunction"); + + + // Constructors + + //- Construct from patch and internal field + nuSgsSpalartAllmarasWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + nuSgsSpalartAllmarasWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given + // nuSgsSpalartAllmarasWallFunctionFvPatchScalarField + // onto a new patch + nuSgsSpalartAllmarasWallFunctionFvPatchScalarField + ( + const nuSgsSpalartAllmarasWallFunctionFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + nuSgsSpalartAllmarasWallFunctionFvPatchScalarField + ( + const nuSgsSpalartAllmarasWallFunctionFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchScalarField> clone() const + { + return tmp<fvPatchScalarField> + ( + new nuSgsSpalartAllmarasWallFunctionFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + nuSgsSpalartAllmarasWallFunctionFvPatchScalarField + ( + const nuSgsSpalartAllmarasWallFunctionFvPatchScalarField&, + 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 nuSgsSpalartAllmarasWallFunctionFvPatchScalarField + ( + *this, + iF + ) + ); + } + + + // Member functions + + // Evaluation functions + + //- Evaluate the patchField + virtual void evaluate + ( + const Pstream::commsTypes commsType=Pstream::blocking + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/LES/dynMixedSmagorinsky/dynMixedSmagorinsky.C b/src/turbulenceModels/incompressible/LES/dynMixedSmagorinsky/dynMixedSmagorinsky.C new file mode 100644 index 00000000000..aabecafd199 --- /dev/null +++ b/src/turbulenceModels/incompressible/LES/dynMixedSmagorinsky/dynMixedSmagorinsky.C @@ -0,0 +1,142 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "dynMixedSmagorinsky.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace LESModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(dynMixedSmagorinsky, 0); +addToRunTimeSelectionTable(LESModel, dynMixedSmagorinsky, dictionary); + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +dynMixedSmagorinsky::dynMixedSmagorinsky +( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport +) +: + LESModel(typeName, U, phi, transport), + scaleSimilarity(U, phi, transport), + dynSmagorinsky(U, phi, transport) +{ + printCoeffs(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +tmp<volScalarField> dynMixedSmagorinsky::k() const +{ + return + ( + scaleSimilarity::k() + + dynSmagorinsky::k() + ); +} + + +tmp<volScalarField> dynMixedSmagorinsky::epsilon() const +{ + return + ( + scaleSimilarity::epsilon() + + dynSmagorinsky::epsilon() + ); +} + + +tmp<volSymmTensorField> dynMixedSmagorinsky::B() const +{ + return + ( + scaleSimilarity::B() + + dynSmagorinsky::B() + ); +} + + +tmp<volSymmTensorField> dynMixedSmagorinsky::devBeff() const +{ + return + ( + scaleSimilarity::devBeff() + + dynSmagorinsky::devBeff() + ); +} + + +tmp<fvVectorMatrix> dynMixedSmagorinsky::divDevBeff(volVectorField& U) const +{ + return + ( + scaleSimilarity::divDevBeff(U) + + dynSmagorinsky::divDevBeff(U) + ); +} + + +void dynMixedSmagorinsky::correct(const tmp<volTensorField>& gradU) +{ + scaleSimilarity::correct(gradU); + dynSmagorinsky::correct(gradU); +} + + +bool dynMixedSmagorinsky::read() +{ + if (LESModel::read()) + { + scaleSimilarity::read(); + dynSmagorinsky::read(); + + return true; + } + else + { + return false; + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/LES/dynMixedSmagorinsky/dynMixedSmagorinsky.H b/src/turbulenceModels/incompressible/LES/dynMixedSmagorinsky/dynMixedSmagorinsky.H new file mode 100644 index 00000000000..223487b7d02 --- /dev/null +++ b/src/turbulenceModels/incompressible/LES/dynMixedSmagorinsky/dynMixedSmagorinsky.H @@ -0,0 +1,150 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::incompressible::LESModels::dynMixedSmagorinsky + +Description + The Mixed Isochoric Smagorinsky Model for incompressible flows. + + The mixed model is a linear combination of an eddy viscosity model + with a scale similarity model. + @verbatim + B = (L + C) + R = (F(v*v) - F(v)*F(v)) + R + @endverbatim + + The algebraic eddy viscosity SGS model is founded on the assumption + that local equilibrium prevails, hence + @verbatim + R = 2/3*rho*k*I - 2*nuEff*dev(D) + where + k = cI*delta^2*||D||^2 + nuEff = ck*sqrt(k)*delta + nu + @endverbatim + + The Leonard and cross contributions are incorporated + by adding, + @verbatim + + div(((filter(U*U) - filter(U)*filter(U)) - + 0.333*I*tr(filter(U*U) - filter(U)*filter(U)))) + + div((filter(U*epsilon) - filter(U)*filter(epsilon))) + @endverbatim + to the rhs. of the equations. This version implements filtering to + evaluate the coefficients in the model. + +SourceFiles + dynMixedSmagorinsky.C + +\*---------------------------------------------------------------------------*/ + +#ifndef dynMixedSmagorinsky_H +#define dynMixedSmagorinsky_H + +#include "dynSmagorinsky.H" +#include "scaleSimilarity.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace LESModels +{ + +/*---------------------------------------------------------------------------*\ + Class dynMixedSmagorinsky Declaration +\*---------------------------------------------------------------------------*/ + +class dynMixedSmagorinsky +: + public scaleSimilarity, + public dynSmagorinsky +{ + // Private Member Functions + + // Disallow default bitwise copy construct and assignment + dynMixedSmagorinsky(const dynMixedSmagorinsky&); + dynMixedSmagorinsky& operator=(const dynMixedSmagorinsky&); + +public: + + //- Runtime type information + TypeName("dynMixedSmagorinsky"); + + // Constructors + + //- Constructors from components + dynMixedSmagorinsky + ( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport + ); + + + // Destructor + + ~dynMixedSmagorinsky() + {} + + + // Member Functions + + //- Return SGS kinetic energy + tmp<volScalarField> k() const; + + //- Return sub-grid disipation rate + tmp<volScalarField> epsilon() const; + + //- Return the sub-grid stress tensor. + tmp<volSymmTensorField> B() const; + + //- Return the effective sub-grid turbulence stress tensor + // including the laminar stress + tmp<volSymmTensorField> devBeff() const; + + //- Returns div(B). + // This is the additional term due to the filtering of the NSE. + tmp<fvVectorMatrix> divDevBeff(volVectorField& U) const; + + //- Correct Eddy-Viscosity and related properties + void correct(const tmp<volTensorField>& gradU); + + //- Read turbulenceProperties dictionary + bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/LES/dynOneEqEddy/dynOneEqEddy.C b/src/turbulenceModels/incompressible/LES/dynOneEqEddy/dynOneEqEddy.C new file mode 100644 index 00000000000..14314e28076 --- /dev/null +++ b/src/turbulenceModels/incompressible/LES/dynOneEqEddy/dynOneEqEddy.C @@ -0,0 +1,184 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "dynOneEqEddy.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace LESModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(dynOneEqEddy, 0); +addToRunTimeSelectionTable(LESModel, dynOneEqEddy, dictionary); + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +dimensionedScalar dynOneEqEddy::ck(const volSymmTensorField& D) const +{ + volScalarField KK = 0.5*(filter_(magSqr(U())) - magSqr(filter_(U()))); + + volSymmTensorField LL = dev(filter_(sqr(U())) - sqr(filter_(U()))); + + volSymmTensorField MM = + delta()*(filter_(sqrt(k_)*D) - 2*sqrt(KK + filter_(k_))*filter_(D)); + + dimensionedScalar MMMM = average(magSqr(MM)); + + if (MMMM.value() > VSMALL) + { + return average(LL && MM)/MMMM; + } + else + { + return 0.0; + } +} + + +dimensionedScalar dynOneEqEddy::ce(const volSymmTensorField& D) const +{ + volScalarField KK = 0.5*(filter_(magSqr(U())) - magSqr(filter_(U()))); + + volScalarField mm = + pow(KK + filter_(k_), 1.5)/(2*delta()) - filter_(pow(k_, 1.5))/delta(); + + volScalarField ee = + 2*delta()*ck(D) + *( + filter_(sqrt(k_)*magSqr(D)) + - 2*sqrt(KK + filter_(k_))*magSqr(filter_(D)) + ); + + dimensionedScalar mmmm = average(magSqr(mm)); + + if (mmmm.value() > VSMALL) + { + return average(ee*mm)/mmmm; + } + else + { + return 0.0; + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +dynOneEqEddy::dynOneEqEddy +( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport +) +: + LESModel(typeName, U, phi, transport), + GenEddyVisc(U, phi, transport), + + k_ + ( + IOobject + ( + "k", + runTime_.timeName(), + mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh_ + ), + + filterPtr_(LESfilter::New(U.mesh(), coeffDict())), + filter_(filterPtr_()) +{ + printCoeffs(); +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +dynOneEqEddy::~dynOneEqEddy() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void dynOneEqEddy::correct(const tmp<volTensorField>& gradU) +{ + GenEddyVisc::correct(gradU); + + volSymmTensorField D = symm(gradU); + + volScalarField P = 2.0*nuSgs_*magSqr(D); + + fvScalarMatrix kEqn + ( + fvm::ddt(k_) + + fvm::div(phi(), k_) + - fvm::laplacian(DkEff(), k_) + == + P + - fvm::Sp(ce(D)*sqrt(k_)/delta(), k_) + ); + + kEqn.relax(); + kEqn.solve(); + + bound(k_, k0()); + + nuSgs_ = ck(D)*sqrt(k_)*delta(); + nuSgs_.correctBoundaryConditions(); +} + + +bool dynOneEqEddy::read() +{ + if (GenEddyVisc::read()) + { + filter_.read(coeffDict()); + + return true; + } + else + { + return false; + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/LES/dynOneEqEddy/dynOneEqEddy.H b/src/turbulenceModels/incompressible/LES/dynOneEqEddy/dynOneEqEddy.H new file mode 100644 index 00000000000..48aad65c601 --- /dev/null +++ b/src/turbulenceModels/incompressible/LES/dynOneEqEddy/dynOneEqEddy.H @@ -0,0 +1,154 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::incompressible::LESModels::dynOneEqEddy + +Description + One Equation Eddy Viscosity Model for incompressible flows. + + Eddy viscosity SGS model using a modeled balance equation to simulate + the behaviour of k. + + Thus + @verbatim + d/dt(k) + div(U*k) - div(nuSgs*grad(k)) + = + -B*L - ce*k^3/2/delta + + and + + B = 2/3*k*I - 2*nuSgs*dev(D) + Beff = 2/3*k*I - 2*nuEff*dev(D) + + where + + D = symm(grad(U)); + nuSgs = ck*sqrt(k)*delta + nuEff = nuSgs + nu + @endverbatim + +SourceFiles + dynOneEqEddy.C + +\*---------------------------------------------------------------------------*/ + +#ifndef dynOneEqEddy_H +#define dynOneEqEddy_H + +#include "GenEddyVisc.H" +#include "LESfilter.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace LESModels +{ + +/*---------------------------------------------------------------------------*\ + Class dynOneEqEddy Declaration +\*---------------------------------------------------------------------------*/ + +class dynOneEqEddy +: + public GenEddyVisc +{ + // Private data + + volScalarField k_; + + autoPtr<LESfilter> filterPtr_; + LESfilter& filter_; + + + // Private Member Functions + + //- Calculate ck, ce by filtering the velocity field U. + dimensionedScalar ck(const volSymmTensorField& D) const; + dimensionedScalar ce(const volSymmTensorField& D) const; + + // Disallow default bitwise copy construct and assignment + dynOneEqEddy(const dynOneEqEddy&); + dynOneEqEddy& operator=(const dynOneEqEddy&); + + +public: + + //- Runtime type information + TypeName("dynOneEqEddy"); + + // Constructors + + //- Construct from components + dynOneEqEddy + ( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport + ); + + + //- Destructor + virtual ~dynOneEqEddy(); + + + // Member Functions + + //- Return SGS kinetic energy + virtual tmp<volScalarField> k() const + { + return k_; + } + + //- Return the effective diffusivity for k + tmp<volScalarField> DkEff() const + { + return tmp<volScalarField> + ( + new volScalarField("DkEff", nuSgs_ + nu()) + ); + } + + //- Correct Eddy-Viscosity and related properties + virtual void correct(const tmp<volTensorField>& gradU); + + //- Read turbulenceProperties dictionary + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/LES/dynSmagorinsky/dynSmagorinsky.C b/src/turbulenceModels/incompressible/LES/dynSmagorinsky/dynSmagorinsky.C new file mode 100644 index 00000000000..114a8ea4127 --- /dev/null +++ b/src/turbulenceModels/incompressible/LES/dynSmagorinsky/dynSmagorinsky.C @@ -0,0 +1,161 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "dynSmagorinsky.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace LESModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(dynSmagorinsky, 0); +addToRunTimeSelectionTable(LESModel, dynSmagorinsky, dictionary); + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +dimensionedScalar dynSmagorinsky::cD(const volSymmTensorField& D) const +{ + volSymmTensorField LL = dev(filter_(sqr(U())) - (sqr(filter_(U())))); + + volSymmTensorField MM = + sqr(delta())*(filter_(mag(D)*(D)) - 4*mag(filter_(D))*filter_(D)); + + dimensionedScalar MMMM = average(magSqr(MM)); + + if (MMMM.value() > VSMALL) + { + return average(LL && MM)/MMMM; + } + else + { + return 0.0; + } +} + + +dimensionedScalar dynSmagorinsky::cI(const volSymmTensorField& D) const +{ + volScalarField KK = 0.5*(filter_(magSqr(U())) - magSqr(filter_(U()))); + + volScalarField mm = + sqr(delta())*(4*sqr(mag(filter_(D))) - filter_(sqr(mag(D)))); + + dimensionedScalar mmmm = average(magSqr(mm)); + + if (mmmm.value() > VSMALL) + { + return average(KK*mm)/mmmm; + } + else + { + return 0.0; + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +dynSmagorinsky::dynSmagorinsky +( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport +) +: + LESModel(typeName, U, phi, transport), + GenEddyVisc(U, phi, transport), + + k_ + ( + IOobject + ( + "k", + runTime_.timeName(), + mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh_ + ), + + filterPtr_(LESfilter::New(U.mesh(), coeffDict())), + filter_(filterPtr_()) +{ + printCoeffs(); +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +dynSmagorinsky::~dynSmagorinsky() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void dynSmagorinsky::correct(const tmp<volTensorField>& gradU) +{ + LESModel::correct(gradU); + + volSymmTensorField D = dev(symm(gradU)); + volScalarField magSqrD = magSqr(D); + + k_ = cI(D)*sqr(delta())*magSqrD; + + nuSgs_ = cD(D)*sqr(delta())*sqrt(magSqrD); + nuSgs_.correctBoundaryConditions(); +} + + +bool dynSmagorinsky::read() +{ + if (GenEddyVisc::read()) + { + filter_.read(coeffDict()); + + return true; + } + else + { + return false; + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/LES/dynSmagorinsky/dynSmagorinsky.H b/src/turbulenceModels/incompressible/LES/dynSmagorinsky/dynSmagorinsky.H new file mode 100644 index 00000000000..bf8159609ba --- /dev/null +++ b/src/turbulenceModels/incompressible/LES/dynSmagorinsky/dynSmagorinsky.H @@ -0,0 +1,154 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::incompressible::LESModels::dynSmagorinsky + +Description + The Isochoric dynamic Smagorinsky Model for incompressible flows. + + Algebraic eddy viscosity SGS model founded on the assumption that + local equilibrium prevails. + Thus, + @verbatim + B = 2/3*k*I - 2*nuSgs*dev(D) + Beff = 2/3*k*I - 2*nuEff*dev(D) + + where + + k = cI*delta^2*||D||^2 + nuSgs = cD*delta^2*||D|| + nuEff = nuSgs + nu + + In the dynamic version of the choric Smagorinsky model + the coefficients cI and cD are calculated during the simulation, + + cI=<K*m>/<m*m> + + and + + cD=<L.M>/<M.M>, + + where + + K = 0.5*(F(U.U) - F(U).F(U)) + m = delta^2*(4*||F(D)||^2 - F(||D||^2)) + L = dev(F(U*U) - F(U)*F(U)) + M = delta^2*(F(||D||*dev(D)) - 4*||F(D)||*F(dev(D))) + @endverbatim + +SourceFiles + dynSmagorinsky.C + +\*---------------------------------------------------------------------------*/ + +#ifndef dynSmagorinsky_H +#define dynSmagorinsky_H + +#include "Smagorinsky.H" +#include "LESfilter.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace LESModels +{ + +/*---------------------------------------------------------------------------*\ + Class dynSmagorinsky Declaration +\*---------------------------------------------------------------------------*/ + +class dynSmagorinsky +: + public GenEddyVisc +{ + // Private data + + volScalarField k_; + + autoPtr<LESfilter> filterPtr_; + LESfilter& filter_; + + + // Private Member Functions + + //- Calculate coefficients cD, cI from filtering velocity field + dimensionedScalar cD(const volSymmTensorField& D) const; + dimensionedScalar cI(const volSymmTensorField& D) const; + + // Disallow default bitwise copy construct and assignment + dynSmagorinsky(const dynSmagorinsky&); + dynSmagorinsky& operator=(const dynSmagorinsky&); + + +public: + + //- Runtime type information + TypeName("dynSmagorinsky"); + + // Constructors + + //- Construct from components + dynSmagorinsky + ( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport + ); + + + //- Destructor + virtual ~dynSmagorinsky(); + + + // Member Functions + + //- Return SGS kinetic energy + virtual tmp<volScalarField> k() const + { + return k_; + } + + //- Correct Eddy-Viscosity and related properties + virtual void correct(const tmp<volTensorField>& gradU); + + //- Read turbulenceProperties dictionary + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.C b/src/turbulenceModels/incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.C new file mode 100644 index 00000000000..3460137709a --- /dev/null +++ b/src/turbulenceModels/incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.C @@ -0,0 +1,454 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "kOmegaSSTSAS.H" +#include "addToRunTimeSelectionTable.H" +#include "wallDist.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace LESModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(kOmegaSSTSAS, 0); +addToRunTimeSelectionTable(LESModel, kOmegaSSTSAS, dictionary); + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +tmp<volScalarField> kOmegaSSTSAS::F1(const volScalarField& CDkOmega) const +{ + volScalarField CDkOmegaPlus = max + ( + CDkOmega, + dimensionedScalar("1.0e-10", dimless/sqr(dimTime), 1.0e-10) + ); + + volScalarField arg1 = min + ( + min + ( + max + ( + (scalar(1)/betaStar_)*sqrt(k_)/(omega_*y_), + scalar(500)*nu()/(sqr(y_)*omega_) + ), + (4*alphaOmega2_)*k_/(CDkOmegaPlus*sqr(y_)) + ), + scalar(10) + ); + + return tanh(pow4(arg1)); +} + + +tmp<volScalarField> kOmegaSSTSAS::F2() const +{ + volScalarField arg2 = min + ( + max + ( + (scalar(2)/betaStar_)*sqrt(k_)/(omega_*y_), + scalar(500)*nu()/(sqr(y_)*omega_) + ), + scalar(100) + ); + + return tanh(sqr(arg2)); +} + + +tmp<volScalarField> kOmegaSSTSAS::Lvk2 +( + const volScalarField& S2 +) const +{ + return kappa_*sqrt(S2) + /( + mag(fvc::laplacian(U())) + + dimensionedScalar + ( + "ROOTVSMALL", + dimensionSet(0, -1 , -1, 0, 0, 0, 0), + ROOTVSMALL + ) + ); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +kOmegaSSTSAS::kOmegaSSTSAS +( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport, + const word& modelName +) +: + LESModel(modelName, U, phi, transport), + + alphaK1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphaK1", + coeffDict(), + 0.85034 + ) + ), + alphaK2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphaK2", + coeffDict(), + 1.0 + ) + ), + alphaOmega1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphaOmega1", + coeffDict(), + 0.5 + ) + ), + alphaOmega2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphaOmega2", + coeffDict(), + 0.85616 + ) + ), + gamma1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "gamma1", + coeffDict(), + 0.5532 + ) + ), + gamma2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "gamma2", + coeffDict(), + 0.4403 + ) + ), + beta1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "beta1", + coeffDict(), + 0.075 + ) + ), + beta2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "beta2", + coeffDict(), + 0.0828 + ) + ), + betaStar_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "betaStar", + coeffDict(), + 0.09 + ) + ), + a1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "a1", + coeffDict(), + 0.31 + ) + ), + c1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "c1", + coeffDict(), + 10.0 + ) + ), + alphaPhi_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphaPhi", + coeffDict(), + 0.666667 + ) + ), + zetaTilda2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "zetaTilda2", + coeffDict(), + 1.755 + ) + ), + FSAS_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "FSAS", + coeffDict(), + 1.25 + ) + ), + + omega0_("omega0", dimless/dimTime, SMALL), + omegaSmall_("omegaSmall", dimless/dimTime, SMALL), + y_(mesh_), + Cmu_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Cmu", + coeffDict(), + 0.09 + ) + ), + kappa_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "kappa", + *this, + 0.4187 + ) + ), + + k_ + ( + IOobject + ( + "k", + runTime_.timeName(), + mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh_ + ), + + omega_ + ( + IOobject + ( + "omega", + runTime_.timeName(), + mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh_ + ), + + nuSgs_ + ( + IOobject + ( + "nuSgs", + runTime_.timeName(), + mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh_ + ) +{ + printCoeffs(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void kOmegaSSTSAS::correct(const tmp<volTensorField>& gradU) +{ + LESModel::correct(gradU); + + if (mesh_.changing()) + { + y_.correct(); + } + + volScalarField S2 = magSqr(symm(gradU())); + gradU.clear(); + + volVectorField gradK = fvc::grad(k_); + volVectorField gradOmega = fvc::grad(omega_); + volScalarField L = sqrt(k_)/(pow(Cmu_, 0.25)*(omega_ + omegaSmall_)); + volScalarField CDkOmega = (2.0*alphaOmega2_)*(gradK & gradOmega)/(omega_ + omegaSmall_); + volScalarField F1 = this->F1(CDkOmega); + volScalarField G = nuSgs_*2.0*S2; + + // Turbulent kinetic energy equation + { + fvScalarMatrix kEqn + ( + fvm::ddt(k_) + + fvm::div(phi(), k_) + - fvm::Sp(fvc::div(phi()), k_) + - fvm::laplacian(DkEff(F1), k_) + == + min(G, c1_*betaStar_*k_*omega_) + - fvm::Sp(betaStar_*omega_, k_) + ); + + kEqn.relax(); + kEqn.solve(); + } + bound(k_, k0()); + + volScalarField grad_omega_k = max + ( + magSqr(gradOmega)/ + sqr(omega_ + omegaSmall_), + magSqr(gradK)/ + sqr(k_ + k0()) + ); + + // Turbulent frequency equation + { + fvScalarMatrix omegaEqn + ( + fvm::ddt(omega_) + + fvm::div(phi(), omega_) + - fvm::Sp(fvc::div(phi()), omega_) + - fvm::laplacian(DomegaEff(F1), omega_) + == + gamma(F1)*2.0*S2 + - fvm::Sp(beta(F1)*omega_, omega_) + - fvm::SuSp // cross diffusion term + ( + (F1 - scalar(1))*CDkOmega/omega_, + omega_ + ) + + FSAS_ + *max + ( + dimensionedScalar("zero",dimensionSet(0, 0 , -2, 0, 0),0. ), + zetaTilda2_*kappa_*S2*(L/Lvk2(S2))- 2.0/alphaPhi_*k_*grad_omega_k + ) + ); + + omegaEqn.relax(); + omegaEqn.solve(); + } + bound(omega_, omega0_); + + // Re-calculate viscosity + nuSgs_ == a1_*k_/max(a1_*omega_, F2()*sqrt(S2)); + nuSgs_.correctBoundaryConditions(); +} + + +tmp<volScalarField> kOmegaSSTSAS::epsilon() const +{ + return 2.0*nuEff()*magSqr(symm(fvc::grad(U()))); +} + + +tmp<volSymmTensorField> kOmegaSSTSAS::B() const +{ + return ((2.0/3.0)*I)*k() - nuSgs()*twoSymm(fvc::grad(U())); +} + + +tmp<volSymmTensorField> kOmegaSSTSAS::devBeff() const +{ + return -nuEff()*dev(twoSymm(fvc::grad(U()))); +} + + +tmp<fvVectorMatrix> kOmegaSSTSAS::divDevBeff(volVectorField& U) const +{ + return + ( + - fvm::laplacian(nuEff(), U) - fvc::div(nuEff()*dev(fvc::grad(U)().T())) + ); +} + + +bool kOmegaSSTSAS::read() +{ + if (LESModel::read()) + { + alphaK1_.readIfPresent(coeffDict()); + alphaK2_.readIfPresent(coeffDict()); + alphaOmega1_.readIfPresent(coeffDict()); + alphaOmega2_.readIfPresent(coeffDict()); + gamma1_.readIfPresent(coeffDict()); + gamma2_.readIfPresent(coeffDict()); + beta1_.readIfPresent(coeffDict()); + beta2_.readIfPresent(coeffDict()); + betaStar_.readIfPresent(coeffDict()); + a1_.readIfPresent(coeffDict()); + c1_.readIfPresent(coeffDict()); + alphaPhi_.readIfPresent(coeffDict()); + zetaTilda2_.readIfPresent(coeffDict()); + FSAS_.readIfPresent(coeffDict()); + + return true; + } + else + { + return false; + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.H b/src/turbulenceModels/incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.H new file mode 100644 index 00000000000..56e395ff4cc --- /dev/null +++ b/src/turbulenceModels/incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.H @@ -0,0 +1,258 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::LESmodels::kOmegaSSTSAS + +Description + kOmegaSSTSAS LES turbulence model for incompressible flows + + Note: does not have an explicit dependency on spatial discretisation + i.e. LESdelta not used. + +SourceFiles + kOmegaSSTSAS.C + +\*---------------------------------------------------------------------------*/ + +#ifndef kOmegaSSTSAS_H +#define kOmegaSSTSAS_H + +#include "LESModel.H" +#include "volFields.H" +#include "wallDist.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace LESModels +{ + +/*---------------------------------------------------------------------------*\ + Class kOmegaSSTSAS Declaration +\*---------------------------------------------------------------------------*/ + +class kOmegaSSTSAS +: + public LESModel +{ + // Private member functions + + // Disallow default bitwise copy construct and assignment + kOmegaSSTSAS(const kOmegaSSTSAS&); + kOmegaSSTSAS& operator=(const kOmegaSSTSAS&); + + +protected: + + // Protected data + + // Model constants + + dimensionedScalar alphaK1_; + dimensionedScalar alphaK2_; + + dimensionedScalar alphaOmega1_; + dimensionedScalar alphaOmega2_; + + dimensionedScalar gamma1_; + dimensionedScalar gamma2_; + + dimensionedScalar beta1_; + dimensionedScalar beta2_; + + dimensionedScalar betaStar_; + + dimensionedScalar a1_; + dimensionedScalar c1_; + + dimensionedScalar alphaPhi_; + dimensionedScalar zetaTilda2_; + dimensionedScalar FSAS_; + + dimensionedScalar omega0_; + dimensionedScalar omegaSmall_; + + wallDist y_; + dimensionedScalar Cmu_; + dimensionedScalar kappa_; + + + // Fields + + volScalarField k_; + volScalarField omega_; + volScalarField nuSgs_; + + + // Protected member functions + + tmp<volScalarField> Lvk2 + ( + const volScalarField& S2 + ) const; + + tmp<volScalarField> F1(const volScalarField& CDkOmega) const; + tmp<volScalarField> F2() const; + + tmp<volScalarField> blend + ( + const volScalarField& F1, + const dimensionedScalar& psi1, + const dimensionedScalar& psi2 + ) const + { + return F1*(psi1 - psi2) + psi2; + } + + tmp<volScalarField> alphaK + ( + const volScalarField& F1 + ) const + { + return blend(F1, alphaK1_, alphaK2_); + } + + tmp<volScalarField> alphaOmega + ( + const volScalarField& F1 + ) const + { + return blend(F1, alphaOmega1_, alphaOmega2_); + } + + tmp<volScalarField> beta + ( + const volScalarField& F1 + ) const + { + return blend(F1, beta1_, beta2_); + } + + tmp<volScalarField> gamma + ( + const volScalarField& F1 + ) const + { + return blend(F1, gamma1_, gamma2_); + } + + +public: + + //- Runtime type information + TypeName("kOmegaSSTSAS"); + + + // Constructors + + //- Construct from components + kOmegaSSTSAS + ( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport, + const word& modelName = typeName + ); + + + //- Destructor + virtual ~kOmegaSSTSAS() + {} + + + // Member Functions + + //- Return SGS kinetic energy + virtual tmp<volScalarField> k() const + { + return k_; + } + + //- Return omega + virtual tmp<volScalarField> omega() const + { + return omega_; + } + + //- Return the effective diffusivity for k + tmp<volScalarField> DkEff(const volScalarField& F1) const + { + return tmp<volScalarField> + ( + new volScalarField("DkEff", alphaK(F1)*nuSgs_ + nu()) + ); + } + + //- Return the effective diffusivity for omega + tmp<volScalarField> DomegaEff(const volScalarField& F1) const + { + return tmp<volScalarField> + ( + new volScalarField("DomegaEff", alphaOmega(F1)*nuSgs_ + nu()) + ); + } + + //- Return sub-grid disipation rate + virtual tmp<volScalarField> epsilon() const; + + //- Return SGS viscosity + virtual tmp<volScalarField> nuSgs() const + { + return nuSgs_; + } + + //- Return the sub-grid stress tensor. + virtual tmp<volSymmTensorField> B() const; + + //- Return the effective sub-grid turbulence stress tensor + // including the laminar stress + virtual tmp<volSymmTensorField> devBeff() const; + + //- Return the deviatoric part of the divergence of Beff + // i.e. the additional term in the filtered NSE. + virtual tmp<fvVectorMatrix> divDevBeff(volVectorField& U) const; + + //- Solve the turbulence equations (k-w) and correct the turbulence viscosity + virtual void correct(const tmp<volTensorField>& gradU); + + //- Read turbulenceProperties dictionary + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/LES/laminar/laminar.C b/src/turbulenceModels/incompressible/LES/laminar/laminar.C new file mode 100644 index 00000000000..a57d5912d52 --- /dev/null +++ b/src/turbulenceModels/incompressible/LES/laminar/laminar.C @@ -0,0 +1,166 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "laminar.H" +#include "addToRunTimeSelectionTable.H" +#include "wallDist.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace LESModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(laminar, 0); +addToRunTimeSelectionTable(LESModel, laminar, dictionary); + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +laminar::laminar +( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport +) +: + LESModel(typeName, U, phi, transport) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +tmp<volScalarField> laminar::k() const +{ + return tmp<volScalarField> + ( + new volScalarField + ( + IOobject + ( + "k", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensionedScalar("k", sqr(U().dimensions()), 0.0) + ) + ); +} + +tmp<volScalarField> laminar::epsilon() const +{ + return 2*nu()*magSqr(symm(fvc::grad(U()))); +} + +tmp<volScalarField> laminar::nuSgs() const +{ + return tmp<volScalarField> + ( + new volScalarField + ( + IOobject + ( + "nuSgs", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensionedScalar("nuSgs", nu().dimensions(), 0.0) + ) + ); +} + +tmp<volScalarField> laminar::nuEff() const +{ + return tmp<volScalarField> + ( + new volScalarField("nuEff", nu()) + ); +} + + +tmp<volSymmTensorField> laminar::B() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + "B", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensionedSymmTensor + ( + "B", sqr(U().dimensions()), symmTensor::zero + ) + ) + ); +} + + +tmp<volSymmTensorField> laminar::devBeff() const +{ + return -nu()*dev(twoSymm(fvc::grad(U()))); +} + + +tmp<fvVectorMatrix> laminar::divDevBeff(volVectorField& U) const +{ + return + ( + - fvm::laplacian(nu(), U) - fvc::div(nu()*dev(fvc::grad(U)().T())) + ); +} + + +bool laminar::read() +{ + return LESModel::read(); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/LES/laminar/laminar.H b/src/turbulenceModels/incompressible/LES/laminar/laminar.H new file mode 100644 index 00000000000..bd8c3b2a3bb --- /dev/null +++ b/src/turbulenceModels/incompressible/LES/laminar/laminar.H @@ -0,0 +1,129 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::incompressible::LESModels::laminar + +Description + LES model for laminar incompressible flow. + It simply returns laminar properties. + +SourceFiles + laminar.C + +\*---------------------------------------------------------------------------*/ + +#ifndef laminar_H +#define laminar_H + +#include "LESModel.H" +#include "volFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace LESModels +{ + +/*---------------------------------------------------------------------------*\ + Class laminar Declaration +\*---------------------------------------------------------------------------*/ + +class laminar +: + public LESModel +{ + // Private member functions + + // Disallow default bitwise copy construct and assignment + laminar(const laminar&); + laminar& operator=(const laminar&); + + +public: + + //- Runtime type information + TypeName("laminar"); + + + // Constructors + + //- Construct from components + laminar + ( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport + ); + + + //- Destructor + virtual ~laminar() + {} + + + // Member Functions + + //- Return SGS kinetic energy + virtual tmp<volScalarField> k() const; + + //- Return sub-grid disipation rate + virtual tmp<volScalarField> epsilon() const; + + //- Return SGS viscosity + virtual tmp<volScalarField> nuSgs() const; + + //- Return the effective viscosity + virtual tmp<volScalarField> nuEff() const; + + //- Return the sub-grid stress tensor B. + virtual tmp<volSymmTensorField> B() const; + + //- Return the deviatoric part of the effective sub-grid + // turbulence stress tensor including the laminar stress + virtual tmp<volSymmTensorField> devBeff() const; + + //- Return the deviatoric part of the divergence of Beff + // i.e. the additional term in the filtered NSE. + virtual tmp<fvVectorMatrix> divDevBeff(volVectorField& U) const; + + //- Read turbulenceProperties dictionary + bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/LES/locDynOneEqEddy/locDynOneEqEddy.C b/src/turbulenceModels/incompressible/LES/locDynOneEqEddy/locDynOneEqEddy.C new file mode 100644 index 00000000000..471695ccecf --- /dev/null +++ b/src/turbulenceModels/incompressible/LES/locDynOneEqEddy/locDynOneEqEddy.C @@ -0,0 +1,175 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "locDynOneEqEddy.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace LESModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(locDynOneEqEddy, 0); +addToRunTimeSelectionTable(LESModel, locDynOneEqEddy, dictionary); + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +volScalarField locDynOneEqEddy::ck +( + const volSymmTensorField& D, + const volScalarField& KK +) const +{ + volSymmTensorField LL = + simpleFilter_(dev(filter_(sqr(U())) - (sqr(filter_(U()))))); + + volSymmTensorField MM = simpleFilter_(-2.0*delta()*pow(KK, 0.5)*filter_(D)); + + volScalarField ck = + simpleFilter_(0.5*(LL && MM)) + /( + simpleFilter_(magSqr(MM)) + + dimensionedScalar("small", sqr(MM.dimensions()), VSMALL) + ); + + return 0.5*(mag(ck) + ck); +} + + +volScalarField locDynOneEqEddy::ce +( + const volSymmTensorField& D, + const volScalarField& KK +) const +{ + volScalarField ce = + simpleFilter_(nuEff()*(filter_(magSqr(D)) - magSqr(filter_(D)))) + /simpleFilter_(pow(KK, 1.5)/(2.0*delta())); + + return 0.5*(mag(ce) + ce); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +locDynOneEqEddy::locDynOneEqEddy +( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport +) +: + LESModel(typeName, U, phi, transport), + GenEddyVisc(U, phi, transport), + + k_ + ( + IOobject + ( + "k", + runTime_.timeName(), + mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh_ + ), + + simpleFilter_(U.mesh()), + filterPtr_(LESfilter::New(U.mesh(), coeffDict())), + filter_(filterPtr_()) +{ + printCoeffs(); +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +locDynOneEqEddy::~locDynOneEqEddy() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void locDynOneEqEddy::correct(const tmp<volTensorField>& gradU) +{ + LESModel::correct(gradU); + + volSymmTensorField D = symm(gradU); + + volScalarField KK = 0.5*(filter_(magSqr(U())) - magSqr(filter_(U()))); + KK.max(dimensionedScalar("small", KK.dimensions(), SMALL)); + + volScalarField P = 2.0*nuSgs_*magSqr(D); + + fvScalarMatrix kEqn + ( + fvm::ddt(k_) + + fvm::div(phi(), k_) + - fvm::laplacian(DkEff(), k_) + == + P + - fvm::Sp(ce(D, KK)*sqrt(k_)/delta(), k_) + ); + + kEqn.relax(); + kEqn.solve(); + + bound(k_, k0()); + + nuSgs_ = ck(D, KK)*sqrt(k_)*delta(); + nuSgs_.correctBoundaryConditions(); +} + + +bool locDynOneEqEddy::read() +{ + if (GenEddyVisc::read()) + { + filter_.read(coeffDict()); + + return true; + } + else + { + return false; + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/LES/locDynOneEqEddy/locDynOneEqEddy.H b/src/turbulenceModels/incompressible/LES/locDynOneEqEddy/locDynOneEqEddy.H new file mode 100644 index 00000000000..f751fc8f6de --- /dev/null +++ b/src/turbulenceModels/incompressible/LES/locDynOneEqEddy/locDynOneEqEddy.H @@ -0,0 +1,172 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::incompressible::LESModels::locDynOneEqEddy + +Description + Localised Dynamic One Equation Eddy Viscosity Model for incompressible + flows + + Eddy viscosity SGS model using a modeled balance equation to simulate + the behaviour of k, hence + @verbatim + d/dt(k) + div(U*k) - div(nuSgs*grad(k)) + = + -B*L - ce*rho*k^3/2/delta + and + B = 2/3*k*I - 2*nuSgs*dev(D) + Beff = 2/3*k*I - 2*nuEff*dev(D) + where + nuSgs = cD*delta^2*||D|| + nuEff = nuSgs + nu + @endverbatim + + A dynamic procedure is here applied to evaluate ck and ce + @verbatim + ck=<L.M>/<M.M> + and + ce=<e*m>/<m*m> + where + K = 0.5*(F(U.U) - F(U).F(U)) + L = (F(U*U) - F(U)*F(U) - 0.33*K*I) + M = delta*(F(sqrt(k)*D) - 2*sqrt(K + filter(k))*F(D)) + m = pow(K + F(k), 3.0/2.0)/(2*delta) - F(pow(k, 3.0/2.0))/delta + e = 2*delta*ck*(F(sqrt(k)*(D && D)) - 2*sqrt(K + F(k))*(F(D) && F(D)))/ + @endverbatim + +SourceFiles + locDynOneEqEddy.C + +\*---------------------------------------------------------------------------*/ + +#ifndef locDynOneEqEddy_H +#define locDynOneEqEddy_H + +#include "GenEddyVisc.H" +#include "simpleFilter.H" +#include "LESfilter.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace LESModels +{ + +/*---------------------------------------------------------------------------*\ + Class locDynOneEqEddy Declaration +\*---------------------------------------------------------------------------*/ + +class locDynOneEqEddy +: + public GenEddyVisc +{ + // Private data + + volScalarField k_; + + simpleFilter simpleFilter_; + autoPtr<LESfilter> filterPtr_; + LESfilter& filter_; + + + // Private Member Functions + + //- Calculate ck, ce by filtering the velocity field U. + volScalarField ck + ( + const volSymmTensorField&, + const volScalarField& + ) const; + + volScalarField ce + ( + const volSymmTensorField&, + const volScalarField& + ) const; + + // Disallow default bitwise copy construct and assignment + locDynOneEqEddy(const locDynOneEqEddy&); + locDynOneEqEddy& operator=(const locDynOneEqEddy&); + + +public: + + //- Runtime type information + TypeName("locDynOneEqEddy"); + + // Constructors + + //- Construct from components + locDynOneEqEddy + ( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport + ); + + + //- Destructor + virtual ~locDynOneEqEddy(); + + + // Member Functions + + //- Return SGS kinetic energy + virtual tmp<volScalarField> k() const + { + return k_; + } + + //- Return the effective diffusivity for k + tmp<volScalarField> DkEff() const + { + return tmp<volScalarField> + ( + new volScalarField("DkEff", nuSgs_ + nu()) + ); + } + + //- Correct Eddy-Viscosity and related properties + virtual void correct(const tmp<volTensorField>& gradU); + + //- Read turbulenceProperties dictionary + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/LES/mixedSmagorinsky/mixedSmagorinsky.C b/src/turbulenceModels/incompressible/LES/mixedSmagorinsky/mixedSmagorinsky.C new file mode 100644 index 00000000000..c75c769ced6 --- /dev/null +++ b/src/turbulenceModels/incompressible/LES/mixedSmagorinsky/mixedSmagorinsky.C @@ -0,0 +1,145 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "mixedSmagorinsky.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace LESModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(mixedSmagorinsky, 0); +addToRunTimeSelectionTable(LESModel, mixedSmagorinsky, dictionary); + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +mixedSmagorinsky::mixedSmagorinsky +( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport +) +: + LESModel(typeName, U, phi, transport), + scaleSimilarity(U, phi, transport), + Smagorinsky(U, phi, transport) +{ + printCoeffs(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +tmp<volScalarField> mixedSmagorinsky::k() const +{ + return + ( + scaleSimilarity::k() + + Smagorinsky::k() + ); +} + + +tmp<volScalarField> mixedSmagorinsky::epsilon() const +{ + return + ( + scaleSimilarity::epsilon() + + Smagorinsky::epsilon() + ); +} + + +tmp<volSymmTensorField> mixedSmagorinsky::B() const +{ + return + ( + scaleSimilarity::B() + + Smagorinsky::B() + ); +} + + +tmp<volSymmTensorField> mixedSmagorinsky::devBeff() const +{ + return + ( + scaleSimilarity::devBeff() + + Smagorinsky::devBeff() + ); +} + + +tmp<fvVectorMatrix> mixedSmagorinsky::divDevBeff +( + volVectorField& U +) const +{ + return + ( + scaleSimilarity::divDevBeff(U) + + Smagorinsky::divDevBeff(U) + ); +} + + +void mixedSmagorinsky::correct(const tmp<volTensorField>& gradU) +{ + scaleSimilarity::correct(gradU); + Smagorinsky::correct(gradU); +} + + +bool mixedSmagorinsky::read() +{ + if (LESModel::read()) + { + scaleSimilarity::read(); + Smagorinsky::read(); + + return true; + } + else + { + return false; + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/LES/mixedSmagorinsky/mixedSmagorinsky.H b/src/turbulenceModels/incompressible/LES/mixedSmagorinsky/mixedSmagorinsky.H new file mode 100644 index 00000000000..b340b5ca309 --- /dev/null +++ b/src/turbulenceModels/incompressible/LES/mixedSmagorinsky/mixedSmagorinsky.H @@ -0,0 +1,155 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::incompressible::LESModels::mixedSmagorinsky + +Description + The mixed Isochoric Smagorinsky Model for incompressible flows. + + The mixed model is a linear combination of an eddy viscosity model + (Smagorinsky) with a scale similarity model. Hence + @verbatim + B = (L + C) + R = (F(v*v) - F(v)*F(v)) + R + @endverbatim + + The algebraic eddy viscosity SGS model is founded on the assumption + that local equilibrium prevails, hence + @verbatim + R = 2/3*k*I - 2*nuEff*dev(D) + where + k = cI*delta^2*||D||^2 + nuEff = ck*sqrt(k)*delta + nu + @endverbatim + + The Leonard and cross contributions are incorporated + by adding, + @verbatim + + div(((filter(U*U) - filter(U)*filter(U)) - + 0.333*I*tr(filter(U*U) - filter(U)*filter(U)))) + + div((filter(U*epsilon) - filter(U)*filter(epsilon))) + @endverbatim + to the rhs. of the equations. + +SourceFiles + mixedSmagorinsky.C + +\*---------------------------------------------------------------------------*/ + +#ifndef mixedSmagorinsky_H +#define mixedSmagorinsky_H + +#include "scaleSimilarity.H" +#include "Smagorinsky.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace LESModels +{ + +/*---------------------------------------------------------------------------*\ + Class mixedSmagorinsky Declaration +\*---------------------------------------------------------------------------*/ + +class mixedSmagorinsky +: + public scaleSimilarity, + public Smagorinsky +{ + // Private Member Functions + + // Disallow default bitwise copy construct and assignment + mixedSmagorinsky(const mixedSmagorinsky&); + mixedSmagorinsky& operator=(const mixedSmagorinsky&); + +public: + + //- Runtime type information + TypeName("mixedSmagorinsky"); + + + // Constructors + + //- Construct from components + mixedSmagorinsky + ( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport + ); + + + //- Destructor + virtual ~mixedSmagorinsky() + {} + + + // Member Functions + + //- Return the SGS turbulent kinetic energy. + virtual tmp<volScalarField> k() const; + + //- Return the SGS turbulent disipation rate. + virtual tmp<volScalarField> epsilon() const; + + //- Return the SGS viscosity. + virtual tmp<volScalarField> nuSgs() const + { + return nuSgs_; + } + + //- Return the sub-grid stress tensor. + virtual tmp<volSymmTensorField> B() const; + + //- Return the effective sub-grid turbulence stress tensor + // including the laminar stress + virtual tmp<volSymmTensorField> devBeff() const; + + //- Implementation of div(B). This is necessary to override + // (and include) the div(B) terms from both the parent classes. + virtual tmp<fvVectorMatrix> divDevBeff(volVectorField& U) const; + + //- Correct Eddy-Viscosity and related properties + virtual void correct(const tmp<volTensorField>& gradU); + + //- Read turbulenceProperties dictionary + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/LES/oneEqEddy/oneEqEddy.C b/src/turbulenceModels/incompressible/LES/oneEqEddy/oneEqEddy.C new file mode 100644 index 00000000000..be020ae572f --- /dev/null +++ b/src/turbulenceModels/incompressible/LES/oneEqEddy/oneEqEddy.C @@ -0,0 +1,132 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "oneEqEddy.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace LESModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(oneEqEddy, 0); +addToRunTimeSelectionTable(LESModel, oneEqEddy, dictionary); + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +oneEqEddy::oneEqEddy +( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport +) +: + LESModel(typeName, U, phi, transport), + GenEddyVisc(U, phi, transport), + + k_ + ( + IOobject + ( + "k", + runTime_.timeName(), + mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh_ + ), + + ck_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "ck", + coeffDict(), + 0.094 + ) + ) +{ + printCoeffs(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void oneEqEddy::correct(const tmp<volTensorField>& gradU) +{ + GenEddyVisc::correct(gradU); + + volScalarField G = 2.0*nuSgs_*magSqr(symm(gradU)); + + fvScalarMatrix kEqn + ( + fvm::ddt(k_) + + fvm::div(phi(), k_) + - fvm::laplacian(DkEff(), k_) + == + G + - fvm::Sp(ce_*sqrt(k_)/delta(), k_) + ); + + kEqn.relax(); + kEqn.solve(); + + bound(k_, k0()); + + nuSgs_ = ck_*sqrt(k_)*delta(); + nuSgs_.correctBoundaryConditions(); +} + + +bool oneEqEddy::read() +{ + if (GenEddyVisc::read()) + { + ck_.readIfPresent(coeffDict()); + + return true; + } + else + { + return false; + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/LES/oneEqEddy/oneEqEddy.H b/src/turbulenceModels/incompressible/LES/oneEqEddy/oneEqEddy.H new file mode 100644 index 00000000000..dcb9a9bc2c0 --- /dev/null +++ b/src/turbulenceModels/incompressible/LES/oneEqEddy/oneEqEddy.H @@ -0,0 +1,147 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::incompressible::LESModels::oneEqEddy + +Description + One Equation Eddy Viscosity Model for incompressible flows + + Eddy viscosity SGS model using a modeled balance equation to simulate the + behaviour of k, hence, + @verbatim + d/dt(k) + div(U*k) - div(nuEff*grad(k)) + = + -B*L - ce*k^3/2/delta + + and + + B = 2/3*k*I - 2*nuSgs*dev(D) + Beff = 2/3*k*I - 2*nuEff*dev(D) + + where + + D = symm(grad(U)); + nuSgs = ck*sqrt(k)*delta + nuEff = nuSgs + nu + @endverbatim + +SourceFiles + oneEqEddy.C + +\*---------------------------------------------------------------------------*/ + +#ifndef oneEqEddy_H +#define oneEqEddy_H + +#include "GenEddyVisc.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace LESModels +{ + +/*---------------------------------------------------------------------------*\ + Class oneEqEddy Declaration +\*---------------------------------------------------------------------------*/ + +class oneEqEddy +: + public GenEddyVisc +{ + // Private data + + volScalarField k_; + + dimensionedScalar ck_; + + + // Private Member Functions + + // Disallow default bitwise copy construct and assignment + oneEqEddy(const oneEqEddy&); + oneEqEddy& operator=(const oneEqEddy&); + + +public: + + //- Runtime type information + TypeName("oneEqEddy"); + + // Constructors + + //- Construct from components + oneEqEddy + ( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport + ); + + + //- Destructor + virtual ~oneEqEddy() + {} + + + // Member Functions + + //- Return SGS kinetic energy + virtual tmp<volScalarField> k() const + { + return k_; + } + + //- Return the effective diffusivity for k + tmp<volScalarField> DkEff() const + { + return tmp<volScalarField> + ( + new volScalarField("DkEff", nuSgs_ + nu()) + ); + } + + //- Correct Eddy-Viscosity and related properties + virtual void correct(const tmp<volTensorField>& gradU); + + //- Read turbulenceProperties dictionary + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/LES/scaleSimilarity/scaleSimilarity.C b/src/turbulenceModels/incompressible/LES/scaleSimilarity/scaleSimilarity.C new file mode 100644 index 00000000000..5a247e12df5 --- /dev/null +++ b/src/turbulenceModels/incompressible/LES/scaleSimilarity/scaleSimilarity.C @@ -0,0 +1,124 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "scaleSimilarity.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace LESModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(scaleSimilarity, 0); + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +scaleSimilarity::scaleSimilarity +( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport +) +: + LESModel(typeName, U, phi, transport), + filterPtr_(LESfilter::New(U.mesh(), coeffDict())), + filter_(filterPtr_()) +{ + printCoeffs(); +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +scaleSimilarity::~scaleSimilarity() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +tmp<volScalarField> scaleSimilarity::k() const +{ + return(0.5*(filter_(magSqr(U())) - magSqr(filter_(U())))); +} + + +tmp<volScalarField> scaleSimilarity::epsilon() const +{ + volSymmTensorField D = symm(fvc::grad(U())); + + return((filter_(sqr(U())) - sqr(filter_(U()))) && D); +} + + +tmp<volSymmTensorField> scaleSimilarity::B() const +{ + return(filter_(sqr(U())) - sqr(filter_(U()))); +} + + +tmp<volSymmTensorField> scaleSimilarity::devBeff() const +{ + return dev(B()); +} + + +tmp<fvVectorMatrix> scaleSimilarity::divDevBeff(volVectorField& U) const +{ + return fvm::Su(fvc::div(devBeff()), U); +} + + +void scaleSimilarity::correct(const tmp<volTensorField>&) +{} + + +bool scaleSimilarity::read() +{ + if (LESModel::read()) + { + filter_.read(coeffDict()); + + return true; + } + else + { + return false; + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/LES/scaleSimilarity/scaleSimilarity.H b/src/turbulenceModels/incompressible/LES/scaleSimilarity/scaleSimilarity.H new file mode 100644 index 00000000000..faa2010e594 --- /dev/null +++ b/src/turbulenceModels/incompressible/LES/scaleSimilarity/scaleSimilarity.H @@ -0,0 +1,133 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::incompressible::LESModels::scaleSimilarity + +Description + General base class for all scale similarity models + for incompressible flows. + + Since such models do not work without additional eddy viscosity terms, + this class must be combined with an eddy viscosity model of some form. + +SourceFiles + scaleSimilarity.C + +\*---------------------------------------------------------------------------*/ + +#ifndef scaleSimilarity_H +#define scaleSimilarity_H + +#include "LESModel.H" +#include "LESfilter.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace LESModels +{ + +/*---------------------------------------------------------------------------*\ + Class scaleSimilarity Declaration +\*---------------------------------------------------------------------------*/ + +class scaleSimilarity +: + virtual public LESModel +{ + // Private data + + autoPtr<LESfilter> filterPtr_; + LESfilter& filter_; + + + // Private Member Functions + + // Disallow default bitwise copy construct and assignment + scaleSimilarity(const scaleSimilarity&); + scaleSimilarity& operator=(const scaleSimilarity&); + + +public: + + //- Runtime type information + TypeName("scaleSimilarity"); + + // Constructors + + //- Construct from components + scaleSimilarity + ( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport + ); + + + //- Destructor + virtual ~scaleSimilarity(); + + + // Member Functions + + //- Return the SGS turbulent kinetic energy. + virtual tmp<volScalarField> k() const; + + //- Return the SGS turbulent dissipation. + virtual tmp<volScalarField> epsilon() const; + + //- Return the sub-grid stress tensor. + virtual tmp<volSymmTensorField> B() const; + + //- Return the deviatoric part of the effective sub-grid + // turbulence stress tensor including the laminar stress + virtual tmp<volSymmTensorField> devBeff() const; + + //- Return the deviatoric part of the divergence of Beff + // i.e. the additional term in the filtered NSE. + virtual tmp<fvVectorMatrix> divDevBeff(volVectorField& U) const; + + //- Correct Eddy-Viscosity and related properties + virtual void correct(const tmp<volTensorField>&); + + //- Read turbulenceProperties dictionary + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/LES/spectEddyVisc/spectEddyVisc.C b/src/turbulenceModels/incompressible/LES/spectEddyVisc/spectEddyVisc.C new file mode 100644 index 00000000000..cda43a2ccf4 --- /dev/null +++ b/src/turbulenceModels/incompressible/LES/spectEddyVisc/spectEddyVisc.C @@ -0,0 +1,167 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "spectEddyVisc.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace LESModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(spectEddyVisc, 0); +addToRunTimeSelectionTable(LESModel, spectEddyVisc, dictionary); + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +// from components +spectEddyVisc::spectEddyVisc +( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport +) +: + LESModel(typeName, U, phi, transport), + GenEddyVisc(U, phi, transport), + + + cB_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "cB", + coeffDict(), + 8.22 + ) + ), + cK1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "cK1", + coeffDict(), + 0.83 + ) + ), + cK2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "cK2", + coeffDict(), + 1.03 + ) + ), + cK3_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "cK3", + coeffDict(), + 4.75 + ) + ), + cK4_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "cK4", + coeffDict(), + 2.55 + ) + ) +{ + printCoeffs(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +tmp<volScalarField> spectEddyVisc::k() const +{ + volScalarField Eps = 2*nuEff()*magSqr(symm(fvc::grad(U()))); + + return + cK1_*pow(delta(), 2.0/3.0)*pow(Eps, 2.0/3.0) + *exp(-cK2_*pow(delta(), -4.0/3.0)*nu()/pow(Eps, 1.0/3.0)) + - cK3_*pow(Eps*nu(), 1.0/2.0) + *erfc(cK4_*pow(delta(), -2.0/3.0)*pow(Eps, -1.0/6.0)); +} + + +void spectEddyVisc::correct(const tmp<volTensorField>& gradU) +{ + GenEddyVisc::correct(gradU); + + volScalarField Re = sqr(delta())*mag(symm(gradU))/nu(); + + for (label i=0; i<5; i++) + { + nuSgs_ = + nu() + /( + scalar(1) + - exp(-cB_*pow(nu()/(nuSgs_ + nu()), 1.0/3.0)*pow(Re, -2.0/3.0)) + ); + } + + nuSgs_.correctBoundaryConditions(); +} + + +bool spectEddyVisc::read() +{ + if (GenEddyVisc::read()) + { + cB_.readIfPresent(coeffDict()); + cK1_.readIfPresent(coeffDict()); + cK2_.readIfPresent(coeffDict()); + cK3_.readIfPresent(coeffDict()); + cK4_.readIfPresent(coeffDict()); + + return true; + } + else + { + return false; + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/LES/spectEddyVisc/spectEddyVisc.H b/src/turbulenceModels/incompressible/LES/spectEddyVisc/spectEddyVisc.H new file mode 100644 index 00000000000..d7a99b75f8b --- /dev/null +++ b/src/turbulenceModels/incompressible/LES/spectEddyVisc/spectEddyVisc.H @@ -0,0 +1,137 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::incompressible::LESModels::spectEddyVisc + +Description + The Isochoric spectral Eddy Viscosity Model for incompressible flows. + + Algebraic eddy viscosity SGS model founded on the assumption that + local equilibrium prevail and that viscous effects may be of importance. + + Thus, + @verbatim + B = 2/3*k*I - 2*nuSgs*dev(D) + Beff = 2/3*k*I - 2*nuEff*dev(D) + + where + + k = cK1*delta^(2/3)*eps^(2/3)*exp(-cK2*delta^(4/3)*nu*eps^(-1/3)) - + ck3*sqrt(eps*nu)*erfc(ck4*delta^(-2/3)*sqrt(nu)*eps^(-1/6))) + + nuEff = nu/(1 - exp(-cB*pow((nu/nuEff), 1.0/3.0)*pow(Re, -2.0/3.0))) + nuSgs = nuEff - nu + + Re = delta^2*mag(D)/nu + @endverbatim + +SourceFiles + spectEddyVisc.C + +\*---------------------------------------------------------------------------*/ + +#ifndef spectEddyVisc_H +#define spectEddyVisc_H + +#include "GenEddyVisc.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace LESModels +{ + +/*---------------------------------------------------------------------------*\ + Class spectEddyVisc Declaration +\*---------------------------------------------------------------------------*/ + +class spectEddyVisc +: + public GenEddyVisc +{ + // Private data + + dimensionedScalar cB_; + dimensionedScalar cK1_; + dimensionedScalar cK2_; + dimensionedScalar cK3_; + dimensionedScalar cK4_; + + + // Private Member Functions + + // Disallow default bitwise copy construct and assignment + spectEddyVisc(const spectEddyVisc&); + spectEddyVisc& operator=(const spectEddyVisc&); + + +public: + + //- Runtime type information + TypeName("spectEddyVisc"); + + // Constructors + + // Construct from components + spectEddyVisc + ( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport + ); + + + //- Destructor + virtual ~spectEddyVisc() + {} + + + // Member Functions + + //- Return SGS kinetic energy + virtual tmp<volScalarField> k() const; + + //- Correct Eddy-Viscosity and related properties + virtual void correct(const tmp<volTensorField>&); + + //- Read turbulenceProperties dictionary + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/LES/vanDriestDelta/vanDriestDelta.C b/src/turbulenceModels/incompressible/LES/vanDriestDelta/vanDriestDelta.C new file mode 100644 index 00000000000..da55d3518bc --- /dev/null +++ b/src/turbulenceModels/incompressible/LES/vanDriestDelta/vanDriestDelta.C @@ -0,0 +1,151 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "vanDriestDelta.H" +#include "LESModel.H" +#include "wallFvPatch.H" +#include "wallDistData.H" +#include "wallPointYPlus.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace LESModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(vanDriestDelta, 0); +addToRunTimeSelectionTable(LESdelta, vanDriestDelta, dictionary); + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +void vanDriestDelta::calcDelta() +{ + const LESModel& sgsModel + = mesh_.lookupObject<LESModel>("LESProperties"); + + const volVectorField& U = sgsModel.U(); + const volScalarField& nu = sgsModel.nu(); + tmp<volScalarField> nuSgs = sgsModel.nuSgs(); + + volScalarField ystar + ( + IOobject + ( + "ystar", + mesh_.time().constant(), + mesh_ + ), + mesh_, + dimensionedScalar("ystar", dimLength, GREAT) + ); + + const fvPatchList& patches = mesh_.boundary(); + forAll(patches, patchi) + { + if (isType<wallFvPatch>(patches[patchi])) + { + const fvPatchVectorField& Uw = U.boundaryField()[patchi]; + const scalarField& nuw = nu.boundaryField()[patchi]; + const scalarField& nuSgsw = nuSgs().boundaryField()[patchi]; + + ystar.boundaryField()[patchi] = + nuw/sqrt((nuw + nuSgsw)*mag(Uw.snGrad()) + VSMALL); + } + } + + wallPointYPlus::yPlusCutOff = 500; + wallDistData<wallPointYPlus> y(mesh_, ystar); + + delta_ = min + ( + static_cast<const volScalarField&>(geometricDelta_()), + (kappa_/Cdelta_)*((scalar(1) + SMALL) - exp(-y/ystar/Aplus_))*y + ); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +vanDriestDelta::vanDriestDelta +( + const word& name, + const fvMesh& mesh, + const dictionary& dd +) +: + LESdelta(name, mesh), + geometricDelta_ + ( + LESdelta::New("geometricDelta", mesh, dd.subDict(type() + "Coeffs")) + ), + kappa_(dd.lookupOrDefault<scalar>("kappa", 0.4187)), + Aplus_ + ( + dd.subDict(type() + "Coeffs").lookupOrDefault<scalar>("Aplus", 26.0) + ), + Cdelta_ + ( + dd.subDict(type() + "Coeffs").lookupOrDefault<scalar>("Cdelta", 0.158) + ) +{ + delta_ = geometricDelta_(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void vanDriestDelta::read(const dictionary& d) +{ + const dictionary& dd(d.subDict(type() + "Coeffs")); + + geometricDelta_().read(dd); + d.readIfPresent<scalar>("kappa", kappa_); + dd.readIfPresent<scalar>("Aplus", Aplus_); + dd.readIfPresent<scalar>("Cdelta", Cdelta_); + calcDelta(); +} + + +void vanDriestDelta::correct() +{ + geometricDelta_().correct(); + calcDelta(); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/LES/vanDriestDelta/vanDriestDelta.H b/src/turbulenceModels/incompressible/LES/vanDriestDelta/vanDriestDelta.H new file mode 100644 index 00000000000..66fe691c103 --- /dev/null +++ b/src/turbulenceModels/incompressible/LES/vanDriestDelta/vanDriestDelta.H @@ -0,0 +1,113 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::incompressible::LESModels::vanDriestDelta + +Description + Simple cube-root of cell volume delta used in incompressible LES models. + +SourceFiles + vanDriestDelta.C + +\*---------------------------------------------------------------------------*/ + +#ifndef vanDriestDelta_H +#define vanDriestDelta_H + +#include "LESdelta.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace LESModels +{ + +/*---------------------------------------------------------------------------*\ + Class vanDriestDelta Declaration +\*---------------------------------------------------------------------------*/ + +class vanDriestDelta +: + public LESdelta +{ + // Private data + + autoPtr<LESdelta> geometricDelta_; + scalar kappa_; + scalar Aplus_; + scalar Cdelta_; + + + // Private Member Functions + + //- Disallow default bitwise copy construct and assignment + vanDriestDelta(const vanDriestDelta&); + void operator=(const vanDriestDelta&); + + // Calculate the delta values + void calcDelta(); + + +public: + + //- Runtime type information + TypeName("vanDriest"); + + + // Constructors + + //- Construct from name, mesh and IOdictionary + vanDriestDelta(const word& name, const fvMesh& mesh, const dictionary&); + + + //- Destructor + virtual ~vanDriestDelta() + {} + + + // Member Functions + + //- Read the LESdelta dictionary + virtual void read(const dictionary&); + + // Correct values + virtual void correct(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace LESModels +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/LRR/LRR.C b/src/turbulenceModels/incompressible/RAS/LRR/LRR.C new file mode 100644 index 00000000000..937b4b36d2d --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/LRR/LRR.C @@ -0,0 +1,430 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "LRR.H" +#include "addToRunTimeSelectionTable.H" +#include "wallFvPatch.H" + +#include "backwardsCompatibilityWallFunctions.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(LRR, 0); +addToRunTimeSelectionTable(RASModel, LRR, dictionary); + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +LRR::LRR +( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& lamTransportModel +) +: + RASModel(typeName, U, phi, lamTransportModel), + + Cmu_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Cmu", + coeffDict_, + 0.09 + ) + ), + Clrr1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Clrr1", + coeffDict_, + 1.8 + ) + ), + Clrr2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Clrr2", + coeffDict_, + 0.6 + ) + ), + C1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "C1", + coeffDict_, + 1.44 + ) + ), + C2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "C2", + coeffDict_, + 1.92 + ) + ), + Cs_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Cs", + coeffDict_, + 0.25 + ) + ), + Ceps_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Ceps", + coeffDict_, + 0.15 + ) + ), + alphaEps_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphaEps", + coeffDict_, + 0.76923 + ) + ), + couplingFactor_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "couplingFactor", + coeffDict_, + 0.0 + ) + ), + + R_ + ( + IOobject + ( + "R", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + autoCreateR("R", mesh_) + ), + k_ + ( + IOobject + ( + "k", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + autoCreateK("k", mesh_) + ), + epsilon_ + ( + IOobject + ( + "epsilon", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + autoCreateEpsilon("epsilon", mesh_) + ), + nut_ + ( + IOobject + ( + "nut", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + autoCreateNut("nut", mesh_) + ) +{ + nut_ == Cmu_*sqr(k_)/(epsilon_ + epsilonSmall_); + nut_.correctBoundaryConditions(); + + if (couplingFactor_.value() < 0.0 || couplingFactor_.value() > 1.0) + { + FatalErrorIn + ( + "LRR::LRR" + "(const volVectorField& U, const surfaceScalarField& phi," + "transportModel& lamTransportModel)" + ) << "couplingFactor = " << couplingFactor_ + << " is not in range 0 - 1" << nl + << exit(FatalError); + } + + printCoeffs(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +tmp<volSymmTensorField> LRR::devReff() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + "devRhoReff", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + R_ - nu()*dev(twoSymm(fvc::grad(U_))) + ) + ); +} + + +tmp<fvVectorMatrix> LRR::divDevReff(volVectorField& U) const +{ + if (couplingFactor_.value() > 0.0) + { + return + ( + fvc::div(R_ + couplingFactor_*nut_*fvc::grad(U), "div(R)") + + fvc::laplacian + ( + (1.0 - couplingFactor_)*nut_, + U, + "laplacian(nuEff,U)" + ) + - fvm::laplacian(nuEff(), U) + ); + } + else + { + return + ( + fvc::div(R_) + + fvc::laplacian(nut_, U, "laplacian(nuEff,U)") + - fvm::laplacian(nuEff(), U) + ); + } +} + + +bool LRR::read() +{ + if (RASModel::read()) + { + Cmu_.readIfPresent(coeffDict_); + Clrr1_.readIfPresent(coeffDict_); + Clrr2_.readIfPresent(coeffDict_); + C1_.readIfPresent(coeffDict_); + C2_.readIfPresent(coeffDict_); + Cs_.readIfPresent(coeffDict_); + Ceps_.readIfPresent(coeffDict_); + alphaEps_.readIfPresent(coeffDict_); + + couplingFactor_.readIfPresent(coeffDict_); + + if (couplingFactor_.value() < 0.0 || couplingFactor_.value() > 1.0) + { + FatalErrorIn("LRR::read()") + << "couplingFactor = " << couplingFactor_ + << " is not in range 0 - 1" + << exit(FatalError); + } + + return true; + } + else + { + return false; + } +} + + +void LRR::correct() +{ + RASModel::correct(); + + if (!turbulence_) + { + return; + } + + volSymmTensorField P = -twoSymm(R_ & fvc::grad(U_)); + volScalarField G("G", 0.5*tr(P)); + + // Update espsilon and G at the wall + epsilon_.boundaryField().updateCoeffs(); + + // Dissipation equation + tmp<fvScalarMatrix> epsEqn + ( + fvm::ddt(epsilon_) + + fvm::div(phi_, epsilon_) + //- fvm::laplacian(Ceps*(K/epsilon_)*R, epsilon_) + - fvm::laplacian(DepsilonEff(), epsilon_) + == + C1_*G*epsilon_/k_ + - fvm::Sp(C2_*epsilon_/k_, epsilon_) + ); + + epsEqn().relax(); + + epsEqn().boundaryManipulate(epsilon_.boundaryField()); + + solve(epsEqn); + bound(epsilon_, epsilon0_); + + + // Reynolds stress equation + + const fvPatchList& patches = mesh_.boundary(); + + forAll(patches, patchi) + { + const fvPatch& curPatch = patches[patchi]; + + if (typeid(curPatch) == typeid(wallFvPatch)) + { + forAll(curPatch, facei) + { + label faceCelli = curPatch.faceCells()[facei]; + P[faceCelli] + *= min(G[faceCelli]/(0.5*tr(P[faceCelli]) + SMALL), 1.0); + } + } + } + + + tmp<fvSymmTensorMatrix> REqn + ( + fvm::ddt(R_) + + fvm::div(phi_, R_) + //- fvm::laplacian(Cs*(k_/epsilon_)*R_, R_) + - fvm::laplacian(DREff(), R_) + + fvm::Sp(Clrr1_*epsilon_/k_, R_) + == + P + - (2.0/3.0*(1 - Clrr1_)*I)*epsilon_ + - Clrr2_*dev(P) + ); + + REqn().relax(); + solve(REqn); + + R_.max + ( + dimensionedSymmTensor + ( + "zero", + R_.dimensions(), + symmTensor + ( + k0_.value(), -GREAT, -GREAT, + k0_.value(), -GREAT, + k0_.value() + ) + ) + ); + + k_ = 0.5*tr(R_); + bound(k_, k0_); + + + // Re-calculate viscosity + nut_ == Cmu_*sqr(k_)/epsilon_; + nut_.correctBoundaryConditions(); + + + // Correct wall shear stresses + + forAll(patches, patchi) + { + const fvPatch& curPatch = patches[patchi]; + + if (typeid(curPatch) == typeid(wallFvPatch)) + { + symmTensorField& Rw = R_.boundaryField()[patchi]; + + const scalarField& nutw = nut_.boundaryField()[patchi]; + + vectorField snGradU = U_.boundaryField()[patchi].snGrad(); + + const vectorField& faceAreas + = mesh_.Sf().boundaryField()[patchi]; + + const scalarField& magFaceAreas + = mesh_.magSf().boundaryField()[patchi]; + + forAll(curPatch, facei) + { + // Calculate near-wall velocity gradient + tensor gradUw + = (faceAreas[facei]/magFaceAreas[facei])*snGradU[facei]; + + // Calculate near-wall shear-stress tensor + tensor tauw = -nutw[facei]*2*symm(gradUw); + + // Reset the shear components of the stress tensor + Rw[facei].xy() = tauw.xy(); + Rw[facei].xz() = tauw.xz(); + Rw[facei].yz() = tauw.yz(); + } + } + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/LRR/LRR.H b/src/turbulenceModels/incompressible/RAS/LRR/LRR.H new file mode 100644 index 00000000000..8d515d4d56c --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/LRR/LRR.H @@ -0,0 +1,187 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::incompressible::RASModels::LRR + +Description + Launder, Reece and Rodi Reynolds-stress turbulence model for + incompressible flows. + + The default model coefficients correspond to the following: + @verbatim + LRRCoeffs + { + Cmu 0.09; + Clrr1 1.8; + Clrr2 0.6; + C1 1.44; + C2 1.92; + Cs 0.25; + Ceps 0.15; + alphah 1.0; // only for compressible + alphaEps 0.76923; + alphaR 1.22; // only for compressible + couplingFactor 0.0; // only for incompressible + } + @endverbatim + +SourceFiles + LRR.C + +\*---------------------------------------------------------------------------*/ + +#ifndef LRR_H +#define LRR_H + +#include "RASModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class LRR Declaration +\*---------------------------------------------------------------------------*/ + +class LRR +: + public RASModel +{ + // Private data + + dimensionedScalar Cmu_; + + dimensionedScalar Clrr1_; + dimensionedScalar Clrr2_; + + dimensionedScalar C1_; + dimensionedScalar C2_; + dimensionedScalar Cs_; + dimensionedScalar Ceps_; + dimensionedScalar alphaEps_; + + dimensionedScalar couplingFactor_; + + volSymmTensorField R_; + volScalarField k_; + volScalarField epsilon_; + volScalarField nut_; + + +public: + + //- Runtime type information + TypeName("LRR"); + + // Constructors + + //- from components + LRR + ( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport + ); + + + //- Destructor + virtual ~LRR() + {} + + + // Member Functions + + //- Return the turbulence viscosity + virtual tmp<volScalarField> nut() const + { + return nut_; + } + + //- Return the effective diffusivity for R + tmp<volScalarField> DREff() const + { + return tmp<volScalarField> + ( + new volScalarField("DREff", nut_ + nu()) + ); + } + + //- Return the effective diffusivity for epsilon + tmp<volScalarField> DepsilonEff() const + { + return tmp<volScalarField> + ( + new volScalarField("DepsilonEff", alphaEps_*nut_ + nu()) + ); + } + + //- Return the turbulence kinetic energy + virtual tmp<volScalarField> k() const + { + return k_; + } + + //- Return the turbulence kinetic energy dissipation rate + virtual tmp<volScalarField> epsilon() const + { + return epsilon_; + } + + //- Return the Reynolds stress tensor + virtual tmp<volSymmTensorField> R() const + { + return R_; + } + + //- Return the effective stress tensor including the laminar stress + virtual tmp<volSymmTensorField> devReff() const; + + //- Return the source term for the momentum equation + virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const; + + //- Solve the turbulence equations and correct the turbulence viscosity + virtual void correct(); + + //- Read turbulenceProperties dictionary + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/LamBremhorstKE/LamBremhorstKE.C b/src/turbulenceModels/incompressible/RAS/LamBremhorstKE/LamBremhorstKE.C new file mode 100644 index 00000000000..183466e2ac9 --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/LamBremhorstKE/LamBremhorstKE.C @@ -0,0 +1,277 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "LamBremhorstKE.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(LamBremhorstKE, 0); +addToRunTimeSelectionTable(RASModel, LamBremhorstKE, dictionary); + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +LamBremhorstKE::LamBremhorstKE +( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& lamTransportModel +) +: + RASModel(typeName, U, phi, lamTransportModel), + + Cmu_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Cmu", + coeffDict_, + 0.09 + ) + ), + C1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "C1", + coeffDict_, + 1.44 + ) + ), + C2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "C2", + coeffDict_, + 1.92 + ) + ), + alphaEps_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphaEps", + coeffDict_, + 0.76923 + ) + ), + + k_ + ( + IOobject + ( + "k", + runTime_.timeName(), + mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh_ + ), + + epsilon_ + ( + IOobject + ( + "epsilon", + runTime_.timeName(), + mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh_ + ), + + y_(mesh_), + + Rt_(sqr(k_)/(nu()*epsilon_)), + + fMu_ + ( + sqr(scalar(1) - exp(-0.0165*(sqrt(k_)*y_/nu()))) + *(scalar(1) + 20.5/(Rt_ + SMALL)) + ), + + nut_(Cmu_*fMu_*sqr(k_)/(epsilon_ + epsilonSmall_)) +{ + printCoeffs(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +tmp<volSymmTensorField> LamBremhorstKE::R() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + "R", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + ((2.0/3.0)*I)*k_ - nut_*twoSymm(fvc::grad(U_)), + k_.boundaryField().types() + ) + ); +} + + +tmp<volSymmTensorField> LamBremhorstKE::devReff() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + "devRhoReff", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + -nuEff()*dev(twoSymm(fvc::grad(U_))) + ) + ); +} + + +tmp<fvVectorMatrix> LamBremhorstKE::divDevReff(volVectorField& U) const +{ + return + ( + - fvm::laplacian(nuEff(), U) + - fvc::div(nuEff()*dev(fvc::grad(U)().T())) + ); +} + + +bool LamBremhorstKE::read() +{ + if (RASModel::read()) + { + Cmu_.readIfPresent(coeffDict_); + C1_.readIfPresent(coeffDict_); + C2_.readIfPresent(coeffDict_); + alphaEps_.readIfPresent(coeffDict_); + + return true; + } + else + { + return false; + } +} + + +void LamBremhorstKE::correct() +{ + RASModel::correct(); + + if (!turbulence_) + { + return; + } + + if (mesh_.changing()) + { + y_.correct(); + } + + volScalarField G = nut_*2*magSqr(symm(fvc::grad(U_))); + + // Calculate parameters and coefficients for low-Reynolds number model + + Rt_ = sqr(k_)/(nu()*epsilon_); + volScalarField Ry = sqrt(k_)*y_/nu(); + + fMu_ = sqr(scalar(1) - exp(-0.0165*Ry)) + *(scalar(1) + 20.5/(Rt_ + SMALL)); + + volScalarField f1 = scalar(1) + pow(0.05/(fMu_ + SMALL), 3); + volScalarField f2 = scalar(1) - exp(-sqr(Rt_)); + + + // Dissipation equation + + tmp<fvScalarMatrix> epsEqn + ( + fvm::ddt(epsilon_) + + fvm::div(phi_, epsilon_) + - fvm::laplacian(DepsilonEff(), epsilon_) + == + C1_*f1*G*epsilon_/k_ + - fvm::Sp(C2_*f2*epsilon_/k_, epsilon_) + ); + + epsEqn().relax(); + solve(epsEqn); + bound(epsilon_, epsilon0_); + + + // Turbulent kinetic energy equation + + tmp<fvScalarMatrix> kEqn + ( + fvm::ddt(k_) + + fvm::div(phi_, k_) + - fvm::laplacian(DkEff(), k_) + == + G - fvm::Sp(epsilon_/k_, k_) + ); + + kEqn().relax(); + solve(kEqn); + bound(k_, k0_); + + + // Re-calculate viscosity + nut_ = Cmu_*fMu_*sqr(k_)/epsilon_; +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/LamBremhorstKE/LamBremhorstKE.H b/src/turbulenceModels/incompressible/RAS/LamBremhorstKE/LamBremhorstKE.H new file mode 100644 index 00000000000..422ddffdf60 --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/LamBremhorstKE/LamBremhorstKE.H @@ -0,0 +1,164 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::incompressible::RASModels::LamBremhorstKE + +Description + Lam and Bremhorst low-Reynolds number k-epsilon turbulence model + for incompressible flows + +SourceFiles + LamBremhorstKE.C + +\*---------------------------------------------------------------------------*/ + +#ifndef LamBremhorstKE_H +#define LamBremhorstKE_H + +#include "RASModel.H" +#include "wallDist.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class LamBremhorstKE Declaration +\*---------------------------------------------------------------------------*/ + +class LamBremhorstKE +: + public RASModel +{ + // Private data + + dimensionedScalar Cmu_; + dimensionedScalar C1_; + dimensionedScalar C2_; + dimensionedScalar alphaEps_; + + volScalarField k_; + volScalarField epsilon_; + + wallDist y_; + volScalarField Rt_; + + volScalarField fMu_; + volScalarField nut_; + + +public: + + //- Runtime type information + TypeName("LamBremhorstKE"); + + + // Constructors + + //- from components + LamBremhorstKE + ( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport + ); + + + //- Destructor + virtual ~LamBremhorstKE() + {} + + + // Member Functions + + //- Return the turbulence viscosity + virtual tmp<volScalarField> nut() const + { + return nut_; + } + + //- Return the effective diffusivity for k + tmp<volScalarField> DkEff() const + { + return tmp<volScalarField> + ( + new volScalarField("DkEff", nut_ + nu()) + ); + } + + //- Return the effective diffusivity for epsilon + tmp<volScalarField> DepsilonEff() const + { + return tmp<volScalarField> + ( + new volScalarField("DepsilonEff", alphaEps_*nut_ + nu()) + ); + } + + //- Return the turbulence kinetic energy + virtual tmp<volScalarField> k() const + { + return k_; + } + + //- Return the turbulence kinetic energy dissipation rate + virtual tmp<volScalarField> epsilon() const + { + return epsilon_; + } + + //- Return the Reynolds stress tensor + virtual tmp<volSymmTensorField> R() const; + + //- Return the effective stress tensor including the laminar stress + virtual tmp<volSymmTensorField> devReff() const; + + //- Return the source term for the momentum equation + virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const; + + //- Solve the turbulence equations and correct the turbulence viscosity + virtual void correct(); + + //- Read turbulenceProperties dictionary + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C b/src/turbulenceModels/incompressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C new file mode 100644 index 00000000000..dc6a2c84a6f --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C @@ -0,0 +1,471 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "LaunderGibsonRSTM.H" +#include "addToRunTimeSelectionTable.H" +#include "wallFvPatch.H" + +#include "backwardsCompatibilityWallFunctions.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(LaunderGibsonRSTM, 0); +addToRunTimeSelectionTable(RASModel, LaunderGibsonRSTM, dictionary); + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +LaunderGibsonRSTM::LaunderGibsonRSTM +( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& lamTransportModel +) +: + RASModel(typeName, U, phi, lamTransportModel), + + Cmu_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Cmu", + coeffDict_, + 0.09 + ) + ), + Clg1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Clg1", + coeffDict_, + 1.8 + ) + ), + Clg2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Clg2", + coeffDict_, + 0.6 + ) + ), + C1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "C1", + coeffDict_, + 1.44 + ) + ), + C2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "C2", + coeffDict_, + 1.92 + ) + ), + Cs_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Cs", + coeffDict_, + 0.25 + ) + ), + Ceps_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Ceps", + coeffDict_, + 0.15 + ) + ), + alphaR_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphaR", + coeffDict_, + 1.22 + ) + ), + alphaEps_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphaEps", + coeffDict_, + 0.76923 + ) + ), + C1Ref_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "C1Ref", + coeffDict_, + 0.5 + ) + ), + C2Ref_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "C2Ref", + coeffDict_, + 0.3 + ) + ), + couplingFactor_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "couplingFactor", + coeffDict_, + 0.0 + ) + ), + + yr_(mesh_), + + R_ + ( + IOobject + ( + "R", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + autoCreateR("R", mesh_) + ), + k_ + ( + IOobject + ( + "k", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + autoCreateK("k", mesh_) + ), + epsilon_ + ( + IOobject + ( + "epsilon", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + autoCreateEpsilon("epsilon", mesh_) + ), + nut_ + ( + IOobject + ( + "nut", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + autoCreateNut("nut", mesh_) + ) +{ + nut_ == Cmu_*sqr(k_)/(epsilon_ + epsilonSmall_); + nut_.correctBoundaryConditions(); + + if (couplingFactor_.value() < 0.0 || couplingFactor_.value() > 1.0) + { + FatalErrorIn + ( + "LaunderGibsonRSTM::LaunderGibsonRSTM" + "(const volVectorField& U, const surfaceScalarField& phi," + "transportModel& lamTransportModel)" + ) << "couplingFactor = " << couplingFactor_ + << " is not in range 0 - 1" << nl + << exit(FatalError); + } + + printCoeffs(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +tmp<volSymmTensorField> LaunderGibsonRSTM::devReff() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + "devRhoReff", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + R_ - nu()*dev(twoSymm(fvc::grad(U_))) + ) + ); +} + + +tmp<fvVectorMatrix> LaunderGibsonRSTM::divDevReff(volVectorField& U) const +{ + if (couplingFactor_.value() > 0.0) + { + return + ( + fvc::div(R_ + couplingFactor_*nut_*fvc::grad(U), "div(R)") + + fvc::laplacian((1.0-couplingFactor_)*nut_, U, "laplacian(nuEff,U)") + - fvm::laplacian(nuEff(), U) + ); + } + else + { + return + ( + fvc::div(R_) + + fvc::laplacian(nut_, U, "laplacian(nuEff,U)") + - fvm::laplacian(nuEff(), U) + ); + } +} + + +bool LaunderGibsonRSTM::read() +{ + if (RASModel::read()) + { + Cmu_.readIfPresent(coeffDict_); + Clg1_.readIfPresent(coeffDict_); + Clg2_.readIfPresent(coeffDict_); + C1_.readIfPresent(coeffDict_); + C2_.readIfPresent(coeffDict_); + Cs_.readIfPresent(coeffDict_); + Ceps_.readIfPresent(coeffDict_); + alphaR_.readIfPresent(coeffDict_); + alphaEps_.readIfPresent(coeffDict_); + C1Ref_.readIfPresent(coeffDict_); + C2Ref_.readIfPresent(coeffDict_); + + couplingFactor_.readIfPresent(coeffDict_); + + if (couplingFactor_.value() < 0.0 || couplingFactor_.value() > 1.0) + { + FatalErrorIn("LaunderGibsonRSTM::read()") + << "couplingFactor = " << couplingFactor_ + << " is not in range 0 - 1" + << exit(FatalError); + } + + return true; + } + else + { + return false; + } +} + + +void LaunderGibsonRSTM::correct() +{ + RASModel::correct(); + + if (!turbulence_) + { + return; + } + + if (mesh_.changing()) + { + yr_.correct(); + } + + volSymmTensorField P = -twoSymm(R_ & fvc::grad(U_)); + volScalarField G("G", 0.5*tr(P)); + + // Update espsilon and G at the wall + epsilon_.boundaryField().updateCoeffs(); + + // Dissipation equation + tmp<fvScalarMatrix> epsEqn + ( + fvm::ddt(epsilon_) + + fvm::div(phi_, epsilon_) + //- fvm::laplacian(Ceps*(k_/epsilon_)*R_, epsilon_) + - fvm::laplacian(DepsilonEff(), epsilon_) + == + C1_*G*epsilon_/k_ + - fvm::Sp(C2_*epsilon_/k_, epsilon_) + ); + + epsEqn().relax(); + + epsEqn().boundaryManipulate(epsilon_.boundaryField()); + + solve(epsEqn); + bound(epsilon_, epsilon0_); + + + // Reynolds stress equation + + const fvPatchList& patches = mesh_.boundary(); + + forAll(patches, patchi) + { + const fvPatch& curPatch = patches[patchi]; + + if (typeid(curPatch) == typeid(wallFvPatch)) + { + forAll(curPatch, facei) + { + label faceCelli = curPatch.faceCells()[facei]; + P[faceCelli] *= + min(G[faceCelli]/(0.5*tr(P[faceCelli]) + SMALL), 1.0); + } + } + } + + volSymmTensorField reflect = C1Ref_*epsilon_/k_*R_ - C2Ref_*Clg2_*dev(P); + + tmp<fvSymmTensorMatrix> REqn + ( + fvm::ddt(R_) + + fvm::div(phi_, R_) + //- fvm::laplacian(Cs*(k_/epsilon_)*R_, R_) + - fvm::laplacian(DREff(), R_) + + fvm::Sp(Clg1_*epsilon_/k_, R_) + == + P + + (2.0/3.0*(Clg1_ - 1)*I)*epsilon_ + - Clg2_*dev(P) + + // wall reflection terms + + symm + ( + I*((yr_.n() & reflect) & yr_.n()) + - 1.5*(yr_.n()*(reflect & yr_.n()) + + (yr_.n() & reflect)*yr_.n()) + )*pow(Cmu_, 0.75)*pow(k_, 1.5)/(kappa_*yr_*epsilon_) + ); + + REqn().relax(); + solve(REqn); + + R_.max + ( + dimensionedSymmTensor + ( + "zero", + R_.dimensions(), + symmTensor + ( + k0_.value(), -GREAT, -GREAT, + k0_.value(), -GREAT, + k0_.value() + ) + ) + ); + + k_ == 0.5*tr(R_); + bound(k_, k0_); + + + // Re-calculate turbulent viscosity + nut_ == Cmu_*sqr(k_)/epsilon_; + nut_.correctBoundaryConditions(); + + + // Correct wall shear stresses + + forAll(patches, patchi) + { + const fvPatch& curPatch = patches[patchi]; + + if (typeid(curPatch) == typeid(wallFvPatch)) + { + symmTensorField& Rw = R_.boundaryField()[patchi]; + + const scalarField& nutw = nut_.boundaryField()[patchi]; + + vectorField snGradU = U_.boundaryField()[patchi].snGrad(); + + const vectorField& faceAreas + = mesh_.Sf().boundaryField()[patchi]; + + const scalarField& magFaceAreas + = mesh_.magSf().boundaryField()[patchi]; + + forAll(curPatch, facei) + { + // Calculate near-wall velocity gradient + tensor gradUw + = (faceAreas[facei]/magFaceAreas[facei])*snGradU[facei]; + + // Calculate near-wall shear-stress tensor + tensor tauw = -nutw[facei]*2*symm(gradUw); + + // Reset the shear components of the stress tensor + Rw[facei].xy() = tauw.xy(); + Rw[facei].xz() = tauw.xz(); + Rw[facei].yz() = tauw.yz(); + } + } + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.H b/src/turbulenceModels/incompressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.H new file mode 100644 index 00000000000..e3f5d7a0afd --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.H @@ -0,0 +1,195 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::incompressible::RASModels::LaunderGibsonRSTM + +Description + Launder-Gibson Reynolds stress turbulence model for incompressible flows. + + The default model coefficients correspond to the following: + @verbatim + LaunderGibsonRSTMCoeffs + { + Cmu 0.09; + Clg1 1.8; + Clg2 0.6; + C1 1.44; + C2 1.92; + C1Ref 0.5; + C2Ref 0.3; + Cs 0.25; + Ceps 0.15; + alphah 1.0; // only for compressible + alphaEps 0.76923; + alphaR 1.22; + couplingFactor 0.0; + } + @endverbatim + +SourceFiles + LaunderGibsonRSTM.C + +\*---------------------------------------------------------------------------*/ + +#ifndef LaunderGibsonRSTM_H +#define LaunderGibsonRSTM_H + +#include "RASModel.H" +#include "wallDistReflection.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class LaunderGibsonRSTM Declaration +\*---------------------------------------------------------------------------*/ + +class LaunderGibsonRSTM +: + public RASModel +{ + // Private data + + dimensionedScalar Cmu_; + + dimensionedScalar Clg1_; + dimensionedScalar Clg2_; + + dimensionedScalar C1_; + dimensionedScalar C2_; + dimensionedScalar Cs_; + dimensionedScalar Ceps_; + dimensionedScalar alphaR_; + dimensionedScalar alphaEps_; + + dimensionedScalar C1Ref_; + dimensionedScalar C2Ref_; + + dimensionedScalar couplingFactor_; + + wallDistReflection yr_; + + volSymmTensorField R_; + volScalarField k_; + volScalarField epsilon_; + volScalarField nut_; + + +public: + + //- Runtime type information + TypeName("LaunderGibsonRSTM"); + + // Constructors + + //- from components + LaunderGibsonRSTM + ( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport + ); + + + //- Destructor + virtual ~LaunderGibsonRSTM() + {} + + + // Member Functions + + //- Return the turbulence viscosity + virtual tmp<volScalarField> nut() const + { + return nut_; + } + + //- Return the effective diffusivity for R + tmp<volScalarField> DREff() const + { + return tmp<volScalarField> + ( + new volScalarField("DREff", alphaR_*nut_ + nu()) + ); + } + + //- Return the effective diffusivity for epsilon + tmp<volScalarField> DepsilonEff() const + { + return tmp<volScalarField> + ( + new volScalarField("DepsilonEff", alphaEps_*nut_ + nu()) + ); + } + + //- Return the turbulence kinetic energy + virtual tmp<volScalarField> k() const + { + return k_; + } + + //- Return the turbulence kinetic energy dissipation rate + virtual tmp<volScalarField> epsilon() const + { + return epsilon_; + } + + //- Return the Reynolds stress tensor + virtual tmp<volSymmTensorField> R() const + { + return R_; + } + + //- Return the effective stress tensor including the laminar stress + virtual tmp<volSymmTensorField> devReff() const; + + //- Return the source term for the momentum equation + virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const; + + //- Solve the turbulence equations and correct the turbulence viscosity + virtual void correct(); + + //- Read turbulenceProperties dictionary + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/LaunderSharmaKE/LaunderSharmaKE.C b/src/turbulenceModels/incompressible/RAS/LaunderSharmaKE/LaunderSharmaKE.C new file mode 100644 index 00000000000..ff5483491db --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/LaunderSharmaKE/LaunderSharmaKE.C @@ -0,0 +1,273 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "LaunderSharmaKE.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(LaunderSharmaKE, 0); +addToRunTimeSelectionTable(RASModel, LaunderSharmaKE, dictionary); + +// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // + +tmp<volScalarField> LaunderSharmaKE::fMu() const +{ + return exp(-3.4/sqr(scalar(1) + sqr(k_)/(nu()*epsilonTilda_)/50.0)); +} + + +tmp<volScalarField> LaunderSharmaKE::f2() const +{ + return + scalar(1) + - 0.3*exp(-min(sqr(sqr(k_)/(nu()*epsilonTilda_)), scalar(50.0))); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +LaunderSharmaKE::LaunderSharmaKE +( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& lamTransportModel +) +: + RASModel(typeName, U, phi, lamTransportModel), + + Cmu_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Cmu", + coeffDict_, + 0.09 + ) + ), + C1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "C1", + coeffDict_, + 1.44 + ) + ), + C2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "C2", + coeffDict_, + 1.92 + ) + ), + alphaEps_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphaEps", + coeffDict_, + 0.76923 + ) + ), + + k_ + ( + IOobject + ( + "k", + runTime_.timeName(), + mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh_ + ), + + epsilonTilda_ + ( + IOobject + ( + "epsilon", + runTime_.timeName(), + mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh_ + ), + + nut_(Cmu_*fMu()*sqr(k_)/(epsilonTilda_ + epsilonSmall_)) +{ + printCoeffs(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +tmp<volSymmTensorField> LaunderSharmaKE::R() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + "R", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + ((2.0/3.0)*I)*k_ - nut_*twoSymm(fvc::grad(U_)), + k_.boundaryField().types() + ) + ); +} + + +tmp<volSymmTensorField> LaunderSharmaKE::devReff() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + "devRhoReff", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + -nuEff()*dev(twoSymm(fvc::grad(U_))) + ) + ); +} + + +tmp<fvVectorMatrix> LaunderSharmaKE::divDevReff(volVectorField& U) const +{ + return + ( + - fvm::laplacian(nuEff(), U) + - fvc::div(nuEff()*dev(fvc::grad(U)().T())) + ); +} + + +bool LaunderSharmaKE::read() +{ + if (RASModel::read()) + { + Cmu_.readIfPresent(coeffDict_); + C1_.readIfPresent(coeffDict_); + C2_.readIfPresent(coeffDict_); + alphaEps_.readIfPresent(coeffDict_); + + return true; + } + else + { + return false; + } +} + + +void LaunderSharmaKE::correct() +{ + RASModel::correct(); + + if (!turbulence_) + { + return; + } + + volScalarField S2 = 2*magSqr(symm(fvc::grad(U_))); + + volScalarField G = nut_*S2; + + volScalarField E = 2.0*nu()*nut_*fvc::magSqrGradGrad(U_); + volScalarField D = 2.0*nu()*magSqr(fvc::grad(sqrt(k_))); + + + // Dissipation rate equation + + tmp<fvScalarMatrix> epsEqn + ( + fvm::ddt(epsilonTilda_) + + fvm::div(phi_, epsilonTilda_) + - fvm::laplacian(DepsilonEff(), epsilonTilda_) + == + C1_*G*epsilonTilda_/k_ + - fvm::Sp(C2_*f2()*epsilonTilda_/k_, epsilonTilda_) + + E + ); + + epsEqn().relax(); + solve(epsEqn); + bound(epsilonTilda_, epsilon0_); + + + // Turbulent kinetic energy equation + + tmp<fvScalarMatrix> kEqn + ( + fvm::ddt(k_) + + fvm::div(phi_, k_) + - fvm::laplacian(DkEff(), k_) + == + G - fvm::Sp((epsilonTilda_ + D)/k_, k_) + ); + + kEqn().relax(); + solve(kEqn); + bound(k_, k0_); + + + // Re-calculate viscosity + nut_ = Cmu_*fMu()*sqr(k_)/epsilonTilda_; +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/LaunderSharmaKE/LaunderSharmaKE.H b/src/turbulenceModels/incompressible/RAS/LaunderSharmaKE/LaunderSharmaKE.H new file mode 100644 index 00000000000..22f5adf28f3 --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/LaunderSharmaKE/LaunderSharmaKE.H @@ -0,0 +1,179 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::incompressible::RASModels::LaunderSharmaKE + +Description + Launder and Sharma low-Reynolds k-epsilon turbulence model for + incompressible flows. + + The default model coefficients correspond to the following: + @verbatim + LaunderSharmaKECoeffs + { + Cmu 0.09; + C1 1.44; + C2 1.92; + C3 -0.33; + alphah 1.0; // only for compressible + alphahk 1.0; // only for compressible + alphaEps 0.76923; + } + @endverbatim + +SourceFiles + LaunderSharmaKE.C + +\*---------------------------------------------------------------------------*/ + +#ifndef LaunderSharmaKE_H +#define LaunderSharmaKE_H + +#include "RASModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class LaunderSharmaKE Declaration +\*---------------------------------------------------------------------------*/ + +class LaunderSharmaKE +: + public RASModel +{ + // Private data + + dimensionedScalar Cmu_; + dimensionedScalar C1_; + dimensionedScalar C2_; + dimensionedScalar alphaEps_; + + volScalarField k_; + volScalarField epsilonTilda_; + + volScalarField nut_; + + + // Private member functions + + tmp<volScalarField> fMu() const; + tmp<volScalarField> f2() const; + + +public: + + //- Runtime type information + TypeName("LaunderSharmaKE"); + + // Constructors + + //- from components + LaunderSharmaKE + ( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport + ); + + + //- Destructor + virtual ~LaunderSharmaKE() + {} + + + // Member Functions + + //- Return the turbulence viscosity + virtual tmp<volScalarField> nut() const + { + return nut_; + } + + //- Return the effective diffusivity for k + tmp<volScalarField> DkEff() const + { + return tmp<volScalarField> + ( + new volScalarField("DkEff", nut_ + nu()) + ); + } + + //- Return the effective diffusivity for epsilon + tmp<volScalarField> DepsilonEff() const + { + return tmp<volScalarField> + ( + new volScalarField("DepsilonEff", alphaEps_*nut_ + nu()) + ); + } + + //- Return the turbulence kinetic energy + virtual tmp<volScalarField> k() const + { + return k_; + } + + //- Note that epsilonTilda is returned as epsilon. + // This is the appropriate variable for most purposes. + virtual tmp<volScalarField> epsilon() const + { + return epsilonTilda_; + } + + //- Return the Reynolds stress tensor + virtual tmp<volSymmTensorField> R() const; + + //- Return the effective stress tensor including the laminar stress + virtual tmp<volSymmTensorField> devReff() const; + + //- Return the source term for the momentum equation + virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const; + + //- Solve the turbulence equations and correct the turbulence viscosity + virtual void correct(); + + //- Read turbulenceProperties dictionary + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/LienCubicKE/LienCubicKE.C b/src/turbulenceModels/incompressible/RAS/LienCubicKE/LienCubicKE.C new file mode 100644 index 00000000000..09b802504e4 --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/LienCubicKE/LienCubicKE.C @@ -0,0 +1,420 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "LienCubicKE.H" +#include "addToRunTimeSelectionTable.H" +#include "wallFvPatch.H" + +#include "backwardsCompatibilityWallFunctions.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(LienCubicKE, 0); +addToRunTimeSelectionTable(RASModel, LienCubicKE, dictionary); + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +LienCubicKE::LienCubicKE +( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& lamTransportModel +) +: + RASModel(typeName, U, phi, lamTransportModel), + + C1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "C1", + coeffDict_, + 1.44 + ) + ), + C2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "C2", + coeffDict_, + 1.92 + ) + ), + alphak_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphak", + coeffDict_, + 1.0 + ) + ), + alphaEps_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphaEps", + coeffDict_, + 0.76923 + ) + ), + A1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "A1", + coeffDict_, + 1.25 + ) + ), + A2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "A2", + coeffDict_, + 1000.0 + ) + ), + Ctau1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Ctau1", + coeffDict_, + -4.0 + ) + ), + Ctau2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Ctau2", + coeffDict_, + 13.0 + ) + ), + Ctau3_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Ctau3", + coeffDict_, + -2.0 + ) + ), + alphaKsi_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphaKsi", + coeffDict_, + 0.9 + ) + ), + + k_ + ( + IOobject + ( + "k", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + autoCreateK("k", mesh_) + ), + epsilon_ + ( + IOobject + ( + "epsilon", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + autoCreateEpsilon("epsilon", mesh_) + ), + + gradU_(fvc::grad(U)), + eta_(k_/epsilon_*sqrt(2.0*magSqr(0.5*(gradU_ + gradU_.T())))), + ksi_(k_/epsilon_*sqrt(2.0*magSqr(0.5*(gradU_ - gradU_.T())))), + Cmu_(2.0/(3.0*(A1_ + eta_ + alphaKsi_*ksi_))), + fEta_(A2_ + pow(eta_, 3.0)), + + C5viscosity_ + ( + - 2.0*pow3(Cmu_)*pow4(k_)/pow3(epsilon_) + *( + magSqr(gradU_ + gradU_.T()) + - magSqr(gradU_ - gradU_.T()) + ) + ), + + nut_ + ( + IOobject + ( + "nut", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + autoCreateNut("nut", mesh_) + ), + + nonlinearStress_ + ( + "nonlinearStress", + // quadratic terms + symm + ( + pow(k_, 3.0)/sqr(epsilon_) + *( + Ctau1_/fEta_ + *( + (gradU_ & gradU_) + + (gradU_ & gradU_)().T() + ) + + Ctau2_/fEta_*(gradU_ & gradU_.T()) + + Ctau3_/fEta_*(gradU_.T() & gradU_) + ) + // cubic term C4 + - 20.0*pow(k_, 4.0)/pow(epsilon_, 3.0) + *pow(Cmu_, 3.0) + *( + ((gradU_ & gradU_) & gradU_.T()) + + ((gradU_ & gradU_.T()) & gradU_.T()) + - ((gradU_.T() & gradU_) & gradU_) + - ((gradU_.T() & gradU_.T()) & gradU_) + ) + ) + ) +{ + nut_ == Cmu_*sqr(k_)/(epsilon_ + epsilonSmall_) + C5viscosity_; + nut_.correctBoundaryConditions(); + + printCoeffs(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +tmp<volSymmTensorField> LienCubicKE::R() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + "R", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + ((2.0/3.0)*I)*k_ - nut_*twoSymm(gradU_) + nonlinearStress_, + k_.boundaryField().types() + ) + ); +} + + +tmp<volSymmTensorField> LienCubicKE::devReff() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + "devRhoReff", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + -nuEff()*dev(twoSymm(fvc::grad(U_))) + nonlinearStress_ + ) + ); +} + + +tmp<fvVectorMatrix> LienCubicKE::divDevReff(volVectorField& U) const +{ + return + ( + fvc::div(nonlinearStress_) + - fvm::laplacian(nuEff(), U) + - fvc::div(nuEff()*dev(fvc::grad(U)().T())) + ); +} + + +bool LienCubicKE::read() +{ + if (RASModel::read()) + { + C1_.readIfPresent(coeffDict_); + C2_.readIfPresent(coeffDict_); + alphak_.readIfPresent(coeffDict_); + alphaEps_.readIfPresent(coeffDict_); + A1_.readIfPresent(coeffDict_); + A2_.readIfPresent(coeffDict_); + Ctau1_.readIfPresent(coeffDict_); + Ctau2_.readIfPresent(coeffDict_); + Ctau3_.readIfPresent(coeffDict_); + alphaKsi_.readIfPresent(coeffDict_); + + return true; + } + else + { + return false; + } +} + + +void LienCubicKE::correct() +{ + RASModel::correct(); + + if (!turbulence_) + { + return; + } + + gradU_ = fvc::grad(U_); + + // generation term + volScalarField S2 = symm(gradU_) && gradU_; + + volScalarField G + ( + "G", + Cmu_*sqr(k_)/epsilon_*S2 - (nonlinearStress_ && gradU_) + ); + + // Update espsilon and G at the wall + epsilon_.boundaryField().updateCoeffs(); + + // Dissipation equation + tmp<fvScalarMatrix> epsEqn + ( + fvm::ddt(epsilon_) + + fvm::div(phi_, epsilon_) + - fvm::laplacian(DepsilonEff(), epsilon_) + == + C1_*G*epsilon_/k_ + - fvm::Sp(C2_*epsilon_/k_, epsilon_) + ); + + epsEqn().relax(); + + epsEqn().boundaryManipulate(epsilon_.boundaryField()); + + solve(epsEqn); + bound(epsilon_, epsilon0_); + + + // Turbulent kinetic energy equation + + tmp<fvScalarMatrix> kEqn + ( + fvm::ddt(k_) + + fvm::div(phi_, k_) + - fvm::laplacian(DkEff(), k_) + == + G + - fvm::Sp(epsilon_/k_, k_) + ); + + kEqn().relax(); + solve(kEqn); + bound(k_, k0_); + + + // Re-calculate viscosity + + eta_ = k_/epsilon_*sqrt(2.0*magSqr(0.5*(gradU_ + gradU_.T()))); + ksi_ = k_/epsilon_*sqrt(2.0*magSqr(0.5*(gradU_ - gradU_.T()))); + Cmu_ = 2.0/(3.0*(A1_ + eta_ + alphaKsi_*ksi_)); + fEta_ = A2_ + pow(eta_, 3.0); + + C5viscosity_ = + - 2.0*pow(Cmu_, 3.0)*pow(k_, 4.0)/pow(epsilon_, 3.0) + *(magSqr(gradU_ + gradU_.T()) - magSqr(gradU_ - gradU_.T())); + + nut_ == Cmu_*sqr(k_)/epsilon_ + C5viscosity_; + nut_.correctBoundaryConditions(); + + nonlinearStress_ = symm + ( + // quadratic terms + pow(k_, 3.0)/sqr(epsilon_)* + ( + Ctau1_/fEta_* + ( + (gradU_ & gradU_) + + (gradU_ & gradU_)().T() + ) + + Ctau2_/fEta_*(gradU_ & gradU_.T()) + + Ctau3_/fEta_*(gradU_.T() & gradU_) + ) + // cubic term C4 + - 20.0*pow(k_, 4.0)/pow(epsilon_, 3.0) + *pow(Cmu_, 3.0) + *( + ((gradU_ & gradU_) & gradU_.T()) + + ((gradU_ & gradU_.T()) & gradU_.T()) + - ((gradU_.T() & gradU_) & gradU_) + - ((gradU_.T() & gradU_.T()) & gradU_) + ) + ); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/LienCubicKE/LienCubicKE.H b/src/turbulenceModels/incompressible/RAS/LienCubicKE/LienCubicKE.H new file mode 100644 index 00000000000..e1617389b7e --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/LienCubicKE/LienCubicKE.H @@ -0,0 +1,172 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::incompressible::RASModels::LienCubicKE + +Description + Lien cubic non-linear k-epsilon turbulence model for incompressible flows. + +SourceFiles + LienCubicKE.C + +\*---------------------------------------------------------------------------*/ + +#ifndef LienCubicKE_H +#define LienCubicKE_H + +#include "RASModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class LienCubicKE Declaration +\*---------------------------------------------------------------------------*/ + +class LienCubicKE +: + public RASModel +{ + // Private data + + dimensionedScalar C1_; + dimensionedScalar C2_; + dimensionedScalar alphak_; + dimensionedScalar alphaEps_; + dimensionedScalar A1_; + dimensionedScalar A2_; + dimensionedScalar Ctau1_; + dimensionedScalar Ctau2_; + dimensionedScalar Ctau3_; + dimensionedScalar alphaKsi_; + + volScalarField k_; + volScalarField epsilon_; + + volTensorField gradU_; + volScalarField eta_; + volScalarField ksi_; + volScalarField Cmu_; + volScalarField fEta_; + volScalarField C5viscosity_; + + volScalarField nut_; + + volSymmTensorField nonlinearStress_; + + +public: + + //- Runtime type information + TypeName("LienCubicKE"); + + // Constructors + + //- from components + LienCubicKE + ( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport + ); + + + // Destructor + virtual ~LienCubicKE() + {} + + + // Member Functions + + //- Return the turbulence viscosity + virtual tmp<volScalarField> nut() const + { + return nut_; + } + + //- Return the effective diffusivity for k + tmp<volScalarField> DkEff() const + { + return tmp<volScalarField> + ( + new volScalarField("DkEff", alphak_*nut_ + nu()) + ); + } + + //- Return the effective diffusivity for epsilon + tmp<volScalarField> DepsilonEff() const + { + return tmp<volScalarField> + ( + new volScalarField("DepsilonEff", alphaEps_*nut_ + nu()) + ); + } + + //- Return the turbulence kinetic energy + virtual tmp<volScalarField> k() const + { + return k_; + } + + //- Return the turbulence kinetic energy dissipation rate + virtual tmp<volScalarField> epsilon() const + { + return epsilon_; + } + + //- Return the Reynolds stress tensor + virtual tmp<volSymmTensorField> R() const; + + //- Return the effective stress tensor including the laminar stress + virtual tmp<volSymmTensorField> devReff() const; + + //- Return the source term for the momentum equation + virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const; + + //- Solve the turbulence equations and correct the turbulence viscosity + virtual void correct(); + + //- Read turbulenceProperties dictionary + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/LienCubicKELowRe/LienCubicKELowRe.C b/src/turbulenceModels/incompressible/RAS/LienCubicKELowRe/LienCubicKELowRe.C new file mode 100644 index 00000000000..19ad85b82d3 --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/LienCubicKELowRe/LienCubicKELowRe.C @@ -0,0 +1,492 @@ +/*---------------------------------------------------------------------------* \ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "LienCubicKELowRe.H" +#include "wallFvPatch.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(LienCubicKELowRe, 0); +addToRunTimeSelectionTable(RASModel, LienCubicKELowRe, dictionary); + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +LienCubicKELowRe::LienCubicKELowRe +( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& lamTransportModel +) +: + RASModel(typeName, U, phi, lamTransportModel), + + C1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "C1", + coeffDict_, + 1.44 + ) + ), + C2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "C2", + coeffDict_, + 1.92 + ) + ), + alphak_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphak", + coeffDict_, + 1.0 + ) + ), + alphaEps_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphaEps", + coeffDict_, + 0.76923 + ) + ), + A1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "A1", + coeffDict_, + 1.25 + ) + ), + A2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "A2", + coeffDict_, + 1000.0 + ) + ), + Ctau1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Ctau1", + coeffDict_, + -4.0 + ) + ), + Ctau2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Ctau2", + coeffDict_, + 13.0 + ) + ), + Ctau3_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Ctau3", + coeffDict_, + -2.0 + ) + ), + alphaKsi_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphaKsi", + coeffDict_, + 0.9 + ) + ), + CmuWall_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Cmu", + coeffDict_, + 0.09 + ) + ), + Am_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Am", + coeffDict_, + 0.016 + ) + ), + Aepsilon_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Aepsilon", + coeffDict_, + 0.263 + ) + ), + Amu_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Amu", + coeffDict_, + 0.00222 + ) + ), + + k_ + ( + IOobject + ( + "k", + runTime_.timeName(), + mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh_ + ), + + epsilon_ + ( + IOobject + ( + "epsilon", + runTime_.timeName(), + mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh_ + ), + + y_(mesh_), + + gradU_(fvc::grad(U)), + eta_(k_/epsilon_*sqrt(2.0*magSqr(0.5*(gradU_ + gradU_.T())))), + ksi_(k_/epsilon_*sqrt(2.0*magSqr(0.5*(gradU_ - gradU_.T())))), + Cmu_(2.0/(3.0*(A1_ + eta_ + alphaKsi_*ksi_))), + fEta_(A2_ + pow(eta_, 3.0)), + + C5viscosity_ + ( + -2.0*pow(Cmu_, 3.0)*pow(k_, 4.0)/pow(epsilon_, 3.0) + *(magSqr(gradU_ + gradU_.T()) - magSqr(gradU_ - gradU_.T())) + ), + + yStar_(sqrt(k_)*y_/nu() + SMALL), + + nut_ + ( + Cmu_ + *( + scalar(1) - exp(-Am_*yStar_)) + /(scalar(1) - exp(-Aepsilon_*yStar_) + SMALL + ) + *sqr(k_)/(epsilon_ + epsilonSmall_) + // cubic term C5, implicit part + + max + ( + C5viscosity_, + dimensionedScalar("0", C5viscosity_.dimensions(), 0.0) + ) + ), + // turbulent viscosity, with implicit part of C5 + + nonlinearStress_ + ( + "nonlinearStress", + symm + ( + // quadratic terms + pow(k_, 3.0)/sqr(epsilon_) + *( + Ctau1_/fEta_ + *( + (gradU_ & gradU_) + + (gradU_ & gradU_)().T() + ) + + Ctau2_/fEta_*(gradU_ & gradU_.T()) + + Ctau3_/fEta_*(gradU_.T() & gradU_) + ) + // cubic term C4 + - 20.0*pow(k_, 4.0)/pow(epsilon_, 3.0) + *pow(Cmu_, 3.0) + *( + ((gradU_ & gradU_) & gradU_.T()) + + ((gradU_ & gradU_.T()) & gradU_.T()) + - ((gradU_.T() & gradU_) & gradU_) + - ((gradU_.T() & gradU_.T()) & gradU_) + ) + // cubic term C5, explicit part + + min + ( + C5viscosity_, + dimensionedScalar("0", C5viscosity_.dimensions(), 0.0) + )*gradU_ + ) + ) +{ + printCoeffs(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +tmp<volSymmTensorField> LienCubicKELowRe::R() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + "R", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + ((2.0/3.0)*I)*k_ - nut_*twoSymm(gradU_) + nonlinearStress_, + k_.boundaryField().types() + ) + ); +} + + +tmp<volSymmTensorField> LienCubicKELowRe::devReff() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + "devRhoReff", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + -nuEff()*dev(twoSymm(fvc::grad(U_))) + nonlinearStress_ + ) + ); +} + + +tmp<fvVectorMatrix> LienCubicKELowRe::divDevReff(volVectorField& U) const +{ + return + ( + fvc::div(nonlinearStress_) + - fvm::laplacian(nuEff(), U) + - fvc::div(nuEff()*dev(fvc::grad(U)().T())) + ); +} + + +bool LienCubicKELowRe::read() +{ + if (RASModel::read()) + { + C1_.readIfPresent(coeffDict_); + C2_.readIfPresent(coeffDict_); + alphak_.readIfPresent(coeffDict_); + alphaEps_.readIfPresent(coeffDict_); + A1_.readIfPresent(coeffDict_); + A2_.readIfPresent(coeffDict_); + Ctau1_.readIfPresent(coeffDict_); + Ctau2_.readIfPresent(coeffDict_); + Ctau3_.readIfPresent(coeffDict_); + alphaKsi_.readIfPresent(coeffDict_); + CmuWall_.readIfPresent(coeffDict_); + Am_.readIfPresent(coeffDict_); + Aepsilon_.readIfPresent(coeffDict_); + Amu_.readIfPresent(coeffDict_); + + return true; + } + else + { + return false; + } +} + + +void LienCubicKELowRe::correct() +{ + RASModel::correct(); + + if (!turbulence_) + { + return; + } + + if (mesh_.changing()) + { + y_.correct(); + } + + gradU_ = fvc::grad(U_); + + // generation term + volScalarField S2 = symm(gradU_) && gradU_; + + yStar_ = sqrt(k_)*y_/nu() + SMALL; + volScalarField Rt = sqr(k_)/(nu()*epsilon_); + + volScalarField fMu = + (scalar(1) - exp(-Am_*yStar_)) + /(scalar(1) - exp(-Aepsilon_*yStar_) + SMALL); + + volScalarField f2 = scalar(1) - 0.3*exp(-sqr(Rt)); + + volScalarField G = + Cmu_*fMu*sqr(k_)/epsilon_*S2 - (nonlinearStress_ && gradU_); + + // Dissipation equation + tmp<fvScalarMatrix> epsEqn + ( + fvm::ddt(epsilon_) + + fvm::div(phi_, epsilon_) + - fvm::laplacian(DepsilonEff(), epsilon_) + == + C1_*G*epsilon_/k_ + // E-term + + C2_*f2*pow(Cmu_, 0.75)*pow(k_, scalar(0.5)) + /(kappa_*y_*(scalar(1) - exp(-Aepsilon_*yStar_))) + *exp(-Amu_*sqr(yStar_))*epsilon_ + - fvm::Sp(C2_*f2*epsilon_/k_, epsilon_) + ); + + epsEqn().relax(); + +# include "LienCubicKELowReSetWallDissipation.H" +# include "wallDissipationI.H" + + solve(epsEqn); + bound(epsilon_, epsilon0_); + + + // Turbulent kinetic energy equation + + tmp<fvScalarMatrix> kEqn + ( + fvm::ddt(k_) + + fvm::div(phi_, k_) + - fvm::laplacian(DkEff(), k_) + == + G + - fvm::Sp(epsilon_/k_, k_) + ); + + kEqn().relax(); + solve(kEqn); + bound(k_, k0_); + + + // Re-calculate viscosity + + eta_ = k_/epsilon_*sqrt(2.0*magSqr(0.5*(gradU_ + gradU_.T()))); + ksi_ = k_/epsilon_*sqrt(2.0*magSqr(0.5*(gradU_ - gradU_.T()))); + Cmu_ = 2.0/(3.0*(A1_ + eta_ + alphaKsi_*ksi_)); + fEta_ = A2_ + pow(eta_, 3.0); + + C5viscosity_ = + - 2.0*pow(Cmu_, 3.0)*pow(k_, 4.0)/pow(epsilon_, 3.0) + *(magSqr(gradU_ + gradU_.T()) - magSqr(gradU_ - gradU_.T())); + + nut_ = + Cmu_*fMu*sqr(k_)/epsilon_ + // C5 term, implicit + + max + ( + C5viscosity_, + dimensionedScalar("0", C5viscosity_.dimensions(), 0.0) + ); + + nonlinearStress_ = symm + ( + // quadratic terms + pow(k_, 3.0)/sqr(epsilon_) + *( + Ctau1_/fEta_ + *( + (gradU_ & gradU_) + + (gradU_ & gradU_)().T() + ) + + Ctau2_/fEta_*(gradU_ & gradU_.T()) + + Ctau3_/fEta_*(gradU_.T() & gradU_) + ) + // cubic term C4 + - 20.0*pow(k_, 4.0)/pow(epsilon_, 3.0) + *pow(Cmu_, 3.0) + *( + ((gradU_ & gradU_) & gradU_.T()) + + ((gradU_ & gradU_.T()) & gradU_.T()) + - ((gradU_.T() & gradU_) & gradU_) + - ((gradU_.T() & gradU_.T()) & gradU_) + ) + // cubic term C5, explicit part + + min + ( + C5viscosity_, + dimensionedScalar("0", C5viscosity_.dimensions(), 0.0) + )*gradU_ + ); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/LienCubicKELowRe/LienCubicKELowRe.H b/src/turbulenceModels/incompressible/RAS/LienCubicKELowRe/LienCubicKELowRe.H new file mode 100644 index 00000000000..02d0fc63cf6 --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/LienCubicKELowRe/LienCubicKELowRe.H @@ -0,0 +1,197 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::incompressible::RASModels::LienCubicKELowRe + +Description + Lien cubic non-linear low-Reynolds k-epsilon turbulence models for + incompressible flows. + + References: + @verbatim + Lien, F.S., Chen, W.L., Leschziner, M.A., + "Low-Reynolds-number eddy-viscosity modeling based on non-linear + stress-strain/vorticity relations" + Engineering Turbulence Modelling and Experiments 3 + (Edited by Rodi, W. and Bergeles, G.), 91-100. 1996. + Elsevier Science Publishers. + + Etemad, S., et al., + "Turbulent flow and heat transfer in a square-sectioned U bend" + Progress in compuational fluid dynamics 6, 89-100. 2006. + @endverbatim + +SourceFiles + LienCubicKELowRe.C + +\*---------------------------------------------------------------------------*/ + +#ifndef LienCubicKELowRe_H +#define LienCubicKELowRe_H + +#include "RASModel.H" +#include "wallDist.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class LienCubicKELowRe Declaration +\*---------------------------------------------------------------------------*/ + +class LienCubicKELowRe +: + public RASModel +{ + // Private data + + dimensionedScalar C1_; + dimensionedScalar C2_; + dimensionedScalar alphak_; + dimensionedScalar alphaEps_; + dimensionedScalar A1_; + dimensionedScalar A2_; + dimensionedScalar Ctau1_; + dimensionedScalar Ctau2_; + dimensionedScalar Ctau3_; + dimensionedScalar alphaKsi_; + + dimensionedScalar CmuWall_; + + dimensionedScalar Am_; + dimensionedScalar Aepsilon_; + dimensionedScalar Amu_; + + volScalarField k_; + volScalarField epsilon_; + + wallDist y_; + + volTensorField gradU_; + volScalarField eta_; + volScalarField ksi_; + volScalarField Cmu_; + volScalarField fEta_; + volScalarField C5viscosity_; + + volScalarField yStar_; + + volScalarField nut_; + + volSymmTensorField nonlinearStress_; + +public: + + //- Runtime type information + TypeName("LienCubicKELowRe"); + + // Constructors + + //- from components + LienCubicKELowRe + ( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport + ); + + + //- Destructor + virtual ~LienCubicKELowRe() + {} + + + // Member Functions + + //- Return the turbulence viscosity + virtual tmp<volScalarField> nut() const + { + return nut_; + } + + //- Return the effective diffusivity for k + tmp<volScalarField> DkEff() const + { + return tmp<volScalarField> + ( + new volScalarField("DkEff", alphak_*nut_ + nu()) + ); + } + + //- Return the effective diffusivity for epsilon + tmp<volScalarField> DepsilonEff() const + { + return tmp<volScalarField> + ( + new volScalarField("DepsilonEff", alphaEps_*nut_ + nu()) + ); + } + + //- Return the turbulence kinetic energy + virtual tmp<volScalarField> k() const + { + return k_; + } + + //- Return the turbulence kinetic energy dissipation rate + virtual tmp<volScalarField> epsilon() const + { + return epsilon_; + } + + //- Return the Reynolds stress tensor + virtual tmp<volSymmTensorField> R() const; + + //- Return the effective stress tensor including the laminar stress + virtual tmp<volSymmTensorField> devReff() const; + + //- Return the source term for the momentum equation + virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const; + + //- Solve the turbulence equations and correct the turbulence viscosity + virtual void correct(); + + //- Read turbulenceProperties dictionary + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // Edn namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/LienCubicKELowRe/LienCubicKELowReSetWallDissipation.H b/src/turbulenceModels/incompressible/RAS/LienCubicKELowRe/LienCubicKELowReSetWallDissipation.H new file mode 100644 index 00000000000..ef216dcf687 --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/LienCubicKELowRe/LienCubicKELowReSetWallDissipation.H @@ -0,0 +1,71 @@ +// Set the dissipation in the near-wall cell to the value prescribed by the +// Lien-Leschziner low-Re model with Wolfstein length-scale prescription + +{ + labelList cellBoundaryFaceCount(epsilon_.size(), 0); + + //- use constant Cmu for epsilon in the near-wall cell + scalar Cmu75 = pow(CmuWall_.value(), 0.75); + + const fvPatchList& patches = mesh_.boundary(); + + //- Initialise the near-wall epsilon field to zero + forAll(patches, patchi) + { + const fvPatch& curPatch = patches[patchi]; + + if (isType<wallFvPatch>(curPatch)) + { + forAll(curPatch, facei) + { + label faceCelli = curPatch.faceCells()[facei]; + + epsilon_[faceCelli] = 0.0; + } + } + } + + forAll(patches, patchi) + { + const fvPatch& curPatch = patches[patchi]; + + if (isType<wallFvPatch>(curPatch)) + { + forAll(curPatch, facei) + { + label faceCelli = curPatch.faceCells()[facei]; + + // For corner cells (with two boundary or more faces), + // epsilon in the near-wall cell are calculated as an average + + cellBoundaryFaceCount[faceCelli]++; + + epsilon_[faceCelli] += + Cmu75*pow(k_[faceCelli], 1.5) + /( + kappa_.value()*y_[faceCelli] + *(1.0 - exp(-Aepsilon_.value()*yStar_[faceCelli])) + ) + *exp(-Amu_.value()*sqr(yStar_[faceCelli])); + + } + } + } + + // perform the averaging + + forAll(patches, patchi) + { + const fvPatch& curPatch = patches[patchi]; + + if (isType<wallFvPatch>(curPatch)) + { + forAll(curPatch, facei) + { + label faceCelli = curPatch.faceCells()[facei]; + + epsilon_[faceCelli] /= cellBoundaryFaceCount[faceCelli]; + } + } + } +} diff --git a/src/turbulenceModels/incompressible/RAS/LienLeschzinerLowRe/LienLeschzinerLowRe.C b/src/turbulenceModels/incompressible/RAS/LienLeschzinerLowRe/LienLeschzinerLowRe.C new file mode 100644 index 00000000000..6c51a324a51 --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/LienLeschzinerLowRe/LienLeschzinerLowRe.C @@ -0,0 +1,275 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "LienLeschzinerLowRe.H" +#include "wallFvPatch.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(LienLeschzinerLowRe, 0); +addToRunTimeSelectionTable(RASModel, LienLeschzinerLowRe, dictionary); + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +LienLeschzinerLowRe::LienLeschzinerLowRe +( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& lamTransportModel +) +: + RASModel(typeName, U, phi, lamTransportModel), + + C1(coeffDict_.lookupOrAddDefault<scalar>("C1", 1.44)), + C2(coeffDict_.lookupOrAddDefault<scalar>("C2", 1.92)), + alphak(coeffDict_.lookupOrAddDefault<scalar>("alphak", 1.0)), + alphaEps + ( + coeffDict_.lookupOrAddDefault<scalar>("alphaEps", 0.76923) + ), + Cmu(coeffDict_.lookupOrAddDefault<scalar>("Cmu", 0.09)), + Am(coeffDict_.lookupOrAddDefault<scalar>("Am", 0.016)), + Aepsilon + ( + coeffDict_.lookupOrAddDefault<scalar>("Aepsilon", 0.263) + ), + Amu(coeffDict_.lookupOrAddDefault<scalar>("Amu", 0.00222)), + + k_ + ( + IOobject + ( + "k", + runTime_.timeName(), + mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh_ + ), + + epsilon_ + ( + IOobject + ( + "epsilon", + runTime_.timeName(), + mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh_ + ), + + y_(mesh_), + + yStar_(sqrt(k_)*y_/nu() + SMALL), + + nut_ + ( + Cmu*(scalar(1) - exp(-Am*yStar_)) + /(scalar(1) - exp(-Aepsilon*yStar_) + SMALL)*sqr(k_) + /(epsilon_ + epsilonSmall_) + ) +{ + printCoeffs(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +tmp<volSymmTensorField> LienLeschzinerLowRe::R() const +{ + volTensorField gradU = fvc::grad(U_); + + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + "R", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + ((2.0/3.0)*I)*k_ - nut_*twoSymm(gradU), + k_.boundaryField().types() + ) + ); +} + + +tmp<volSymmTensorField> LienLeschzinerLowRe::devReff() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + "devRhoReff", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + -nuEff()*dev(twoSymm(fvc::grad(U_))) + ) + ); +} + + +tmp<fvVectorMatrix> LienLeschzinerLowRe::divDevReff(volVectorField& U) const +{ + return + ( + - fvm::laplacian(nuEff(), U) + //- (fvc::grad(U) & fvc::grad(nuEff())) + - fvc::div(nuEff()*fvc::grad(U)().T()) + ); +} + + +bool LienLeschzinerLowRe::read() +{ + if (RASModel::read()) + { + coeffDict_.readIfPresent<scalar>("C1", C1); + coeffDict_.readIfPresent<scalar>("C2", C2); + coeffDict_.readIfPresent<scalar>("alphak", alphak); + coeffDict_.readIfPresent<scalar>("alphaEps", alphaEps); + coeffDict_.readIfPresent<scalar>("Cmu", Cmu); + coeffDict_.readIfPresent<scalar>("Am", Am); + coeffDict_.readIfPresent<scalar>("Aepsilon", Aepsilon); + coeffDict_.readIfPresent<scalar>("Amu", Amu); + + return true; + } + else + { + return false; + } +} + + +void LienLeschzinerLowRe::correct() +{ + RASModel::correct(); + + if (!turbulence_) + { + return; + } + + if (mesh_.changing()) + { + y_.correct(); + } + + scalar Cmu75 = pow(Cmu, 0.75); + + volTensorField gradU = fvc::grad(U_); + + // generation term + volScalarField S2 = symm(gradU) && gradU; + + yStar_ = sqrt(k_)*y_/nu() + SMALL; + volScalarField Rt = sqr(k_)/(nu()*epsilon_); + + volScalarField fMu = + (scalar(1) - exp(-Am*yStar_)) + /(scalar(1) - exp(-Aepsilon*yStar_) + SMALL); + + volScalarField f2 = scalar(1) - 0.3*exp(-sqr(Rt)); + + volScalarField G = Cmu*fMu*sqr(k_)/epsilon_*S2; + + + // Dissipation equation + tmp<fvScalarMatrix> epsEqn + ( + fvm::ddt(epsilon_) + + fvm::div(phi_, epsilon_) + - fvm::laplacian(DepsilonEff(), epsilon_) + == + C1*G*epsilon_/k_ + // E-term + + C2*f2*Cmu75*pow(k_, scalar(0.5)) + /(kappa_*y_*(scalar(1) - exp(-Aepsilon*yStar_))) + *exp(-Amu*sqr(yStar_))*epsilon_ + - fvm::Sp(C2*f2*epsilon_/k_, epsilon_) + ); + + epsEqn().relax(); + +# include "LienLeschzinerLowReSetWallDissipation.H" +# include "wallDissipationI.H" + + solve(epsEqn); + bound(epsilon_, epsilon0_); + + + // Turbulent kinetic energy equation + + tmp<fvScalarMatrix> kEqn + ( + fvm::ddt(k_) + + fvm::div(phi_, k_) + - fvm::laplacian(DkEff(), k_) + == + G + - fvm::Sp(epsilon_/k_, k_) + ); + + kEqn().relax(); + solve(kEqn); + bound(k_, k0_); + + + // Re-calculate viscosity + nut_ = Cmu*fMu*sqr(k_)/epsilon_; +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/LienLeschzinerLowRe/LienLeschzinerLowRe.H b/src/turbulenceModels/incompressible/RAS/LienLeschzinerLowRe/LienLeschzinerLowRe.H new file mode 100644 index 00000000000..41df680dd95 --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/LienLeschzinerLowRe/LienLeschzinerLowRe.H @@ -0,0 +1,167 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::incompressible::RASModels::LienLeschzinerLowRe + +Description + Lien and Leschziner low-Reynolds k-epsilon turbulence model for + incompressible flows. + +SourceFiles + LienLeschzinerLowRe.C + +\*---------------------------------------------------------------------------*/ + +#ifndef LienLeschzinerLowRe_H +#define LienLeschzinerLowRe_H + +#include "RASModel.H" +#include "wallDist.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class LienLeschzinerLowRe Declaration +\*---------------------------------------------------------------------------*/ + +class LienLeschzinerLowRe +: + public RASModel +{ + // Private data + + scalar C1; + scalar C2; + scalar alphak; + scalar alphaEps; + scalar Cmu; + + scalar Am; + scalar Aepsilon; + scalar Amu; + + volScalarField k_; + volScalarField epsilon_; + + wallDist y_; + + volScalarField yStar_; + + volScalarField nut_; + + +public: + + TypeName("LienLeschzinerLowRe"); + + // Constructors + + //- from components + LienLeschzinerLowRe + ( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport + ); + + + //- Destructor + virtual ~LienLeschzinerLowRe() + {} + + + // Member Functions + + //- Return the turbulence viscosity + virtual tmp<volScalarField> nut() const + { + return nut_; + } + + //- Return the effective diffusivity for k + tmp<volScalarField> DkEff() const + { + return tmp<volScalarField> + ( + new volScalarField("DkEff", alphak*nut_ + nu()) + ); + } + + //- Return the effective diffusivity for epsilon + tmp<volScalarField> DepsilonEff() const + { + return tmp<volScalarField> + ( + new volScalarField("DepsilonEff", alphaEps*nut_ + nu()) + ); + } + + //- Return the turbulence kinetic energy + virtual tmp<volScalarField> k() const + { + return k_; + } + + //- Return the turbulence kinetic energy dissipation rate + virtual tmp<volScalarField> epsilon() const + { + return epsilon_; + } + + //- Return the Reynolds stress tensor + virtual tmp<volSymmTensorField> R() const; + + //- Return the effective stress tensor including the laminar stress + virtual tmp<volSymmTensorField> devReff() const; + + //- Return the source term for the momentum equation + virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const; + + //- Solve the turbulence equations and correct the turbulence viscosity + virtual void correct(); + + //- Read turbulenceProperties dictionary + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/LienLeschzinerLowRe/LienLeschzinerLowReSetWallDissipation.H b/src/turbulenceModels/incompressible/RAS/LienLeschzinerLowRe/LienLeschzinerLowReSetWallDissipation.H new file mode 100644 index 00000000000..a998d3af8e0 --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/LienLeschzinerLowRe/LienLeschzinerLowReSetWallDissipation.H @@ -0,0 +1,71 @@ +// Set the dissipation in the near-wall cell to the value prescribed by the +// Lien-Leschziner low-Re model with Wolfstein length-scale prescription + +{ + labelList cellBoundaryFaceCount(epsilon_.size(), 0); + + //- use constant Cmu for epsilon in the near-wall cell + scalar Cmu75 = pow(Cmu, 0.75); + + const fvPatchList& patches = mesh_.boundary(); + + //- Initialise the near-wall epsilon field to zero + forAll(patches, patchi) + { + const fvPatch& curPatch = patches[patchi]; + + if (isType<wallFvPatch>(curPatch)) + { + forAll(curPatch, facei) + { + label faceCelli = curPatch.faceCells()[facei]; + + epsilon_[faceCelli] = 0.0; + } + } + } + + forAll(patches, patchi) + { + const fvPatch& curPatch = patches[patchi]; + + if (isType<wallFvPatch>(curPatch)) + { + forAll(curPatch, facei) + { + label faceCelli = curPatch.faceCells()[facei]; + + // For corner cells (with two boundary or more faces), + // epsilon in the near-wall cell are calculated as an average + + cellBoundaryFaceCount[faceCelli]++; + + epsilon_[faceCelli] += + Cmu75*pow(k_[faceCelli], 1.5) + /( + kappa_.value()*y_[faceCelli] + *(1.0 - exp(-Aepsilon*yStar_[faceCelli])) + ) + *exp(-Amu*sqr(yStar_[faceCelli])); + + } + } + } + + // perform the averaging + + forAll(patches, patchi) + { + const fvPatch& curPatch = patches[patchi]; + + if (isType<wallFvPatch>(curPatch)) + { + forAll(curPatch, facei) + { + label faceCelli = curPatch.faceCells()[facei]; + + epsilon_[faceCelli] /= cellBoundaryFaceCount[faceCelli]; + } + } + } +} diff --git a/src/turbulenceModels/incompressible/RAS/Make/files b/src/turbulenceModels/incompressible/RAS/Make/files new file mode 100644 index 00000000000..d5736d30641 --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/Make/files @@ -0,0 +1,47 @@ +RASModel/RASModel.C + +laminar/laminar.C +kEpsilon/kEpsilon.C +RNGkEpsilon/RNGkEpsilon.C +realizableKE/realizableKE.C +kOmega/kOmega.C +kOmegaSST/kOmegaSST.C +SpalartAllmaras/SpalartAllmaras.C +LRR/LRR.C +LaunderGibsonRSTM/LaunderGibsonRSTM.C +LaunderSharmaKE/LaunderSharmaKE.C +QZeta/QZeta.C +LienCubicKE/LienCubicKE.C +LienCubicKELowRe/LienCubicKELowRe.C +NonlinearKEShih/NonlinearKEShih.C +LienLeschzinerLowRe/LienLeschzinerLowRe.C +LamBremhorstKE/LamBremhorstKE.C + +/* Wall functions */ +wallFunctions = derivedFvPatchFields/wallFunctions + +nutWallFunctions = $(wallFunctions)/nutWallFunctions +$(nutWallFunctions)/nutWallFunction/nutWallFunctionFvPatchScalarField.C +$(nutWallFunctions)/nutRoughWallFunction/nutRoughWallFunctionFvPatchScalarField.C +$(nutWallFunctions)/nutSpalartAllmarasWallFunction/nutSpalartAllmarasWallFunctionFvPatchScalarField.C +$(nutWallFunctions)/nutSpalartAllmarasStandardWallFunction/nutSpalartAllmarasStandardWallFunctionFvPatchScalarField.C +$(nutWallFunctions)/nutSpalartAllmarasStandardRoughWallFunction/nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.C + +epsilonWallFunctions = $(wallFunctions)/epsilonWallFunctions +$(epsilonWallFunctions)/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C + +omegaWallFunctions = $(wallFunctions)/omegaWallFunctions +$(omegaWallFunctions)/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C + +kQRWallFunctions = $(wallFunctions)/kQRWallFunctions +$(kQRWallFunctions)/kQRWallFunction/kQRWallFunctionFvPatchFields.C + + +/* Patch fields */ +derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C +derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C +derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C + +backwardsCompatibilityWallFunctions/backwardsCompatibilityWallFunctions.C + +LIB = $(FOAM_LIBBIN)/libincompressibleRASModels diff --git a/src/turbulenceModels/incompressible/RAS/Make/options b/src/turbulenceModels/incompressible/RAS/Make/options new file mode 100644 index 00000000000..701f27bfc00 --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/Make/options @@ -0,0 +1,10 @@ +EXE_INC = \ + -I../turbulenceModel/lnInclude \ + -I$(LIB_SRC)/transportModels \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude + +LIB_LIBS = \ + -lincompressibleTurbulenceModel \ + -lfiniteVolume \ + -lmeshTools diff --git a/src/turbulenceModels/incompressible/RAS/NonlinearKEShih/NonlinearKEShih.C b/src/turbulenceModels/incompressible/RAS/NonlinearKEShih/NonlinearKEShih.C new file mode 100644 index 00000000000..bbf4155c829 --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/NonlinearKEShih/NonlinearKEShih.C @@ -0,0 +1,374 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "NonlinearKEShih.H" +#include "addToRunTimeSelectionTable.H" +#include "wallFvPatch.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(NonlinearKEShih, 0); +addToRunTimeSelectionTable(RASModel, NonlinearKEShih, dictionary); + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +NonlinearKEShih::NonlinearKEShih +( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& lamTransportModel +) +: + RASModel(typeName, U, phi, lamTransportModel), + + C1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "C1", + coeffDict_, + 1.44 + ) + ), + C2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "C2", + coeffDict_, + 1.92 + ) + ), + alphak_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphak", + coeffDict_, + 1.0 + ) + ), + alphaEps_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphaEps", + coeffDict_, + 0.76923 + ) + ), + A1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "A1", + coeffDict_, + 1.25 + ) + ), + A2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "A2", + coeffDict_, + 1000.0 + ) + ), + Ctau1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Ctau1", + coeffDict_, + -4.0 + ) + ), + Ctau2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Ctau2", + coeffDict_, + 13.0 + ) + ), + Ctau3_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Ctau3", + coeffDict_, + -2.0 + ) + ), + alphaKsi_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphaKsi", + coeffDict_, + 0.9 + ) + ), + + k_ + ( + IOobject + ( + "k", + runTime_.timeName(), + mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh_ + ), + + epsilon_ + ( + IOobject + ( + "epsilon", + runTime_.timeName(), + mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh_ + ), + + gradU_(fvc::grad(U)), + eta_(k_/epsilon_*sqrt(2.0*magSqr(0.5*(gradU_ + gradU_.T())))), + ksi_(k_/epsilon_*sqrt(2.0*magSqr(0.5*(gradU_ - gradU_.T())))), + Cmu_(2.0/(3.0*(A1_ + eta_ + alphaKsi_*ksi_))), + fEta_(A2_ + pow(eta_, 3.0)), + + nut_(Cmu_*sqr(k_)/(epsilon_ + epsilonSmall_)), + + nonlinearStress_ + ( + "nonlinearStress", + symm + ( + pow(k_, 3.0)/sqr(epsilon_) + *( + Ctau1_/fEta_ + *( + (gradU_ & gradU_) + + (gradU_ & gradU_)().T() + ) + + Ctau2_/fEta_*(gradU_ & gradU_.T()) + + Ctau3_/fEta_*(gradU_.T() & gradU_) + ) + ) + ) +{ +# include "wallNonlinearViscosityI.H" + + printCoeffs(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +tmp<volSymmTensorField> NonlinearKEShih::R() const +{ + volTensorField gradU_ = fvc::grad(U_); + + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + "R", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + ((2.0/3.0)*I)*k_ - nut_*twoSymm(gradU_) + nonlinearStress_, + k_.boundaryField().types() + ) + ); +} + + +tmp<volSymmTensorField> NonlinearKEShih::devReff() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + "devRhoReff", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + -nuEff()*dev(twoSymm(fvc::grad(U_))) + nonlinearStress_ + ) + ); +} + + +tmp<fvVectorMatrix> NonlinearKEShih::divDevReff(volVectorField& U) const +{ + return + ( + fvc::div(nonlinearStress_) + - fvm::laplacian(nuEff(), U) + - fvc::div(nuEff()*dev(fvc::grad(U)().T())) + ); +} + + +bool NonlinearKEShih::read() +{ + if (RASModel::read()) + { + C1_.readIfPresent(coeffDict_); + C2_.readIfPresent(coeffDict_); + alphak_.readIfPresent(coeffDict_); + alphaEps_.readIfPresent(coeffDict_); + A1_.readIfPresent(coeffDict_); + A2_.readIfPresent(coeffDict_); + Ctau1_.readIfPresent(coeffDict_); + Ctau2_.readIfPresent(coeffDict_); + Ctau3_.readIfPresent(coeffDict_); + alphaKsi_.readIfPresent(coeffDict_); + + return true; + } + else + { + return false; + } +} + + +void NonlinearKEShih::correct() +{ + RASModel::correct(); + + if (!turbulence_) + { + return; + } + + gradU_ = fvc::grad(U_); + + // generation term + volScalarField S2 = symm(gradU_) && gradU_; + + volScalarField G = + Cmu_*sqr(k_)/epsilon_*S2 + - (nonlinearStress_ && gradU_); + +# include "nonLinearWallFunctionsI.H" + + // Dissipation equation + tmp<fvScalarMatrix> epsEqn + ( + fvm::ddt(epsilon_) + + fvm::div(phi_, epsilon_) + - fvm::laplacian(DepsilonEff(), epsilon_) + == + C1_*G*epsilon_/k_ + - fvm::Sp(C2_*epsilon_/k_, epsilon_) + ); + + epsEqn().relax(); + +# include "wallDissipationI.H" + + solve(epsEqn); + bound(epsilon_, epsilon0_); + + + // Turbulent kinetic energy equation + + tmp<fvScalarMatrix> kEqn + ( + fvm::ddt(k_) + + fvm::div(phi_, k_) + - fvm::laplacian(DkEff(), k_) + == + G + - fvm::Sp(epsilon_/k_, k_) + ); + + kEqn().relax(); + solve(kEqn); + bound(k_, k0_); + + + // Re-calculate viscosity + + eta_ = k_/epsilon_*sqrt(2.0*magSqr(0.5*(gradU_ + gradU_.T()))); + ksi_ = k_/epsilon_*sqrt(2.0*magSqr(0.5*(gradU_ - gradU_.T()))); + Cmu_ = 2.0/(3.0*(A1_ + eta_ + alphaKsi_*ksi_)); + fEta_ = A2_ + pow(eta_, 3.0); + + nut_ = Cmu_*sqr(k_)/epsilon_; + +# include "wallNonlinearViscosityI.H" + + nonlinearStress_ = symm + ( + pow(k_, 3.0)/sqr(epsilon_) + *( + Ctau1_/fEta_ + *( + (gradU_ & gradU_) + + (gradU_ & gradU_)().T() + ) + + Ctau2_/fEta_*(gradU_ & gradU_.T()) + + Ctau3_/fEta_*(gradU_.T() & gradU_) + ) + ); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/NonlinearKEShih/NonlinearKEShih.H b/src/turbulenceModels/incompressible/RAS/NonlinearKEShih/NonlinearKEShih.H new file mode 100644 index 00000000000..091c99cadf2 --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/NonlinearKEShih/NonlinearKEShih.H @@ -0,0 +1,171 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::incompressible::RASModels::NonlinearKEShih + +Description + Shih's quadratic non-linear k-epsilon turbulence model for + incompressible flows + +SourceFiles + NonlinearKEShih.C + +\*---------------------------------------------------------------------------*/ + +#ifndef NonlinearKEShih_H +#define NonlinearKEShih_H + +#include "RASModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class NonlinearKEShih Declaration +\*---------------------------------------------------------------------------*/ + +class NonlinearKEShih +: + public RASModel +{ + // Private data + + dimensionedScalar C1_; + dimensionedScalar C2_; + dimensionedScalar alphak_; + dimensionedScalar alphaEps_; + dimensionedScalar A1_; + dimensionedScalar A2_; + dimensionedScalar Ctau1_; + dimensionedScalar Ctau2_; + dimensionedScalar Ctau3_; + dimensionedScalar alphaKsi_; + + volScalarField k_; + volScalarField epsilon_; + + volTensorField gradU_; + volScalarField eta_; + volScalarField ksi_; + volScalarField Cmu_; + volScalarField fEta_; + + volScalarField nut_; + + volSymmTensorField nonlinearStress_; + +public: + + //- Runtime type information + TypeName("NonlinearKEShih"); + + // Constructors + + //- from components + NonlinearKEShih + ( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport + ); + + + //- Destructor + virtual ~NonlinearKEShih() + {} + + + // Member Functions + + //- Return the turbulence viscosity + virtual tmp<volScalarField> nut() const + { + return nut_; + } + + //- Return the effective diffusivity for k + tmp<volScalarField> DkEff() const + { + return tmp<volScalarField> + ( + new volScalarField("DkEff", alphak_*nut_ + nu()) + ); + } + + //- Return the effective diffusivity for epsilon + tmp<volScalarField> DepsilonEff() const + { + return tmp<volScalarField> + ( + new volScalarField("DepsilonEff", alphaEps_*nut_ + nu()) + ); + } + + //- Return the turbulence kinetic energy + virtual tmp<volScalarField> k() const + { + return k_; + } + + //- Return the turbulence kinetic energy dissipation rate + virtual tmp<volScalarField> epsilon() const + { + return epsilon_; + } + + //- Return the Reynolds stress tensor + virtual tmp<volSymmTensorField> R() const; + + //- Return the effective stress tensor including the laminar stress + virtual tmp<volSymmTensorField> devReff() const; + + //- Return the source term for the momentum equation + virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const; + + //- Solve the turbulence equations and correct the turbulence viscosity + virtual void correct(); + + //- Read turbulenceProperties dictionary + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/QZeta/QZeta.C b/src/turbulenceModels/incompressible/RAS/QZeta/QZeta.C new file mode 100644 index 00000000000..336e6d6db60 --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/QZeta/QZeta.C @@ -0,0 +1,327 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "QZeta.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(QZeta, 0); +addToRunTimeSelectionTable(RASModel, QZeta, dictionary); + +// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // + +tmp<volScalarField> QZeta::fMu() const +{ + volScalarField Rt = q_*k_/(2.0*nu()*zeta_); + + if (anisotropic_) + { + return exp((-scalar(2.5) + Rt/20.0)/pow(scalar(1) + Rt/130.0, 3.0)); + } + else + { + return + exp(-6.0/sqr(scalar(1) + Rt/50.0)) + *(scalar(1) + 3.0*exp(-Rt/10.0)); + } +} + + +tmp<volScalarField> QZeta::f2() const +{ + volScalarField Rt = q_*k_/(2.0*nu()*zeta_); + return scalar(1) - 0.3*exp(-sqr(Rt)); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +QZeta::QZeta +( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& lamTransportModel +) +: + RASModel(typeName, U, phi, lamTransportModel), + + Cmu_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Cmu", + coeffDict_, + 0.09 + ) + ), + C1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "C1", + coeffDict_, + 1.44 + ) + ), + C2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "C2", + coeffDict_, + 1.92 + ) + ), + alphaZeta_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphaZeta", + coeffDict_, + 0.76923 + ) + ), + anisotropic_ + ( + Switch::lookupOrAddToDict + ( + "anisotropic", + coeffDict_, + false + ) + ), + + k_ + ( + IOobject + ( + "k", + runTime_.timeName(), + mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh_ + ), + + epsilon_ + ( + IOobject + ( + "epsilon", + runTime_.timeName(), + mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh_ + ), + + q_ + ( + IOobject + ( + "q", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + sqrt(k_), + k_.boundaryField().types() + ), + + zeta_ + ( + IOobject + ( + "zeta", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + epsilon_/(2.0*q_), + epsilon_.boundaryField().types() + ), + + nut_(Cmu_*fMu()*sqr(k_)/(epsilon_ + epsilonSmall_)) +{ + printCoeffs(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +tmp<volSymmTensorField> QZeta::R() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + "R", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + ((2.0/3.0)*I)*k_ - nut_*twoSymm(fvc::grad(U_)), + k_.boundaryField().types() + ) + ); +} + + +tmp<volSymmTensorField> QZeta::devReff() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + "devRhoReff", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + -nuEff()*dev(twoSymm(fvc::grad(U_))) + ) + ); +} + + +tmp<fvVectorMatrix> QZeta::divDevReff(volVectorField& U) const +{ + return + ( + - fvm::laplacian(nuEff(), U) + - fvc::div(nuEff()*dev(fvc::grad(U)().T())) + ); +} + + +bool QZeta::read() +{ + if (RASModel::read()) + { + Cmu_.readIfPresent(coeffDict_); + C1_.readIfPresent(coeffDict_); + C2_.readIfPresent(coeffDict_); + alphaZeta_.readIfPresent(coeffDict_); + anisotropic_.readIfPresent("anisotropic", coeffDict_); + + return true; + } + else + { + return false; + } +} + + +void QZeta::correct() +{ + RASModel::correct(); + + if (!turbulence_) + { + return; + } + + volScalarField S2 = 2*magSqr(symm(fvc::grad(U_))); + + volScalarField G = nut_/(2.0*q_)*S2; + volScalarField E = nu()*nut_/q_*fvc::magSqrGradGrad(U_); + + + // Zeta equation + + tmp<fvScalarMatrix> zetaEqn + ( + fvm::ddt(zeta_) + + fvm::div(phi_, zeta_) + - fvm::laplacian(DzetaEff(), zeta_) + == + (2.0*C1_ - 1)*G*zeta_/q_ + - fvm::Sp((2.0*C2_ - dimensionedScalar(1.0))*f2()*zeta_/q_, zeta_) + + E + ); + + zetaEqn().relax(); + solve(zetaEqn); + bound(zeta_, epsilon0_/(2*sqrt(k0_))); + + + // q equation + + tmp<fvScalarMatrix> qEqn + ( + fvm::ddt(q_) + + fvm::div(phi_, q_) + - fvm::laplacian(DqEff(), q_) + == + G - fvm::Sp(zeta_/q_, q_) + ); + + qEqn().relax(); + solve(qEqn); + bound(q_, sqrt(k0_)); + + + // Re-calculate k and epsilon + k_ = sqr(q_); + k_.correctBoundaryConditions(); + + epsilon_ = 2*q_*zeta_; + epsilon_.correctBoundaryConditions(); + + + // Re-calculate viscosity + nut_ = Cmu_*fMu()*sqr(k_)/epsilon_; +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/QZeta/QZeta.H b/src/turbulenceModels/incompressible/RAS/QZeta/QZeta.H new file mode 100644 index 00000000000..0d76112835a --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/QZeta/QZeta.H @@ -0,0 +1,178 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::incompressible::RASModels::QZeta + +Description + Gibson and Dafa'Alla's q-zeta two-equation low-Re turbulence model + for incompressible flows + +SourceFiles + QZeta.C + +\*---------------------------------------------------------------------------*/ + +#ifndef QZeta_H +#define QZeta_H + +#include "RASModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class QZeta Declaration +\*---------------------------------------------------------------------------*/ + +class QZeta +: + public RASModel +{ + // Private data + + dimensionedScalar Cmu_; + dimensionedScalar C1_; + dimensionedScalar C2_; + dimensionedScalar alphaZeta_; + Switch anisotropic_; + + volScalarField k_; + volScalarField epsilon_; + + volScalarField q_; + volScalarField zeta_; + + volScalarField nut_; + + + // Private member functions + + tmp<volScalarField> fMu() const; + tmp<volScalarField> f2() const; + + +public: + + //- Runtime type information + TypeName("QZeta"); + + // Constructors + + //- from components + QZeta + ( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport + ); + + + //- Destructor + virtual ~QZeta() + {} + + + // Member Functions + + //- Return the turbulence viscosity + virtual tmp<volScalarField> nut() const + { + return nut_; + } + + //- Return the effective diffusivity for q + tmp<volScalarField> DqEff() const + { + return tmp<volScalarField> + ( + new volScalarField("DqEff", nut_ + nu()) + ); + } + + //- Return the effective diffusivity for epsilon + tmp<volScalarField> DzetaEff() const + { + return tmp<volScalarField> + ( + new volScalarField("DzetaEff", alphaZeta_*nut_ + nu()) + ); + } + + //- Return the turbulence kinetic energy + virtual tmp<volScalarField> k() const + { + return k_; + } + + //- Return the turbulence kinetic energy dissipation rate + virtual tmp<volScalarField> epsilon() const + { + return epsilon_; + } + + //- Return the Reynolds stress tensor + virtual tmp<volSymmTensorField> R() const; + + virtual const volScalarField& q() const + { + return q_; + } + + virtual const volScalarField& zeta() const + { + return zeta_; + } + + //- Return the effective stress tensor including the laminar stress + virtual tmp<volSymmTensorField> devReff() const; + + //- Return the source term for the momentum equation + virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const; + + //- Solve the turbulence equations and correct the turbulence viscosity + virtual void correct(); + + //- Read turbulenceProperties dictionary + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.C b/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.C new file mode 100644 index 00000000000..197c84a033f --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.C @@ -0,0 +1,268 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "RASModel.H" +#include "wallFvPatch.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +defineTypeNameAndDebug(RASModel, 0); +defineRunTimeSelectionTable(RASModel, dictionary); +addToRunTimeSelectionTable(turbulenceModel, RASModel, turbulenceModel); + +// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * // + +void RASModel::printCoeffs() +{ + if (printCoeffs_) + { + Info<< type() << "Coeffs" << coeffDict_ << nl + << "wallFunctionCoeffs" << wallFunctionDict_ << endl; + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +RASModel::RASModel +( + const word& type, + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& lamTransportModel +) +: + turbulenceModel(U, phi, lamTransportModel), + + IOdictionary + ( + IOobject + ( + "RASProperties", + U.time().constant(), + U.db(), + IOobject::MUST_READ, + IOobject::NO_WRITE + ) + ), + + turbulence_(lookup("turbulence")), + printCoeffs_(lookupOrDefault<Switch>("printCoeffs", false)), + coeffDict_(subDict(type + "Coeffs")), + + wallFunctionDict_(subDict("wallFunctionCoeffs")), + kappa_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "kappa", + wallFunctionDict_, + 0.4187 + ) + ), + E_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "E", + wallFunctionDict_, + 9.0 + ) + ), + Cmu_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Cmu", + wallFunctionDict_, + 0.09 + ) + ), + + yPlusLam_(yPlusLam(kappa_.value(), E_.value())), + + k0_("k0", dimVelocity*dimVelocity, SMALL), + epsilon0_("epsilon", k0_.dimensions()/dimTime, SMALL), + epsilonSmall_("epsilonSmall", epsilon0_.dimensions(), SMALL), + + y_(mesh_) +{} + + +// * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * // + +autoPtr<RASModel> RASModel::New +( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport +) +{ + word RASModelTypeName; + + // Enclose the creation of the turbulencePropertiesDict to ensure it is + // deleted before the RASModel is created otherwise the dictionary + // is entered in the database twice + { + IOdictionary turbulencePropertiesDict + ( + IOobject + ( + "RASProperties", + U.time().constant(), + U.db(), + IOobject::MUST_READ, + IOobject::NO_WRITE + ) + ); + + turbulencePropertiesDict.lookup("RASModel") + >> RASModelTypeName; + } + + Info<< "Selecting RAS turbulence model " << RASModelTypeName << endl; + + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(RASModelTypeName); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalErrorIn + ( + "RASModel::New(const volVectorField&, " + "const surfaceScalarField&, transportModel&)" + ) << "Unknown RASModel type " << RASModelTypeName + << endl << endl + << "Valid RASModel types are :" << endl + << dictionaryConstructorTablePtr_->toc() + << exit(FatalError); + } + + return autoPtr<RASModel>(cstrIter()(U, phi, transport)); +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +RASModel::~RASModel() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +scalar RASModel::yPlusLam(const scalar kappa, const scalar E) const +{ + scalar ypl = 11.0; + + for (int i=0; i<10; i++) + { + ypl = log(max(E*ypl, 1))/kappa; + } + + return ypl; +} + + +tmp<scalarField> RASModel::yPlus(const label patchNo) const +{ + const fvPatch& curPatch = mesh_.boundary()[patchNo]; + + tmp<scalarField> tYp(new scalarField(curPatch.size())); + scalarField& Yp = tYp(); + + if (isType<wallFvPatch>(curPatch)) + { + Yp = pow(Cmu_.value(), 0.25) + *y_[patchNo] + *sqrt(k()().boundaryField()[patchNo].patchInternalField()) + /nu().boundaryField()[patchNo]; + } + else + { + WarningIn + ( + "tmp<scalarField> RASModel::yPlus(const label patchNo) const" + ) << "Patch " << patchNo << " is not a wall. Returning null field" + << nl << endl; + + Yp.setSize(0); + } + + return tYp; +} + + +void RASModel::correct() +{ + turbulenceModel::correct(); + + if (turbulence_ && mesh_.changing()) + { + y_.correct(); + } +} + + +bool RASModel::read() +{ + if (regIOobject::read()) + { + lookup("turbulence") >> turbulence_; + coeffDict_ = subDict(type() + "Coeffs"); + + wallFunctionDict_ = subDict("wallFunctionCoeffs"); + kappa_.readIfPresent(wallFunctionDict_); + E_.readIfPresent(wallFunctionDict_); + Cmu_.readIfPresent(wallFunctionDict_); + yPlusLam_ = yPlusLam(kappa_.value(), E_.value()); + + k0_.readIfPresent(*this); + epsilon0_.readIfPresent(*this); + epsilonSmall_.readIfPresent(*this); + + return true; + } + else + { + return false; + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.H b/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.H new file mode 100644 index 00000000000..ce1d77f3cfd --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.H @@ -0,0 +1,298 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Namespace + Foam::incompressible::RASModels + +Description + Namespace for incompressible RAS turbulence models. + +Class + Foam::incompressible::RASModel + +Description + Abstract base class for incompressible turbulence models. + +SourceFiles + RASModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef RASModel_H +#define RASModel_H + +#include "turbulenceModel.H" +#include "volFields.H" +#include "surfaceFields.H" +#include "nearWallDist.H" +#include "fvm.H" +#include "fvc.H" +#include "fvMatrices.H" +#include "incompressible/transportModel/transportModel.H" +#include "IOdictionary.H" +#include "Switch.H" +#include "bound.H" +#include "autoPtr.H" +#include "runTimeSelectionTables.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ + +/*---------------------------------------------------------------------------*\ + Class RASModel Declaration +\*---------------------------------------------------------------------------*/ + +class RASModel +: + public turbulenceModel, + public IOdictionary +{ + +protected: + + // Protected data + + Switch turbulence_; + Switch printCoeffs_; + dictionary coeffDict_; + + dictionary wallFunctionDict_; + dimensionedScalar kappa_; + dimensionedScalar E_; + dimensionedScalar Cmu_; + + scalar yPlusLam_; + + dimensionedScalar k0_; + dimensionedScalar epsilon0_; + dimensionedScalar epsilonSmall_; + + nearWallDist y_; + + + // Protected member functions + + //- Print model coefficients + virtual void printCoeffs(); + + +private: + + // Private Member Functions + + //- Disallow default bitwise copy construct + RASModel(const RASModel&); + + //- Disallow default bitwise assignment + void operator=(const RASModel&); + + +public: + + //- Runtime type information + TypeName("RASModel"); + + + // Declare run-time constructor selection table + + declareRunTimeSelectionTable + ( + autoPtr, + RASModel, + dictionary, + ( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& lamTransportModel + ), + (U, phi, lamTransportModel) + ); + + + // Constructors + + //- Construct from components + RASModel + ( + const word& type, + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& lamTransportModel + ); + + + // Selectors + + //- Return a reference to the selected RAS model + static autoPtr<RASModel> New + ( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& lamTransportModel + ); + + + //- Destructor + virtual ~RASModel(); + + + // Member Functions + + //- Return the value of k0 which k is not allowed to be less than + const dimensionedScalar& k0() const + { + return k0_; + } + + //- Return the value of epsilon0 which epsilon is not allowed to be + // less than + const dimensionedScalar& epsilon0() const + { + return epsilon0_; + } + + //- Return the value of epsilonSmall which is added to epsilon when + // calculating nut + const dimensionedScalar& epsilonSmall() const + { + return epsilonSmall_; + } + + //- Allow k0 to be changed + dimensionedScalar& k0() + { + return k0_; + } + + //- Allow epsilon0 to be changed + dimensionedScalar& epsilon0() + { + return epsilon0_; + } + + //- Allow epsilonSmall to be changed + dimensionedScalar& epsilonSmall() + { + return epsilonSmall_; + } + + //- Return kappa for use in wall-functions + dimensionedScalar kappa() const + { + return kappa_; + } + + //- Return E for use in wall-functions + dimensionedScalar E() const + { + return E_; + } + + //- Return Cmu for use in wall-functions + dimensionedScalar Cmu() const + { + return Cmu_; + } + + //- Return the near wall distances + const nearWallDist& y() const + { + return y_; + } + + //- Calculate y+ at the edge of the laminar sublayer + scalar yPlusLam(const scalar kappa, const scalar E) const; + + //- Return y+ at the edge of the laminar sublayer + // for use in wall-functions + scalar yPlusLam() const + { + return yPlusLam_; + } + + //- Const access to the coefficients dictionary + const dictionary& coeffDict() const + { + return coeffDict_; + } + + //- Const access to the wall functions coefficients dictionary + const dictionary& walLFunctionDict() const + { + return wallFunctionDict_; + } + + + //- Return the turbulence viscosity + virtual tmp<volScalarField> nut() const = 0; + + //- Return the effective viscosity + virtual tmp<volScalarField> nuEff() const + { + return tmp<volScalarField> + ( + new volScalarField("nuEff", nut() + nu()) + ); + } + + //- Return yPlus for the given patch + virtual tmp<scalarField> yPlus(const label patchI) const; + + //- Return the turbulence kinetic energy + virtual tmp<volScalarField> k() const = 0; + + //- Return the turbulence kinetic energy dissipation rate + virtual tmp<volScalarField> epsilon() const = 0; + + //- Return the Reynolds stress tensor + virtual tmp<volSymmTensorField> R() const = 0; + + //- Return the effective stress tensor including the laminar stress + virtual tmp<volSymmTensorField> devReff() const = 0; + + //- Return the source term for the momentum equation + virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const = 0; + + //- Solve the turbulence equations and correct the turbulence viscosity + virtual void correct() = 0; + + //- Read turbulenceProperties dictionary + virtual bool read() = 0; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/RNGkEpsilon/RNGkEpsilon.C b/src/turbulenceModels/incompressible/RAS/RNGkEpsilon/RNGkEpsilon.C new file mode 100644 index 00000000000..f632eea7986 --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/RNGkEpsilon/RNGkEpsilon.C @@ -0,0 +1,309 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "RNGkEpsilon.H" +#include "addToRunTimeSelectionTable.H" +#include "wallFvPatch.H" + +#include "backwardsCompatibilityWallFunctions.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(RNGkEpsilon, 0); +addToRunTimeSelectionTable(RASModel, RNGkEpsilon, dictionary); + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +RNGkEpsilon::RNGkEpsilon +( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& lamTransportModel +) +: + RASModel(typeName, U, phi, lamTransportModel), + + Cmu_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Cmu", + coeffDict_, + 0.0845 + ) + ), + C1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "C1", + coeffDict_, + 1.42 + ) + ), + C2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "C2", + coeffDict_, + 1.68 + ) + ), + alphak_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphak", + coeffDict_, + 1.39 + ) + ), + alphaEps_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphaEps", + coeffDict_, + 1.39 + ) + ), + eta0_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "eta0", + coeffDict_, + 4.38 + ) + ), + beta_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "beta", + coeffDict_, + 0.012 + ) + ), + + k_ + ( + IOobject + ( + "k", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + autoCreateK("k", mesh_) + ), + epsilon_ + ( + IOobject + ( + "epsilon", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + autoCreateEpsilon("epsilon", mesh_) + ), + nut_ + ( + IOobject + ( + "nut", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + autoCreateNut("nut", mesh_) + ) +{ + nut_ == Cmu_*sqr(k_)/(epsilon_ + epsilonSmall_); + nut_.correctBoundaryConditions(); + + printCoeffs(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + + +tmp<volSymmTensorField> RNGkEpsilon::R() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + "R", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + ((2.0/3.0)*I)*k_ - nut_*twoSymm(fvc::grad(U_)), + k_.boundaryField().types() + ) + ); +} + + +tmp<volSymmTensorField> RNGkEpsilon::devReff() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + "devRhoReff", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + -nuEff()*dev(twoSymm(fvc::grad(U_))) + ) + ); +} + + +tmp<fvVectorMatrix> RNGkEpsilon::divDevReff(volVectorField& U) const +{ + return + ( + - fvm::laplacian(nuEff(), U) + - fvc::div(nuEff()*dev(fvc::grad(U)().T())) + ); +} + + +bool RNGkEpsilon::read() +{ + if (RASModel::read()) + { + Cmu_.readIfPresent(coeffDict_); + C1_.readIfPresent(coeffDict_); + C2_.readIfPresent(coeffDict_); + alphak_.readIfPresent(coeffDict_); + alphaEps_.readIfPresent(coeffDict_); + eta0_.readIfPresent(coeffDict_); + beta_.readIfPresent(coeffDict_); + + return true; + } + else + { + return false; + } +} + + +void RNGkEpsilon::correct() +{ + RASModel::correct(); + + if (!turbulence_) + { + return; + } + + volScalarField S2 = 2*magSqr(symm(fvc::grad(U_))); + + volScalarField G("G", nut_*S2); + + volScalarField eta = sqrt(S2)*k_/epsilon_; + volScalarField R = + ((eta*(scalar(1) - eta/eta0_))/(scalar(1) + beta_*eta*sqr(eta))); + + // Update espsilon and G at the wall + epsilon_.boundaryField().updateCoeffs(); + + // Dissipation equation + tmp<fvScalarMatrix> epsEqn + ( + fvm::ddt(epsilon_) + + fvm::div(phi_, epsilon_) + - fvm::laplacian(DepsilonEff(), epsilon_) + == + (C1_ - R)*G*epsilon_/k_ + //- fvm::SuSp(R*G/k_, epsilon_) + - fvm::Sp(C2_*epsilon_/k_, epsilon_) + ); + + epsEqn().relax(); + + epsEqn().boundaryManipulate(epsilon_.boundaryField()); + + solve(epsEqn); + bound(epsilon_, epsilon0_); + + + // Turbulent kinetic energy equation + + tmp<fvScalarMatrix> kEqn + ( + fvm::ddt(k_) + + fvm::div(phi_, k_) + - fvm::laplacian(DkEff(), k_) + == + G - fvm::Sp(epsilon_/k_, k_) + ); + + kEqn().relax(); + solve(kEqn); + bound(k_, k0_); + + + // Re-calculate viscosity + nut_ == Cmu_*sqr(k_)/epsilon_; + nut_.correctBoundaryConditions(); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/RNGkEpsilon/RNGkEpsilon.H b/src/turbulenceModels/incompressible/RAS/RNGkEpsilon/RNGkEpsilon.H new file mode 100644 index 00000000000..7710c54bf16 --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/RNGkEpsilon/RNGkEpsilon.H @@ -0,0 +1,175 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::incompressible::RASModels::RNGkEpsilon + +Description + Renormalisation group k-epsilon turbulence model for incompressible flows. + + The default model coefficients correspond to the following: + @verbatim + RNGkEpsilonCoeffs + { + Cmu 0.0845; + C1 1.42; + C2 1.68; + C3 -0.33; // only for compressible + alphah 1.0; // only for compressible + alphak 1.39; + alphaEps 1.39; + eta0 4.38; + beta 0.012; + } + @endverbatim + +SourceFiles + RNGkEpsilon.C + +\*---------------------------------------------------------------------------*/ + +#ifndef RNGkEpsilon_H +#define RNGkEpsilon_H + +#include "RASModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class RNGkEpsilon Declaration +\*---------------------------------------------------------------------------*/ + +class RNGkEpsilon +: + public RASModel +{ + // Private data + + dimensionedScalar Cmu_; + dimensionedScalar C1_; + dimensionedScalar C2_; + dimensionedScalar alphak_; + dimensionedScalar alphaEps_; + dimensionedScalar eta0_; + dimensionedScalar beta_; + + volScalarField k_; + volScalarField epsilon_; + volScalarField nut_; + + +public: + + //- Runtime type information + TypeName("RNGkEpsilon"); + + // Constructors + + //- from components + RNGkEpsilon + ( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport + ); + + + //- Destructor + virtual ~RNGkEpsilon() + {} + + + // Member Functions + + //- Return the turbulence viscosity + virtual tmp<volScalarField> nut() const + { + return nut_; + } + + //- Return the effective diffusivity for k + tmp<volScalarField> DkEff() const + { + return tmp<volScalarField> + ( + new volScalarField("DkEff", alphak_*nut_ + nu()) + ); + } + + //- Return the effective diffusivity for epsilon + tmp<volScalarField> DepsilonEff() const + { + return tmp<volScalarField> + ( + new volScalarField("DepsilonEff", alphaEps_*nut_ + nu()) + ); + } + + //- Return the turbulence kinetic energy + virtual tmp<volScalarField> k() const + { + return k_; + } + + //- Return the turbulence kinetic energy dissipation rate + virtual tmp<volScalarField> epsilon() const + { + return epsilon_; + } + + //- Return the Reynolds stress tensor + virtual tmp<volSymmTensorField> R() const; + + //- Return the effective stress tensor including the laminar stress + virtual tmp<volSymmTensorField> devReff() const; + + //- Return the source term for the momentum equation + virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const; + + //- Solve the turbulence equations and correct the turbulence viscosity + virtual void correct(); + + //- Read turbulenceProperties dictionary + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/SpalartAllmaras/SpalartAllmaras.C b/src/turbulenceModels/incompressible/RAS/SpalartAllmaras/SpalartAllmaras.C new file mode 100644 index 00000000000..c22460a1d81 --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/SpalartAllmaras/SpalartAllmaras.C @@ -0,0 +1,388 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "SpalartAllmaras.H" +#include "addToRunTimeSelectionTable.H" +#include "wallDist.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(SpalartAllmaras, 0); +addToRunTimeSelectionTable(RASModel, SpalartAllmaras, dictionary); + +// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // + +tmp<volScalarField> SpalartAllmaras::chi() const +{ + return nuTilda_/nu(); +} + + +tmp<volScalarField> SpalartAllmaras::fv1(const volScalarField& chi) const +{ + volScalarField chi3 = pow3(chi); + return chi3/(chi3 + pow3(Cv1_)); +} + + +tmp<volScalarField> SpalartAllmaras::fv2 +( + const volScalarField& chi, + const volScalarField& fv1 +) const +{ + return 1.0 - chi/(1.0 + chi*fv1); + //return 1.0/pow3(scalar(1) + chi/Cv2); +} + + +tmp<volScalarField> SpalartAllmaras::fv3 +( + const volScalarField& chi, + const volScalarField& fv1 +) const +{ + volScalarField chiByCv2 = (1/Cv2_)*chi; + + return + (scalar(1) + chi*fv1) + *(1/Cv2_) + *(3*(scalar(1) + chiByCv2) + sqr(chiByCv2)) + /pow3(scalar(1) + chiByCv2); +} + + +tmp<volScalarField> SpalartAllmaras::fw(const volScalarField& Stilda) const +{ + volScalarField r = min + ( + nuTilda_ + /( + max(Stilda, dimensionedScalar("SMALL", Stilda.dimensions(), SMALL)) + *sqr(kappa_*d_) + ), + scalar(10.0) + ); + r.boundaryField() == 0.0; + + volScalarField g = r + Cw2_*(pow6(r) - r); + + return g*pow((1.0 + pow6(Cw3_))/(pow6(g) + pow6(Cw3_)), 1.0/6.0); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +SpalartAllmaras::SpalartAllmaras +( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& lamTransportModel +) +: + RASModel(typeName, U, phi, lamTransportModel), + + alphaNut_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphaNut", + coeffDict_, + 1.5 + ) + ), + + Cb1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Cb1", + coeffDict_, + 0.1355 + ) + ), + Cb2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Cb2", + coeffDict_, + 0.622 + ) + ), + Cw1_(Cb1_/sqr(kappa_) + alphaNut_*(1.0 + Cb2_)), + Cw2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Cw2", + coeffDict_, + 0.3 + ) + ), + Cw3_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Cw3", + coeffDict_, + 2.0 + ) + ), + Cv1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Cv1", + coeffDict_, + 7.1 + ) + ), + Cv2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Cv2", + coeffDict_, + 5.0 + ) + ), + + nuTilda_ + ( + IOobject + ( + "nuTilda", + runTime_.timeName(), + mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh_ + ), + + nut_ + ( + IOobject + ( + "nut", + runTime_.timeName(), + mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh_ + ), + + d_(mesh_) +{ + printCoeffs(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +tmp<volScalarField> SpalartAllmaras::DnuTildaEff() const +{ + return tmp<volScalarField> + ( + new volScalarField("DnuTildaEff", alphaNut_*nuTilda_ + nu()) + ); +} + + +tmp<volScalarField> SpalartAllmaras::k() const +{ + return tmp<volScalarField> + ( + new volScalarField + ( + IOobject + ( + "k", + runTime_.timeName(), + mesh_ + ), + mesh_, + dimensionedScalar("0", dimensionSet(0, 2, -2, 0, 0), 0) + ) + ); +} + + +tmp<volScalarField> SpalartAllmaras::epsilon() const +{ + return tmp<volScalarField> + ( + new volScalarField + ( + IOobject + ( + "epslion", + runTime_.timeName(), + mesh_ + ), + mesh_, + dimensionedScalar("0", dimensionSet(0, 2, -3, 0, 0), 0) + ) + ); +} + + +tmp<volSymmTensorField> SpalartAllmaras::R() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + "R", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + ((2.0/3.0)*I)*k() - nut()*twoSymm(fvc::grad(U_)) + ) + ); +} + + +tmp<volSymmTensorField> SpalartAllmaras::devReff() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + "devRhoReff", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + -nuEff()*dev(twoSymm(fvc::grad(U_))) + ) + ); +} + + +tmp<fvVectorMatrix> SpalartAllmaras::divDevReff(volVectorField& U) const +{ + volScalarField nuEff_ = nuEff(); + + return + ( + - fvm::laplacian(nuEff_, U) + - fvc::div(nuEff_*dev(fvc::grad(U)().T())) + ); +} + + +bool SpalartAllmaras::read() +{ + if (RASModel::read()) + { + alphaNut_.readIfPresent(coeffDict_); + + Cb1_.readIfPresent(coeffDict_); + Cb2_.readIfPresent(coeffDict_); + Cw1_ = Cb1_/sqr(kappa_) + alphaNut_*(1.0 + Cb2_); + Cw2_.readIfPresent(coeffDict_); + Cw3_.readIfPresent(coeffDict_); + Cv1_.readIfPresent(coeffDict_); + Cv2_.readIfPresent(coeffDict_); + + return true; + } + else + { + return false; + } +} + + +void SpalartAllmaras::correct() +{ + RASModel::correct(); + + if (!turbulence_) + { + return; + } + + if (mesh_.changing()) + { + d_.correct(); + } + + volScalarField chi = this->chi(); + volScalarField fv1 = this->fv1(chi); + + volScalarField Stilda = + fv3(chi, fv1)*::sqrt(2.0)*mag(skew(fvc::grad(U_))) + + fv2(chi, fv1)*nuTilda_/sqr(kappa_*d_); + + tmp<fvScalarMatrix> nuTildaEqn + ( + fvm::ddt(nuTilda_) + + fvm::div(phi_, nuTilda_) + - fvm::Sp(fvc::div(phi_), nuTilda_) + - fvm::laplacian(DnuTildaEff(), nuTilda_) + - alphaNut_*Cb2_*magSqr(fvc::grad(nuTilda_)) + == + Cb1_*Stilda*nuTilda_ + - fvm::Sp(Cw1_*fw(Stilda)*nuTilda_/sqr(d_), nuTilda_) + ); + + nuTildaEqn().relax(); + solve(nuTildaEqn); + bound(nuTilda_, dimensionedScalar("0", nuTilda_.dimensions(), 0.0)); + nuTilda_.correctBoundaryConditions(); + + nut_.internalField() = fv1*nuTilda_.internalField(); + nut_.correctBoundaryConditions(); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/SpalartAllmaras/SpalartAllmaras.H b/src/turbulenceModels/incompressible/RAS/SpalartAllmaras/SpalartAllmaras.H new file mode 100644 index 00000000000..abc946efeca --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/SpalartAllmaras/SpalartAllmaras.H @@ -0,0 +1,191 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::incompressible::RASModels::SpalartAllmaras + +Description + Spalart-Allmaras 1-eqn mixing-length model for incompressible external + flows. + + References: + @verbatim + "A One-Equation Turbulence Model for Aerodynamic Flows" + P.R. Spalart, + S.R. Allmaras, + La Recherche A´rospatiale, No. 1, 1994, pp. 5–21. + + Extended according to: + + "An Unstructured Grid Generation and Adaptive Solution Technique + for High Reynolds Number Compressible Flows" + G.A. Ashford, + Ph.D. thesis, University of Michigan, 1996. + @endverbatim + + The default model coefficients correspond to the following: + @verbatim + SpalartAllmarasCoeffs + { + Cb1 0.1355; + Cb2 0.622; + Cw2 0.3; + Cw3 2.0; + Cv1 7.1; + Cv2 5.0; + alphaNut 1.5; + alphah 1.0; // only for compressible + } + @endverbatim + +SourceFiles + SpalartAllmaras.C + +\*---------------------------------------------------------------------------*/ + +#ifndef SpalartAllmaras_H +#define SpalartAllmaras_H + +#include "RASModel.H" +#include "wallDist.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class SpalartAllmaras Declaration +\*---------------------------------------------------------------------------*/ + +class SpalartAllmaras +: + public RASModel +{ + // Private data + + dimensionedScalar alphaNut_; + + dimensionedScalar Cb1_; + dimensionedScalar Cb2_; + dimensionedScalar Cw1_; + dimensionedScalar Cw2_; + dimensionedScalar Cw3_; + dimensionedScalar Cv1_; + dimensionedScalar Cv2_; + + volScalarField nuTilda_; + volScalarField nut_; + + wallDist d_; + + + // Private member functions + + tmp<volScalarField> chi() const; + tmp<volScalarField> fv1(const volScalarField& chi) const; + tmp<volScalarField> fv2 + ( + const volScalarField& chi, + const volScalarField& fv1 + ) const; + tmp<volScalarField> fv3 + ( + const volScalarField& chi, + const volScalarField& fv1 + ) const; + tmp<volScalarField> fw(const volScalarField& Stilda) const; + + +public: + + //- Runtime type information + TypeName("SpalartAllmaras"); + + + // Constructors + + //- from components + SpalartAllmaras + ( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport + ); + + + //- Destructor + virtual ~SpalartAllmaras() + {} + + + // Member Functions + + //- Return the turbulence viscosity + virtual tmp<volScalarField> nut() const + { + return nut_; + } + + //- Return the effective diffusivity for nuTilda + tmp<volScalarField> DnuTildaEff() const; + + //- Return the turbulence kinetic energy + virtual tmp<volScalarField> k() const; + + //- Return the turbulence kinetic energy dissipation rate + virtual tmp<volScalarField> epsilon() const; + + //- Return the Reynolds stress tensor + virtual tmp<volSymmTensorField> R() const; + + //- Return the effective stress tensor including the laminar stress + virtual tmp<volSymmTensorField> devReff() const; + + //- Return the source term for the momentum equation + virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const; + + //- Solve the turbulence equations and correct the turbulence viscosity + virtual void correct(); + + //- Read turbulenceProperties dictionary + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/backwardsCompatibilityWallFunctions/backwardsCompatibilityWallFunctions.C b/src/turbulenceModels/incompressible/RAS/backwardsCompatibilityWallFunctions/backwardsCompatibilityWallFunctions.C new file mode 100644 index 00000000000..4e8352414df --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/backwardsCompatibilityWallFunctions/backwardsCompatibilityWallFunctions.C @@ -0,0 +1,215 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "backwardsCompatibilityWallFunctions.H" + +#include "calculatedFvPatchField.H" +#include "nutWallFunctionFvPatchScalarField.H" +#include "epsilonWallFunctionFvPatchScalarField.H" +#include "kQRWallFunctionFvPatchField.H" +#include "omegaWallFunctionFvPatchScalarField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +tmp<volScalarField> autoCreateNut +( + const word& fieldName, + const fvMesh& mesh +) +{ + IOobject nutHeader + ( + fieldName, + mesh.time().timeName(), + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE, + false + ); + + if (nutHeader.headerOk()) + { + return tmp<volScalarField>(new volScalarField(nutHeader, mesh)); + } + else + { + Info<< "--> Upgrading " << fieldName << " to employ run-time " + << "selectable wall functions" << endl; + + const fvBoundaryMesh& bm = mesh.boundary(); + + wordList nutBoundaryTypes(bm.size()); + + forAll(bm, patchI) + { + if (isType<wallFvPatch>(bm[patchI])) + { + nutBoundaryTypes[patchI] = + RASModels::nutWallFunctionFvPatchScalarField::typeName; + } + else + { + nutBoundaryTypes[patchI] = + calculatedFvPatchField<scalar>::typeName; + } + } + + tmp<volScalarField> nut + ( + new volScalarField + ( + IOobject + ( + fieldName, + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE, + false + ), + mesh, + dimensionedScalar("zero", dimArea/dimTime, 0.0), + nutBoundaryTypes + ) + ); + + Info<< " Writing updated " << fieldName << endl; + nut().write(); + + return nut; + } +} + + +tmp<volScalarField> autoCreateEpsilon +( + const word& fieldName, + const fvMesh& mesh +) +{ + return + autoCreateWallFunctionField + < + scalar, + RASModels::epsilonWallFunctionFvPatchScalarField + > + ( + fieldName, + mesh + ); +} + + +tmp<volScalarField> autoCreateOmega +( + const word& fieldName, + const fvMesh& mesh +) +{ + return + autoCreateWallFunctionField + < + scalar, + RASModels::omegaWallFunctionFvPatchScalarField + > + ( + fieldName, + mesh + ); +} + + +tmp<volScalarField> autoCreateK +( + const word& fieldName, + const fvMesh& mesh +) +{ + return + autoCreateWallFunctionField + < + scalar, + RASModels::kQRWallFunctionFvPatchField<scalar> + > + ( + fieldName, + mesh + ); +} + + +tmp<volScalarField> autoCreateQ +( + const word& fieldName, + const fvMesh& mesh +) +{ + return + autoCreateWallFunctionField + < + scalar, + RASModels::kQRWallFunctionFvPatchField<scalar> + > + ( + fieldName, + mesh + ); +} + + +tmp<volSymmTensorField> autoCreateR +( + const word& fieldName, + const fvMesh& mesh +) +{ + return + autoCreateWallFunctionField + < + symmTensor, + RASModels::kQRWallFunctionFvPatchField<symmTensor> + > + ( + fieldName, + mesh + ); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // + diff --git a/src/turbulenceModels/incompressible/RAS/backwardsCompatibilityWallFunctions/backwardsCompatibilityWallFunctions.H b/src/turbulenceModels/incompressible/RAS/backwardsCompatibilityWallFunctions/backwardsCompatibilityWallFunctions.H new file mode 100644 index 00000000000..28ba0652143 --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/backwardsCompatibilityWallFunctions/backwardsCompatibilityWallFunctions.H @@ -0,0 +1,116 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::incompressible + +Description + Auto creation of fields to provide backwards compatibility with + runtime selectable wall functions + +SourceFiles + backwardsCompatibilityWallFunctions.C + backwardsCompatibilityWallFunctionsTemplates.C + +\*---------------------------------------------------------------------------*/ + +#ifndef backwardsCompatibilityWallFunctions_H +#define backwardsCompatibilityWallFunctions_H + +#include "fvMesh.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ + //- nut + tmp<volScalarField> autoCreateNut + ( + const word& fieldName, + const fvMesh& mesh + ); + + //- epsilon + tmp<volScalarField> autoCreateEpsilon + ( + const word& fieldName, + const fvMesh& mesh + ); + + //- omega + tmp<volScalarField> autoCreateOmega + ( + const word& fieldName, + const fvMesh& mesh + ); + + //- k + tmp<volScalarField> autoCreateK + ( + const word& fieldName, + const fvMesh& mesh + ); + + //- Q + tmp<volScalarField> autoCreateQ + ( + const word& fieldName, + const fvMesh& mesh + ); + + //- R + tmp<volSymmTensorField> autoCreateR + ( + const word& fieldName, + const fvMesh& mesh + ); + + //- Helper function to create the new field + template<class Type, class PatchType> + tmp<GeometricField<Type, fvPatchField, volMesh> > + autoCreateWallFunctionField + ( + const word& fieldName, + const fvMesh& mesh + ); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "backwardsCompatibilityWallFunctionsTemplates.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/turbulenceModels/incompressible/RAS/backwardsCompatibilityWallFunctions/backwardsCompatibilityWallFunctionsTemplates.C b/src/turbulenceModels/incompressible/RAS/backwardsCompatibilityWallFunctions/backwardsCompatibilityWallFunctionsTemplates.C new file mode 100644 index 00000000000..9b6850bc946 --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/backwardsCompatibilityWallFunctions/backwardsCompatibilityWallFunctionsTemplates.C @@ -0,0 +1,166 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "backwardsCompatibilityWallFunctions.H" +#include "Time.H" + +#include "wallPolyPatch.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template<class Type, class PatchType> +tmp<GeometricField<Type, fvPatchField, volMesh> > +autoCreateWallFunctionField +( + const word& fieldName, + const fvMesh& mesh +) +{ + IOobject nutHeader + ( + "nut", + mesh.time().timeName(), + mesh, + IOobject::MUST_READ + ); + + typedef GeometricField<Type, fvPatchField, volMesh> fieldType; + + if (nutHeader.headerOk()) + { + return tmp<fieldType> + ( + new fieldType + ( + IOobject + ( + fieldName, + mesh.time().timeName(), + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE, + false + ), + mesh + ) + ); + } + else + { + Info<< "--> Upgrading " << fieldName << " to employ run-time " + << "selectable wall functions" << endl; + + // Read existing epsilon field + tmp<fieldType> fieldOrig + ( + new fieldType + ( + IOobject + ( + fieldName, + mesh.time().timeName(), + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE, + false + ), + mesh + ) + ); + + PtrList<fvPatchField<Type> > newPatchFields(mesh.boundary().size()); + + forAll(newPatchFields, patchI) + { + if (isType<wallPolyPatch>(mesh.boundaryMesh()[patchI])) + { + newPatchFields.set + ( + patchI, + new PatchType + ( + mesh.boundary()[patchI], + fieldOrig().dimensionedInternalField() + ) + ); + newPatchFields[patchI] == fieldOrig().boundaryField()[patchI]; + } + else + { + newPatchFields.set + ( + patchI, + fieldOrig().boundaryField()[patchI].clone() + ); + } + } + + tmp<fieldType> fieldNew + ( + new fieldType + ( + IOobject + ( + fieldName, + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE, + false + ), + mesh, + fieldOrig().dimensions(), + fieldOrig().internalField(), + newPatchFields + ) + ); + + Info<< " Writing backup of original " << fieldName << " to " + << fieldName << ".old" << endl; + fieldOrig().rename(fieldName + ".old"); + fieldOrig().write(); + + Info<< " Writing updated " << fieldName << endl; + fieldNew().write(); + + return fieldNew; + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C new file mode 100644 index 00000000000..f51ccb7251d --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C @@ -0,0 +1,191 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "turbulentHeatFluxTemperatureFvPatchScalarField.H" +#include "addToRunTimeSelectionTable.H" +#include "fvPatchFieldMapper.H" +#include "volFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +turbulentHeatFluxTemperatureFvPatchScalarField:: +turbulentHeatFluxTemperatureFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedGradientFvPatchScalarField(p, iF), + q_(p.size(), 0.0), + alphaEffName_("undefinedAlphaEff"), + CpName_("undefinedCp") +{} + + +turbulentHeatFluxTemperatureFvPatchScalarField:: +turbulentHeatFluxTemperatureFvPatchScalarField +( + const turbulentHeatFluxTemperatureFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + fixedGradientFvPatchScalarField(ptf, p, iF, mapper), + q_(ptf.q_, mapper), + alphaEffName_(ptf.alphaEffName_), + CpName_(ptf.CpName_) +{} + + +turbulentHeatFluxTemperatureFvPatchScalarField:: +turbulentHeatFluxTemperatureFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + fixedGradientFvPatchScalarField(p, iF), + q_("q", dict, p.size()), + alphaEffName_(dict.lookup("alphaEff")), + CpName_(dict.lookup("Cp")) +{ + fvPatchField<scalar>::operator=(patchInternalField()); + gradient() = 0.0; +} + + +turbulentHeatFluxTemperatureFvPatchScalarField:: +turbulentHeatFluxTemperatureFvPatchScalarField +( + const turbulentHeatFluxTemperatureFvPatchScalarField& thftpsf +) +: + fixedGradientFvPatchScalarField(thftpsf), + q_(thftpsf.q_), + alphaEffName_(thftpsf.alphaEffName_), + CpName_(thftpsf.CpName_) +{} + + +turbulentHeatFluxTemperatureFvPatchScalarField:: +turbulentHeatFluxTemperatureFvPatchScalarField +( + const turbulentHeatFluxTemperatureFvPatchScalarField& thftpsf, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedGradientFvPatchScalarField(thftpsf, iF), + q_(thftpsf.q_), + alphaEffName_(thftpsf.alphaEffName_), + CpName_(thftpsf.CpName_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void turbulentHeatFluxTemperatureFvPatchScalarField::autoMap +( + const fvPatchFieldMapper& m +) +{ + scalarField::autoMap(m); + q_.autoMap(m); +} + + +void turbulentHeatFluxTemperatureFvPatchScalarField::rmap +( + const fvPatchScalarField& ptf, + const labelList& addr +) +{ + fixedGradientFvPatchScalarField::rmap(ptf, addr); + + const turbulentHeatFluxTemperatureFvPatchScalarField& thftptf = + refCast<const turbulentHeatFluxTemperatureFvPatchScalarField> + ( + ptf + ); + + q_.rmap(thftptf.q_, addr); +} + + +void turbulentHeatFluxTemperatureFvPatchScalarField::updateCoeffs() +{ + if (updated()) + { + return; + } + + const scalarField& alphaEffp = + patch().lookupPatchField<volScalarField, scalar>(alphaEffName_); + + const scalarField& Cpp = + patch().lookupPatchField<volScalarField, scalar>(CpName_); + + gradient() = q_/(Cpp*alphaEffp); + + fixedGradientFvPatchScalarField::updateCoeffs(); +} + + +void turbulentHeatFluxTemperatureFvPatchScalarField::write(Ostream& os) const +{ + fixedGradientFvPatchScalarField::write(os); + q_.writeEntry("q", os); + os.writeKeyword("alphaEff") << alphaEffName_ << token::END_STATEMENT << nl; + os.writeKeyword("Cp") << CpName_ << token::END_STATEMENT << nl; + writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField +( + fvPatchScalarField, + turbulentHeatFluxTemperatureFvPatchScalarField +); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace incompressible +} // End namespace Foam + + +// ************************************************************************* // + diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.H new file mode 100644 index 00000000000..de677f0e91b --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.H @@ -0,0 +1,179 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::turbulentHeatFluxTemperatureFvPatchScalarField + +Description + Fixed heat flux boundary condition for temperature. + +SourceFiles + turbulentHeatFluxTemperatureFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef turbulentHeatFluxTemperatureFvPatchScalarFields_H +#define turbulentHeatFluxTemperatureFvPatchScalarFields_H + +#include "fvPatchFields.H" +#include "fixedGradientFvPatchFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ + +/*---------------------------------------------------------------------------*\ + Class turbulentHeatFluxTemperatureFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class turbulentHeatFluxTemperatureFvPatchScalarField +: + public fixedGradientFvPatchScalarField +{ +// Private data + + //- Heat flux [W/m2] + scalarField q_; + + //- Name of effective thermal diffusivity field + word alphaEffName_; + + //- Name of specific heat capacity field + word CpName_; + + +public: + + //- Runtime type information + TypeName("turbulentHeatFluxTemperature"); + + + // Constructors + + //- Construct from patch and internal field + turbulentHeatFluxTemperatureFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + turbulentHeatFluxTemperatureFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given + // turbulentHeatFluxTemperatureFvPatchScalarField onto + // a new patch + turbulentHeatFluxTemperatureFvPatchScalarField + ( + const turbulentHeatFluxTemperatureFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + turbulentHeatFluxTemperatureFvPatchScalarField + ( + const turbulentHeatFluxTemperatureFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchScalarField> clone() const + { + return tmp<fvPatchScalarField> + ( + new turbulentHeatFluxTemperatureFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + turbulentHeatFluxTemperatureFvPatchScalarField + ( + const turbulentHeatFluxTemperatureFvPatchScalarField&, + 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 turbulentHeatFluxTemperatureFvPatchScalarField + ( + *this, + iF + ) + ); + } + + + // Member functions + + // Mapping functions + + //- Map (and resize as needed) from self given a mapping object + virtual void autoMap(const fvPatchFieldMapper&); + + //- Reverse map the given fvPatchField onto this fvPatchField + virtual void rmap + ( + const fvPatchScalarField&, + const labelList& + ); + + + // Evaluation functions + + //- Update the coefficients associated with the patch field + virtual void updateCoeffs(); + + + // I-O + + //- Write + virtual void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C new file mode 100644 index 00000000000..699559c2cf6 --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C @@ -0,0 +1,152 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2006-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "turbulentMixingLengthDissipationRateInletFvPatchScalarField.H" +#include "addToRunTimeSelectionTable.H" +#include "fvPatchFieldMapper.H" +#include "surfaceFields.H" +#include "volFields.H" +#include "RASModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +turbulentMixingLengthDissipationRateInletFvPatchScalarField:: +turbulentMixingLengthDissipationRateInletFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchField<scalar>(p, iF), + mixingLength_(0.001) +{} + +turbulentMixingLengthDissipationRateInletFvPatchScalarField:: +turbulentMixingLengthDissipationRateInletFvPatchScalarField +( + const turbulentMixingLengthDissipationRateInletFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + fixedValueFvPatchField<scalar>(ptf, p, iF, mapper), + mixingLength_(ptf.mixingLength_) +{} + +turbulentMixingLengthDissipationRateInletFvPatchScalarField:: +turbulentMixingLengthDissipationRateInletFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + fixedValueFvPatchField<scalar>(p, iF, dict), + mixingLength_(readScalar(dict.lookup("mixingLength"))) +{} + +turbulentMixingLengthDissipationRateInletFvPatchScalarField:: +turbulentMixingLengthDissipationRateInletFvPatchScalarField +( + const turbulentMixingLengthDissipationRateInletFvPatchScalarField& ptf +) +: + fixedValueFvPatchField<scalar>(ptf), + mixingLength_(ptf.mixingLength_) +{} + +turbulentMixingLengthDissipationRateInletFvPatchScalarField:: +turbulentMixingLengthDissipationRateInletFvPatchScalarField +( + const turbulentMixingLengthDissipationRateInletFvPatchScalarField& ptf, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchField<scalar>(ptf, iF), + mixingLength_(ptf.mixingLength_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void turbulentMixingLengthDissipationRateInletFvPatchScalarField::updateCoeffs() +{ + if (updated()) + { + return; + } + + // Lookup Cmu corresponding to the turbulence model selected + const incompressible::RASModel& RAS = + db().lookupObject<incompressible::RASModel>("RASProperties"); + scalar Cmu = readScalar(RAS.coeffDict().lookup("Cmu")); + + scalar Cmu75 = pow(Cmu, 0.75); + + const fvPatchField<scalar>& k = + patch().lookupPatchField<volScalarField, scalar>("k"); + + operator==(Cmu75*k*sqrt(k)/mixingLength_); + + fixedValueFvPatchField<scalar>::updateCoeffs(); +} + + +void turbulentMixingLengthDissipationRateInletFvPatchScalarField::write +( + Ostream& os +) const +{ + fvPatchField<scalar>::write(os); + os.writeKeyword("mixingLength") + << mixingLength_ << token::END_STATEMENT << nl; + writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField +( + fvPatchScalarField, + turbulentMixingLengthDissipationRateInletFvPatchScalarField +); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.H new file mode 100644 index 00000000000..63a764f2250 --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.H @@ -0,0 +1,167 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2006-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::incompressible:: + turbulentMixingLengthDissipationRateInletFvPatchScalarField + +Description + Calculate epsilon via the mixing length [m] + + Example of the boundary condition specification: + @verbatim + inlet + { + type turbulentMixingLengthDissipationRateInlet; + mixingLength 0.005; // 5 mm + value uniform 200; // placeholder + } + @endverbatim + +SourceFiles + turbulentMixingLengthDissipationRateInletFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef incompressibleturbulentMixingLengthDissipationRateInlet_H +#define incompressibleturbulentMixingLengthDissipationRateInlet_H + +#include "fixedValueFvPatchFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ + +/*---------------------------------------------------------------------------*\ + Class turbulentMixingLengthDissipationRateInletFvPatch Declaration +\*---------------------------------------------------------------------------*/ + +class turbulentMixingLengthDissipationRateInletFvPatchScalarField +: + public fixedValueFvPatchScalarField +{ + // Private data + + //- turbulent length scale + scalar mixingLength_; + +public: + + //- Runtime type information + TypeName("turbulentMixingLengthDissipationRateInlet"); + + + // Constructors + + //- Construct from patch and internal field + turbulentMixingLengthDissipationRateInletFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + turbulentMixingLengthDissipationRateInletFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given + // turbulentMixingLengthDissipationRateInletFvPatchScalarField + // onto a new patch + turbulentMixingLengthDissipationRateInletFvPatchScalarField + ( + const turbulentMixingLengthDissipationRateInletFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + turbulentMixingLengthDissipationRateInletFvPatchScalarField + ( + const turbulentMixingLengthDissipationRateInletFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchScalarField> clone() const + { + return tmp<fvPatchScalarField> + ( + new turbulentMixingLengthDissipationRateInletFvPatchScalarField + ( + *this + ) + ); + } + + //- Construct as copy setting internal field reference + turbulentMixingLengthDissipationRateInletFvPatchScalarField + ( + const turbulentMixingLengthDissipationRateInletFvPatchScalarField&, + 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 turbulentMixingLengthDissipationRateInletFvPatchScalarField + ( + *this, + iF + ) + ); + } + + + // Member functions + + //- Update the coefficients associated with the patch field + virtual void updateCoeffs(); + + //- Write + virtual void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C new file mode 100644 index 00000000000..465118cdbfc --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C @@ -0,0 +1,158 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2006-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "turbulentMixingLengthFrequencyInletFvPatchScalarField.H" +#include "addToRunTimeSelectionTable.H" +#include "fvPatchFieldMapper.H" +#include "surfaceFields.H" +#include "volFields.H" +#include "RASModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +turbulentMixingLengthFrequencyInletFvPatchScalarField:: +turbulentMixingLengthFrequencyInletFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchField<scalar>(p, iF), + mixingLength_(0.0), + kName_("undefined-k") +{} + +turbulentMixingLengthFrequencyInletFvPatchScalarField:: +turbulentMixingLengthFrequencyInletFvPatchScalarField +( + const turbulentMixingLengthFrequencyInletFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + fixedValueFvPatchField<scalar>(ptf, p, iF, mapper), + mixingLength_(ptf.mixingLength_), + kName_(ptf.kName_) +{} + +turbulentMixingLengthFrequencyInletFvPatchScalarField:: +turbulentMixingLengthFrequencyInletFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + fixedValueFvPatchField<scalar>(p, iF, dict), + mixingLength_(readScalar(dict.lookup("mixingLength"))), + kName_(dict.lookup("k")) +{} + +turbulentMixingLengthFrequencyInletFvPatchScalarField:: +turbulentMixingLengthFrequencyInletFvPatchScalarField +( + const turbulentMixingLengthFrequencyInletFvPatchScalarField& ptf +) +: + fixedValueFvPatchField<scalar>(ptf), + mixingLength_(ptf.mixingLength_), + kName_(ptf.kName_) +{} + +turbulentMixingLengthFrequencyInletFvPatchScalarField:: +turbulentMixingLengthFrequencyInletFvPatchScalarField +( + const turbulentMixingLengthFrequencyInletFvPatchScalarField& ptf, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchField<scalar>(ptf, iF), + mixingLength_(ptf.mixingLength_), + kName_(ptf.kName_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void turbulentMixingLengthFrequencyInletFvPatchScalarField::updateCoeffs() +{ + if (updated()) + { + return; + } + + // Lookup Cmu corresponding to the turbulence model selected + const incompressible::RASModel& RAS = + db().lookupObject<incompressible::RASModel>("RASProperties"); + scalar Cmu = readScalar(RAS.coeffDict().lookup("Cmu")); + + scalar Cmu25 = pow(Cmu, 0.25); + + const fvPatchField<scalar>& kp = + patch().lookupPatchField<volScalarField, scalar>(kName_); + + operator==(sqrt(kp)/(Cmu25*mixingLength_)); + + fixedValueFvPatchField<scalar>::updateCoeffs(); +} + + +void turbulentMixingLengthFrequencyInletFvPatchScalarField::write +( + Ostream& os +) const +{ + fvPatchField<scalar>::write(os); + os.writeKeyword("mixingLength") + << mixingLength_ << token::END_STATEMENT << nl; + os.writeKeyword("k") << kName_ << token::END_STATEMENT << nl; + writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField +( + fvPatchScalarField, + turbulentMixingLengthFrequencyInletFvPatchScalarField +); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H new file mode 100644 index 00000000000..bdfa5e845ac --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H @@ -0,0 +1,171 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2006-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::incompressible::turbulentMixingLengthFrequencyInletFvPatchScalarField + +Description + Calculate omega via the mixing length + + Example of the boundary condition specification: + @verbatim + inlet + { + type turbulentMixingLengthFrequencyInlet; + mixingLength 0.005; // 5 mm + k k; // turbulent k field + value uniform 5; // initial value + } + @endverbatim + +SourceFiles + turbulentMixingLengthFrequencyInletFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef incompressibleturbulentMixingLengthFrequencyInletFvPatchScalarField_H +#define incompressibleturbulentMixingLengthFrequencyInletFvPatchScalarField_H + +#include "fixedValueFvPatchFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ + +/*---------------------------------------------------------------------------*\ + Class turbulentMixingLengthFrequencyInletFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class turbulentMixingLengthFrequencyInletFvPatchScalarField +: + public fixedValueFvPatchScalarField +{ + // Private data + + //- Turbulent length scale + scalar mixingLength_; + + //- Name of the turbulent kinetic energy field + word kName_; + + +public: + + //- Runtime type information + TypeName("turbulentMixingLengthFrequencyInlet"); + + + // Constructors + + //- Construct from patch and internal field + turbulentMixingLengthFrequencyInletFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + turbulentMixingLengthFrequencyInletFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given + // turbulentMixingLengthFrequencyInletFvPatchScalarField + // onto a new patch + turbulentMixingLengthFrequencyInletFvPatchScalarField + ( + const turbulentMixingLengthFrequencyInletFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + turbulentMixingLengthFrequencyInletFvPatchScalarField + ( + const turbulentMixingLengthFrequencyInletFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchScalarField> clone() const + { + return tmp<fvPatchScalarField> + ( + new turbulentMixingLengthFrequencyInletFvPatchScalarField + ( + *this + ) + ); + } + + //- Construct as copy setting internal field reference + turbulentMixingLengthFrequencyInletFvPatchScalarField + ( + const turbulentMixingLengthFrequencyInletFvPatchScalarField&, + 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 turbulentMixingLengthFrequencyInletFvPatchScalarField + ( + *this, + iF + ) + ); + } + + + // Member functions + + //- Update the coefficients associated with the patch field + virtual void updateCoeffs(); + + //- Write + virtual void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C new file mode 100644 index 00000000000..a4f0bd13f75 --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C @@ -0,0 +1,213 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "epsilonWallFunctionFvPatchScalarField.H" +#include "RASModel.H" +#include "fvPatchFieldMapper.H" +#include "volFields.H" +#include "addToRunTimeSelectionTable.H" +#include "wallFvPatch.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +void epsilonWallFunctionFvPatchScalarField::checkType() +{ + if (!isA<wallFvPatch>(patch())) + { + FatalErrorIn("epsilonWallFunctionFvPatchScalarField::checkType()") + << "Invalid wall function specification" << nl + << " Patch type for patch " << patch().name() + << " must be wall" << nl + << " Current patch type is " << patch().type() << nl << endl + << abort(FatalError); + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedInternalValueFvPatchField<scalar>(p, iF) +{ + checkType(); +} + + +epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField +( + const epsilonWallFunctionFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + fixedInternalValueFvPatchField<scalar>(ptf, p, iF, mapper) +{ + checkType(); +} + + +epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + fixedInternalValueFvPatchField<scalar>(p, iF, dict) +{ + checkType(); +} + + +epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField +( + const epsilonWallFunctionFvPatchScalarField& ewfpsf +) +: + fixedInternalValueFvPatchField<scalar>(ewfpsf) +{ + checkType(); +} + + +epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField +( + const epsilonWallFunctionFvPatchScalarField& ewfpsf, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedInternalValueFvPatchField<scalar>(ewfpsf, iF) +{ + checkType(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void epsilonWallFunctionFvPatchScalarField::updateCoeffs() +{ + const RASModel& ras = db().lookupObject<RASModel>("RASProperties"); + + const scalar Cmu = ras.Cmu().value(); + const scalar Cmu25 = pow(Cmu, 0.25); + const scalar Cmu75 = pow(Cmu, 0.75); + const scalar kappa = ras.kappa().value(); + const scalar yPlusLam = ras.yPlusLam(); + + const scalarField& y = ras.y()[patch().index()]; + + volScalarField& G = const_cast<volScalarField&> + (db().lookupObject<volScalarField>("G")); + + volScalarField& epsilon = const_cast<volScalarField&> + (db().lookupObject<volScalarField>("epsilon")); + + const volScalarField& k = db().lookupObject<volScalarField>("k"); + + const scalarField& nuw = + patch().lookupPatchField<volScalarField, scalar>("nu"); + + const scalarField& nutw = + patch().lookupPatchField<volScalarField, scalar>("nut"); + + const fvPatchVectorField& Uw = + patch().lookupPatchField<volVectorField, vector>("U"); + + const scalarField magGradUw = mag(Uw.snGrad()); + + // Set epsilon and G + forAll(nutw, faceI) + { + label faceCellI = patch().faceCells()[faceI]; + + scalar yPlus = Cmu25*y[faceI]*sqrt(k[faceCellI])/nuw[faceI]; + + epsilon[faceCellI] = Cmu75*pow(k[faceCellI], 1.5)/(kappa*y[faceI]); + + if (yPlus > yPlusLam) + { + G[faceCellI] = + (nutw[faceI] + nuw[faceI]) + *magGradUw[faceI] + *Cmu25*sqrt(k[faceCellI]) + /(kappa*y[faceI]); + } + else + { + G[faceCellI] = 0.0; + } + } + + // TODO: perform averaging for cells sharing more than one boundary face +} + + +void epsilonWallFunctionFvPatchScalarField::evaluate +( + const Pstream::commsTypes commsType +) +{ + fixedInternalValueFvPatchField<scalar>::evaluate(commsType); +} + + +void epsilonWallFunctionFvPatchScalarField::write(Ostream& os) const +{ + fixedInternalValueFvPatchField<scalar>::write(os); + writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField +( + fvPatchScalarField, + epsilonWallFunctionFvPatchScalarField +); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.H new file mode 100644 index 00000000000..7e81a50a342 --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.H @@ -0,0 +1,164 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::incompressible::RASModels::epsilonWallFunctionFvPatchScalarField + +Description + Boundary condition for epsilon when using wall functions + - calculates epsilon and G + - epsilon values added directly into the matrix to act as a constraint + +SourceFiles + epsilonWallFunctionFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef epsilonWallFunctionFvPatchScalarField_H +#define epsilonWallFunctionFvPatchScalarField_H + +#include "fixedInternalValueFvPatchField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class epsilonWallFunctionFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class epsilonWallFunctionFvPatchScalarField +: + public fixedInternalValueFvPatchField<scalar> +{ + + // Private member functions + + //- Check the type of the patch + void checkType(); + + +public: + + //- Runtime type information + TypeName("epsilonWallFunction"); + + + // Constructors + + //- Construct from patch and internal field + epsilonWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + epsilonWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given + // epsilonWallFunctionFvPatchScalarField + // onto a new patch + epsilonWallFunctionFvPatchScalarField + ( + const epsilonWallFunctionFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + epsilonWallFunctionFvPatchScalarField + ( + const epsilonWallFunctionFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchScalarField> clone() const + { + return tmp<fvPatchScalarField> + ( + new epsilonWallFunctionFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + epsilonWallFunctionFvPatchScalarField + ( + const epsilonWallFunctionFvPatchScalarField&, + 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 epsilonWallFunctionFvPatchScalarField(*this, iF) + ); + } + + + // Member functions + + // Evaluation functions + + //- Update the coefficients associated with the patch field + virtual void updateCoeffs(); + + //- Evaluate the patchField + virtual void evaluate(const Pstream::commsTypes); + + + // I-O + + //- Write + void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kQRWallFunctions/kQRWallFunction/kQRWallFunctionFvPatchField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kQRWallFunctions/kQRWallFunction/kQRWallFunctionFvPatchField.C new file mode 100644 index 00000000000..afe0cd24c84 --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kQRWallFunctions/kQRWallFunction/kQRWallFunctionFvPatchField.C @@ -0,0 +1,155 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "kQRWallFunctionFvPatchField.H" +#include "RASModel.H" +#include "fvPatchFieldMapper.H" +#include "volFields.H" +#include "addToRunTimeSelectionTable.H" +#include "wallFvPatch.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +template<class Type> +void kQRWallFunctionFvPatchField<Type>::checkType() +{ + if (!isA<wallFvPatch>(this->patch())) + { + FatalErrorIn("kQRWallFunctionFvPatchField::checkType()") + << "Invalid wall function specification" << nl + << " Patch type for patch " << this->patch().name() + << " must be wall" << nl + << " Current patch type is " << this->patch().type() << nl << endl + << abort(FatalError); + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class Type> +kQRWallFunctionFvPatchField<Type>::kQRWallFunctionFvPatchField +( + const fvPatch& p, + const DimensionedField<Type, volMesh>& iF +) +: + zeroGradientFvPatchField<Type>(p, iF) +{ + checkType(); +} + + +template<class Type> +kQRWallFunctionFvPatchField<Type>::kQRWallFunctionFvPatchField +( + const kQRWallFunctionFvPatchField& ptf, + const fvPatch& p, + const DimensionedField<Type, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + zeroGradientFvPatchField<Type>(ptf, p, iF, mapper) +{ + checkType(); +} + + +template<class Type> +kQRWallFunctionFvPatchField<Type>::kQRWallFunctionFvPatchField +( + const fvPatch& p, + const DimensionedField<Type, volMesh>& iF, + const dictionary& dict +) +: + zeroGradientFvPatchField<Type>(p, iF, dict) +{ + checkType(); +} + + +template<class Type> +kQRWallFunctionFvPatchField<Type>::kQRWallFunctionFvPatchField +( + const kQRWallFunctionFvPatchField& tkqrwfpf +) +: + zeroGradientFvPatchField<Type>(tkqrwfpf) +{ + checkType(); +} + + +template<class Type> +kQRWallFunctionFvPatchField<Type>::kQRWallFunctionFvPatchField +( + const kQRWallFunctionFvPatchField& tkqrwfpf, + const DimensionedField<Type, volMesh>& iF +) +: + zeroGradientFvPatchField<Type>(tkqrwfpf, iF) +{ + checkType(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class Type> +void kQRWallFunctionFvPatchField<Type>::evaluate +( + const Pstream::commsTypes commsType +) +{ + zeroGradientFvPatchField<Type>::evaluate(commsType); +} + + +template<class Type> +void kQRWallFunctionFvPatchField<Type>::write(Ostream& os) const +{ + zeroGradientFvPatchField<Type>::write(os); + this->writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kQRWallFunctions/kQRWallFunction/kQRWallFunctionFvPatchField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kQRWallFunctions/kQRWallFunction/kQRWallFunctionFvPatchField.H new file mode 100644 index 00000000000..719836cf8ff --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kQRWallFunctions/kQRWallFunction/kQRWallFunctionFvPatchField.H @@ -0,0 +1,170 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::incompressible::RASModels::kQRWallFunctionFvPatchField + +Description + Boundary condition for turbulence k, Q, and R when using wall functions. + Simply acts as a zero gradient condition. + +SourceFiles + kQRWallFunctionFvPatchField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef kQRWallFunctionFvPatchField_H +#define kQRWallFunctionFvPatchField_H + +#include "zeroGradientFvPatchField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class kQRWallFunctionFvPatchField Declaration +\*---------------------------------------------------------------------------*/ + +template<class Type> +class kQRWallFunctionFvPatchField +: + public zeroGradientFvPatchField<Type> +{ + + // Private member functions + + //- Check the type of the patch + void checkType(); + + +public: + + //- Runtime type information + TypeName("kQRWallFunction"); + + + // Constructors + + //- Construct from patch and internal field + kQRWallFunctionFvPatchField + ( + const fvPatch&, + const DimensionedField<Type, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + kQRWallFunctionFvPatchField + ( + const fvPatch&, + const DimensionedField<Type, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given + // kQRWallFunctionFvPatchField + // onto a new patch + kQRWallFunctionFvPatchField + ( + const kQRWallFunctionFvPatchField&, + const fvPatch&, + const DimensionedField<Type, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + kQRWallFunctionFvPatchField + ( + const kQRWallFunctionFvPatchField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchField<Type> > clone() const + { + return tmp<fvPatchField<Type> > + ( + new kQRWallFunctionFvPatchField(*this) + ); + } + + //- Construct as copy setting internal field reference + kQRWallFunctionFvPatchField + ( + const kQRWallFunctionFvPatchField&, + 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 kQRWallFunctionFvPatchField(*this, iF) + ); + } + + + // Member functions + + // Evaluation functions + + //- Evaluate the patchField + virtual void evaluate + ( + const Pstream::commsTypes commsType=Pstream::Pstream::blocking + ); + + + // I-O + + //- Write + void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "kQRWallFunctionFvPatchField.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kQRWallFunctions/kQRWallFunction/kQRWallFunctionFvPatchFields.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kQRWallFunctions/kQRWallFunction/kQRWallFunctionFvPatchFields.C new file mode 100644 index 00000000000..4378e877235 --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kQRWallFunctions/kQRWallFunction/kQRWallFunctionFvPatchFields.C @@ -0,0 +1,51 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "kQRWallFunctionFvPatchFields.H" +#include "fvPatchFields.H" +#include "addToRunTimeSelectionTable.H" +#include "volFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +makePatchFields(kQRWallFunction); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kQRWallFunctions/kQRWallFunction/kQRWallFunctionFvPatchFields.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kQRWallFunctions/kQRWallFunction/kQRWallFunctionFvPatchFields.H new file mode 100644 index 00000000000..f7a312a7805 --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kQRWallFunctions/kQRWallFunction/kQRWallFunctionFvPatchFields.H @@ -0,0 +1,56 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#ifndef kQRWallFunctionFvPatchFields_H +#define kQRWallFunctionFvPatchFields_H + +#include "kQRWallFunctionFvPatchField.H" +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeFieldTypedefs(kQRWallFunction) + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutRoughWallFunction/nutRoughWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutRoughWallFunction/nutRoughWallFunctionFvPatchScalarField.C new file mode 100644 index 00000000000..b4fd633432b --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutRoughWallFunction/nutRoughWallFunctionFvPatchScalarField.C @@ -0,0 +1,245 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "nutRoughWallFunctionFvPatchScalarField.H" +#include "RASModel.H" +#include "fvPatchFieldMapper.H" +#include "volFields.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +scalar nutRoughWallFunctionFvPatchScalarField::fnRough +( + const scalar KsPlus, + const scalar Cs, + const scalar kappa +) const +{ + // Set deltaB based on non-dimensional roughness height + scalar deltaB = 0.0; + if (KsPlus < 90.0) + { + deltaB = + 1.0/kappa + *log((KsPlus - 2.25)/87.75 + Cs*KsPlus) + *sin(0.4258*(log(KsPlus) - 0.811)); + } + else + { + deltaB = 1.0/kappa*log(1.0 + Cs*KsPlus); + } + + return exp(min(deltaB*kappa, 50.0)); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +nutRoughWallFunctionFvPatchScalarField:: +nutRoughWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchScalarField(p, iF), + Ks_(p.size(), 0.0), + Cs_(p.size(), 0.0) +{} + + +nutRoughWallFunctionFvPatchScalarField:: +nutRoughWallFunctionFvPatchScalarField +( + const nutRoughWallFunctionFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + fixedValueFvPatchScalarField(ptf, p, iF, mapper), + Ks_(ptf.Ks_, mapper), + Cs_(ptf.Cs_, mapper) +{} + + +nutRoughWallFunctionFvPatchScalarField:: +nutRoughWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + fixedValueFvPatchScalarField(p, iF, dict), + Ks_("Ks", dict, p.size()), + Cs_("Cs", dict, p.size()) +{} + + +nutRoughWallFunctionFvPatchScalarField:: +nutRoughWallFunctionFvPatchScalarField +( + const nutRoughWallFunctionFvPatchScalarField& nrwfpsf +) +: + fixedValueFvPatchScalarField(nrwfpsf), + Ks_(nrwfpsf.Ks_), + Cs_(nrwfpsf.Cs_) +{} + + +nutRoughWallFunctionFvPatchScalarField:: +nutRoughWallFunctionFvPatchScalarField +( + const nutRoughWallFunctionFvPatchScalarField& nrwfpsf, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchScalarField(nrwfpsf, iF), + Ks_(nrwfpsf.Ks_), + Cs_(nrwfpsf.Cs_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void nutRoughWallFunctionFvPatchScalarField::autoMap +( + const fvPatchFieldMapper& m +) +{ + fixedValueFvPatchScalarField::autoMap(m); + Ks_.autoMap(m); + Cs_.autoMap(m); +} + + +void nutRoughWallFunctionFvPatchScalarField::rmap +( + const fvPatchScalarField& ptf, + const labelList& addr +) +{ + fixedValueFvPatchScalarField::rmap(ptf, addr); + + const nutRoughWallFunctionFvPatchScalarField& nrwfpsf = + refCast<const nutRoughWallFunctionFvPatchScalarField>(ptf); + + Cs_.rmap(nrwfpsf.Cs_, addr); + Ks_.rmap(nrwfpsf.Ks_, addr); +} + + +void nutRoughWallFunctionFvPatchScalarField::updateCoeffs() +{ + const RASModel& ras = db().lookupObject<RASModel>("RASProperties"); + + const scalar Cmu = ras.Cmu().value(); + const scalar Cmu25 = pow(Cmu, 0.25); + const scalar kappa = ras.kappa().value(); + const scalar E = ras.E().value(); + scalar yPlusLam = ras.yPlusLam(); + + const scalarField& y = ras.y()[patch().index()]; + + const scalarField& k = db().lookupObject<volScalarField>("k"); + + const scalarField& nuw = + patch().lookupPatchField<volScalarField, scalar>("nu"); + + scalarField& nutw = *this; + + forAll(nutw, faceI) + { + label faceCellI = patch().faceCells()[faceI]; + + scalar uStar = Cmu25*sqrt(k[faceCellI]); + + scalar yPlus = uStar*y[faceI]/nuw[faceI]; + + scalar KsPlus = uStar*Ks_[faceI]/nuw[faceI]; + + scalar Edash = E; + scalar yPlusLamNew = yPlusLam; + if (KsPlus > 2.25) + { + Edash = E/fnRough(KsPlus, Cs_[faceI], kappa); + yPlusLam = ras.yPlusLam(kappa, Edash); + } + + if (debug) + { + Info<< "yPlus = " << yPlus + << ", KsPlus = " << KsPlus + << ", Edash = " << Edash + << ", yPlusLam = " << yPlusLam + << endl; + } + + if (yPlus > yPlusLamNew) + { + nutw[faceI] = nuw[faceI]*(yPlus*kappa/log(Edash*yPlus) - 1); + } + else + { + nutw[faceI] = 0.0; + } + } +} + + +void nutRoughWallFunctionFvPatchScalarField::write(Ostream& os) const +{ + fvPatchField<scalar>::write(os); + Cs_.writeEntry("Cs", os); + Ks_.writeEntry("Ks", os); + writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField(fvPatchScalarField, nutRoughWallFunctionFvPatchScalarField); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutRoughWallFunction/nutRoughWallFunctionFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutRoughWallFunction/nutRoughWallFunctionFvPatchScalarField.H new file mode 100644 index 00000000000..299e55cc03c --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutRoughWallFunction/nutRoughWallFunctionFvPatchScalarField.H @@ -0,0 +1,194 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::incompressible::RASModels::nutRoughWallFunctionFvPatchScalarField + +Description + Boundary condition for turbulent (kinematic) viscosity when using wall + functions for rough walls. + + Manipulates the E parameter to account for roughness effects, based on + KsPlus. + + - roughness height = sand-grain roughness (0 for smooth walls) + - roughness constant = 0.5-1.0 (0.5 default) + +SourceFiles + nutRoughWallFunctionFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef nutRoughWallFunctionFvPatchScalarField_H +#define nutRoughWallFunctionFvPatchScalarField_H + +#include "fixedValueFvPatchFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class nutRoughWallFunctionFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class nutRoughWallFunctionFvPatchScalarField +: + public fixedValueFvPatchScalarField +{ + // Private data + + //- Roughness height + scalarField Ks_; + + //- Roughness constant + scalarField Cs_; + + + // Private member functions + + //- Compute the roughness function + scalar fnRough + ( + const scalar KsPlus, + const scalar Cs, + const scalar kappa + ) const; + + +public: + + //- Runtime type information + TypeName("nutRoughWallFunction"); + + + // Constructors + + //- Construct from patch and internal field + nutRoughWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + nutRoughWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given + // nutRoughWallFunctionFvPatchScalarField + // onto a new patch + nutRoughWallFunctionFvPatchScalarField + ( + const nutRoughWallFunctionFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + nutRoughWallFunctionFvPatchScalarField + ( + const nutRoughWallFunctionFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchScalarField> clone() const + { + return tmp<fvPatchScalarField> + ( + new nutRoughWallFunctionFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + nutRoughWallFunctionFvPatchScalarField + ( + const nutRoughWallFunctionFvPatchScalarField&, + 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 nutRoughWallFunctionFvPatchScalarField(*this, iF) + ); + } + + + // Member functions + + // Mapping functions + + //- Map (and resize as needed) from self given a mapping object + virtual void autoMap + ( + const fvPatchFieldMapper& + ); + + //- Reverse map the given fvPatchField onto this fvPatchField + virtual void rmap + ( + const fvPatchScalarField&, + const labelList& + ); + + // Evaluation functions + + //- Update the coefficients associated with the patch field + virtual void updateCoeffs(); + + + // I-O + + //- Write + void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasStandardRoughWallFunction/nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasStandardRoughWallFunction/nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.C new file mode 100644 index 00000000000..0455576df4d --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasStandardRoughWallFunction/nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.C @@ -0,0 +1,302 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.H" +#include "RASModel.H" +#include "fvPatchFieldMapper.H" +#include "volFields.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField:: +nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchScalarField(p, iF), + roughnessHeight_(pTraits<scalar>::zero), + roughnessConstant_(pTraits<scalar>::zero), + roughnessFudgeFactor_(pTraits<scalar>::zero) +{} + + +nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField:: +nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField +( + const nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + fixedValueFvPatchScalarField(ptf, p, iF, mapper), + roughnessHeight_(ptf.roughnessHeight_), + roughnessConstant_(ptf.roughnessConstant_), + roughnessFudgeFactor_(ptf.roughnessFudgeFactor_) +{} + + +nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField:: +nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + fixedValueFvPatchScalarField(p, iF, dict), + roughnessHeight_(readScalar(dict.lookup("roughnessHeight"))), + roughnessConstant_(readScalar(dict.lookup("roughnessConstant"))), + roughnessFudgeFactor_(readScalar(dict.lookup("roughnessFudgeFactor"))) +{} + + +nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField:: +nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField +( + const nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField& tppsf +) +: + fixedValueFvPatchScalarField(tppsf), + roughnessHeight_(tppsf.roughnessHeight_), + roughnessConstant_(tppsf.roughnessConstant_), + roughnessFudgeFactor_(tppsf.roughnessFudgeFactor_) +{} + + +nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField:: +nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField +( + const nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField& tppsf, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchScalarField(tppsf, iF), + roughnessHeight_(tppsf.roughnessHeight_), + roughnessConstant_(tppsf.roughnessConstant_), + roughnessFudgeFactor_(tppsf.roughnessFudgeFactor_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::evaluate +( + const Pstream::commsTypes +) +{ + const RASModel& ras = db().lookupObject<RASModel>("RASProperties"); + + const scalar kappa = ras.kappa().value(); + const scalar E = ras.E().value(); + const scalar yPlusLam = 11.225; + + // The reciprical of the distance to the adjacent cell centre. + const scalarField& ry = patch().deltaCoeffs(); + + const fvPatchVectorField& U = + patch().lookupPatchField<volVectorField, vector>("U"); + + // The flow velocity at the adjacent cell centre. + scalarField magUp = mag(U.patchInternalField() - U); + + const scalarField& nuw = + patch().lookupPatchField<volScalarField, scalar>("nu"); + scalarField& nutw = *this; + + scalarField magFaceGradU = mag(U.snGrad()); + + if (roughnessHeight_ > 0.0) + { + // Rough Walls. + const scalar c_1 = 1/(90 - 2.25) + roughnessConstant_; + static const scalar c_2 = 2.25/(90 - 2.25); + static const scalar c_3 = 2.0*atan(1.0)/log(90/2.25); + static const scalar c_4 = c_3*log(2.25); + + //if (KsPlusBasedOnYPlus_) + { + // If KsPlus is based on YPlus the extra term added to the law + // of the wall will depend on yPlus. + forAll(nutw, facei) + { + const scalar magUpara = magUp[facei]; + const scalar Re = magUpara/(nuw[facei]*ry[facei]); + const scalar kappaRe = kappa*Re; + + scalar yPlus = yPlusLam; + const scalar ryPlusLam = 1.0/yPlus; + + int iter = 0; + scalar yPlusLast = 0.0; + scalar dKsPlusdYPlus = roughnessHeight_*ry[facei]; + + // Enforce the roughnessHeight to be less than the distance to + // the first cell centre. + if(dKsPlusdYPlus > 1) + { + dKsPlusdYPlus = 1; + } + + // Fudge factor to get results to be similar to fluent + // (at least difference between rough and smooth). + dKsPlusdYPlus *= roughnessFudgeFactor_; + + do + { + yPlusLast = yPlus; + + // The non-dimensional roughness height. + scalar KsPlus = yPlus*dKsPlusdYPlus; + + // The extra term in the law-of-the-wall. + scalar G = 0.0; + + scalar yPlusGPrime = 0.0; + + if (KsPlus >= 90) + { + const scalar t_1 = 1 + roughnessConstant_*KsPlus; + G = log(t_1); + yPlusGPrime = roughnessConstant_*KsPlus/t_1; + } + else if (KsPlus > 2.25) + { + const scalar t_1 = c_1*KsPlus - c_2; + const scalar t_2 = c_3*log(KsPlus) - c_4; + const scalar sint_2 = sin(t_2); + const scalar logt_1 = log(t_1); + G = logt_1*sint_2; + yPlusGPrime = + (c_1*sint_2*KsPlus/t_1) + (c_3*logt_1*cos(t_2)); + } + + scalar denom = 1.0 + log(E* yPlus) - G - yPlusGPrime; + if (mag(denom) > VSMALL) + { + yPlus = (kappaRe + yPlus*(1 - yPlusGPrime))/denom; + } + else + { + // Ensure immediate end and nutw = 0. + yPlus = 0; + } + + } while + ( + mag(ryPlusLam*(yPlus - yPlusLast)) > 0.0001 + && ++iter < 10 + && yPlus > VSMALL + ); + + if (yPlus > yPlusLam) + { + nutw[facei] = nuw[facei]*(yPlus*yPlus/Re - 1); + } + else + { + nutw[facei] = 0.0; + } + } + } + } + else + { + // Smooth Walls. + forAll(nutw, facei) + { + const scalar magUpara = magUp[facei]; + const scalar Re = magUpara/(nuw[facei]*ry[facei]); + const scalar kappaRe = kappa*Re; + + scalar yPlus = yPlusLam; + const scalar ryPlusLam = 1.0/yPlus; + + int iter = 0; + scalar yPlusLast = 0.0; + + do + { + yPlusLast = yPlus; + yPlus = (kappaRe + yPlus)/(1.0 + log(E*yPlus)); + + } while(mag(ryPlusLam*(yPlus - yPlusLast)) > 0.0001 && ++iter < 10); + + if (yPlus > yPlusLam) + { + nutw[facei] = nuw[facei]*(yPlus*yPlus/Re - 1); + } + else + { + nutw[facei] = 0.0; + } + } + } +} + + +void nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::write +( + Ostream& os +) const +{ + fixedValueFvPatchScalarField::write(os); + os.writeKeyword("roughnessHeight") + << roughnessHeight_ << token::END_STATEMENT << nl; + os.writeKeyword("roughnessConstant") + << roughnessConstant_ << token::END_STATEMENT << nl; + os.writeKeyword("roughnessFudgeFactor") + << roughnessFudgeFactor_ << token::END_STATEMENT << nl; +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField +( + fvPatchScalarField, + nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField +); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasStandardRoughWallFunction/nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasStandardRoughWallFunction/nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.H new file mode 100644 index 00000000000..2806288b2a9 --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasStandardRoughWallFunction/nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.H @@ -0,0 +1,208 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::incompressible::RASModels:: + nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField + +Description + Wall function boundary condition for rough walls + +SourceFiles + nutSpalartAllmarasStandardWallFunctionFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField_H +#define nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField_H + +#include "fixedValueFvPatchFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ +Class nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField +: + public fixedValueFvPatchScalarField +{ + // Private data + + scalar roughnessHeight_; + scalar roughnessConstant_; + scalar roughnessFudgeFactor_; + + +public: + + //- Runtime type information + TypeName("nutSpalartAllmarasStandardRoughWallFunction"); + + + // Constructors + + //- Construct from patch and internal field + nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given + // nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField + // onto a new patch + nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField + ( + const nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField + ( + const nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchScalarField> clone() const + { + return tmp<fvPatchScalarField> + ( + new nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField + ( + *this + ) + ); + } + + //- Construct as copy setting internal field reference + nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField + ( + const nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField&, + 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 nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField + ( + *this, + iF + ) + ); + } + + + // Member functions + + // Access + + //- Return the fluctuation scale + const scalar& roughnessHeight() const + { + return roughnessHeight_; + } + + //- Return reference to the fluctuation scale to allow adjustment + scalar& roughnessHeight() + { + return roughnessHeight_; + } + + + //- Return the fluctuation scale + const scalar& roughnessConstant() const + { + return roughnessConstant_; + } + + //- Return reference to the fluctuation scale to allow adjustment + scalar& roughnessConstant() + { + return roughnessConstant_; + } + + //- Return the fluctuation scale + const scalar& roughnessFudgeFactor() const + { + return roughnessFudgeFactor_; + } + + //- Return reference to the fluctuation scale to allow adjustment + scalar& roughnessFudgeFactor() + { + return roughnessFudgeFactor_; + } + + + // Evaluation functions + + //- Evaluate the patchField + virtual void evaluate + ( + const Pstream::commsTypes commsType=Pstream::blocking + ); + + + //- Write + virtual void write(Ostream& os) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasStandardWallFunction/nutSpalartAllmarasStandardWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasStandardWallFunction/nutSpalartAllmarasStandardWallFunctionFvPatchScalarField.C new file mode 100644 index 00000000000..c60e065f052 --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasStandardWallFunction/nutSpalartAllmarasStandardWallFunctionFvPatchScalarField.C @@ -0,0 +1,172 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "nutSpalartAllmarasStandardWallFunctionFvPatchScalarField.H" +#include "RASModel.H" +#include "fvPatchFieldMapper.H" +#include "volFields.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +nutSpalartAllmarasStandardWallFunctionFvPatchScalarField:: +nutSpalartAllmarasStandardWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchScalarField(p, iF) +{} + + +nutSpalartAllmarasStandardWallFunctionFvPatchScalarField:: +nutSpalartAllmarasStandardWallFunctionFvPatchScalarField +( + const nutSpalartAllmarasStandardWallFunctionFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + fixedValueFvPatchScalarField(ptf, p, iF, mapper) +{} + + +nutSpalartAllmarasStandardWallFunctionFvPatchScalarField:: +nutSpalartAllmarasStandardWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + fixedValueFvPatchScalarField(p, iF, dict) +{} + + +nutSpalartAllmarasStandardWallFunctionFvPatchScalarField:: +nutSpalartAllmarasStandardWallFunctionFvPatchScalarField +( + const nutSpalartAllmarasStandardWallFunctionFvPatchScalarField& tppsf +) +: + fixedValueFvPatchScalarField(tppsf) +{} + + +nutSpalartAllmarasStandardWallFunctionFvPatchScalarField:: +nutSpalartAllmarasStandardWallFunctionFvPatchScalarField +( + const nutSpalartAllmarasStandardWallFunctionFvPatchScalarField& tppsf, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchScalarField(tppsf, iF) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void nutSpalartAllmarasStandardWallFunctionFvPatchScalarField::evaluate +( + const Pstream::commsTypes +) +{ + const RASModel& ras = db().lookupObject<RASModel>("RASProperties"); + + scalar kappa = ras.kappa().value(); + scalar E = ras.E().value(); + scalar yPlusLam = ras.yPlusLam(); + + const scalarField& ry = patch().deltaCoeffs(); + + const fvPatchVectorField& U = + patch().lookupPatchField<volVectorField, vector>("U"); + + scalarField magUp = mag(U.patchInternalField() - U); + + const scalarField& nuw = + patch().lookupPatchField<volScalarField, scalar>("nu"); + scalarField& nutw = *this; + + scalarField magFaceGradU = mag(U.snGrad()); + + forAll(nutw, facei) + { + scalar magUpara = magUp[facei]; + + scalar kappaRe = kappa*magUpara/(nuw[facei]*ry[facei]); + + scalar yPlus = yPlusLam; + scalar ryPlusLam = 1.0/yPlus; + + int iter = 0; + scalar yPlusLast = 0.0; + + do + { + yPlusLast = yPlus; + yPlus = (kappaRe + yPlus)/(1.0 + log(E*yPlus)); + + } while(mag(ryPlusLam*(yPlus - yPlusLast)) > 0.01 && ++iter < 10 ); + + if (yPlus > yPlusLam) + { + nutw[facei] = nuw[facei]*(yPlus*kappa/log(E*yPlus) - 1); + } + else + { + nutw[facei] = 0.0; + } + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField +( + fvPatchScalarField, + nutSpalartAllmarasStandardWallFunctionFvPatchScalarField +); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasStandardWallFunction/nutSpalartAllmarasStandardWallFunctionFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasStandardWallFunction/nutSpalartAllmarasStandardWallFunctionFvPatchScalarField.H new file mode 100644 index 00000000000..51ecc156f76 --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasStandardWallFunction/nutSpalartAllmarasStandardWallFunctionFvPatchScalarField.H @@ -0,0 +1,160 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::incompressible::RASModels:: + nutSpalartAllmarasStandardWallFunctionFvPatchScalarField + +Description + Wall function boundary condition for walls + +SourceFiles + nutSpalartAllmarasStandardWallFunctionFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef nutSpalartAllmarasStandardWallFunctionFvPatchScalarField_H +#define nutSpalartAllmarasStandardWallFunctionFvPatchScalarField_H + +#include "fixedValueFvPatchFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class nutSpalartAllmarasStandardWallFunctionFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class nutSpalartAllmarasStandardWallFunctionFvPatchScalarField +: + public fixedValueFvPatchScalarField +{ + // Private data + + +public: + + //- Runtime type information + TypeName("nutSpalartAllmarasStandardWallFunction"); + + + // Constructors + + //- Construct from patch and internal field + nutSpalartAllmarasStandardWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + nutSpalartAllmarasStandardWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given + // nutSpalartAllmarasStandardWallFunctionFvPatchScalarField + // onto a new patch + nutSpalartAllmarasStandardWallFunctionFvPatchScalarField + ( + const nutSpalartAllmarasStandardWallFunctionFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + nutSpalartAllmarasStandardWallFunctionFvPatchScalarField + ( + const nutSpalartAllmarasStandardWallFunctionFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchScalarField> clone() const + { + return tmp<fvPatchScalarField> + ( + new nutSpalartAllmarasStandardWallFunctionFvPatchScalarField + ( + *this + ) + ); + } + + //- Construct as copy setting internal field reference + nutSpalartAllmarasStandardWallFunctionFvPatchScalarField + ( + const nutSpalartAllmarasStandardWallFunctionFvPatchScalarField&, + 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 nutSpalartAllmarasStandardWallFunctionFvPatchScalarField + ( + *this, + iF + ) + ); + } + + + // Member functions + + // Evaluation functions + + //- Evaluate the patchField + virtual void evaluate + ( + const Pstream::commsTypes commsType=Pstream::blocking + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasWallFunction/nutSpalartAllmarasWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasWallFunction/nutSpalartAllmarasWallFunctionFvPatchScalarField.C new file mode 100644 index 00000000000..6e37a19949a --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasWallFunction/nutSpalartAllmarasWallFunctionFvPatchScalarField.C @@ -0,0 +1,180 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "nutSpalartAllmarasWallFunctionFvPatchScalarField.H" +#include "RASModel.H" +#include "fvPatchFieldMapper.H" +#include "volFields.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +nutSpalartAllmarasWallFunctionFvPatchScalarField:: +nutSpalartAllmarasWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchScalarField(p, iF) +{} + + +nutSpalartAllmarasWallFunctionFvPatchScalarField:: +nutSpalartAllmarasWallFunctionFvPatchScalarField +( + const nutSpalartAllmarasWallFunctionFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + fixedValueFvPatchScalarField(ptf, p, iF, mapper) +{} + + +nutSpalartAllmarasWallFunctionFvPatchScalarField:: +nutSpalartAllmarasWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + fixedValueFvPatchScalarField(p, iF, dict) +{} + + +nutSpalartAllmarasWallFunctionFvPatchScalarField:: +nutSpalartAllmarasWallFunctionFvPatchScalarField +( + const nutSpalartAllmarasWallFunctionFvPatchScalarField& tppsf +) +: + fixedValueFvPatchScalarField(tppsf) +{} + + +nutSpalartAllmarasWallFunctionFvPatchScalarField:: +nutSpalartAllmarasWallFunctionFvPatchScalarField +( + const nutSpalartAllmarasWallFunctionFvPatchScalarField& tppsf, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchScalarField(tppsf, iF) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void nutSpalartAllmarasWallFunctionFvPatchScalarField::evaluate +( + const Pstream::commsTypes +) +{ + const RASModel& ras = db().lookupObject<RASModel>("RASProperties"); + + scalar kappa = ras.kappa().value(); + scalar E = ras.E().value(); + + const scalarField& ry = patch().deltaCoeffs(); + + const fvPatchVectorField& U = + patch().lookupPatchField<volVectorField, vector>("U"); + + scalarField magUp = mag(U.patchInternalField() - U); + + const scalarField& nuw = + patch().lookupPatchField<volScalarField, scalar>("nu"); + + scalarField& nutw = *this; + + scalarField magFaceGradU = mag(U.snGrad()); + + forAll(nutw, facei) + { + scalar magUpara = magUp[facei]; + + scalar utau = sqrt((nutw[facei] + nuw[facei])*magFaceGradU[facei]); + + if (utau > VSMALL) + { + int iter = 0; + scalar err = GREAT; + + do + { + scalar kUu = min(kappa*magUpara/utau, 50); + scalar fkUu = exp(kUu) - 1 - kUu*(1 + 0.5*kUu); + + scalar f = + - utau/(ry[facei]*nuw[facei]) + + magUpara/utau + + 1/E*(fkUu - 1.0/6.0*kUu*sqr(kUu)); + + scalar df = + 1.0/(ry[facei]*nuw[facei]) + + magUpara/sqr(utau) + + 1/E*kUu*fkUu/utau; + + scalar utauNew = utau + f/df; + err = mag((utau - utauNew)/utau); + utau = utauNew; + + } while (utau > VSMALL && err > 0.01 && ++iter < 10); + + nutw[facei] = + max(sqr(max(utau, 0))/magFaceGradU[facei] - nuw[facei], 0.0); + } + else + { + nutw[facei] = 0; + } + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField(fvPatchScalarField, nutSpalartAllmarasWallFunctionFvPatchScalarField); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasWallFunction/nutSpalartAllmarasWallFunctionFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasWallFunction/nutSpalartAllmarasWallFunctionFvPatchScalarField.H new file mode 100644 index 00000000000..70f1107de3d --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasWallFunction/nutSpalartAllmarasWallFunctionFvPatchScalarField.H @@ -0,0 +1,153 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::incompressible::RASModels:: + nutSpalartAllmarasWallFunctionFvPatchScalarField + +Description + Wall function boundary condition for walls + +SourceFiles + nutSpalartAllmarasWallFunctionFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef nutSpalartAllmarasWallFunctionFvPatchScalarField_H +#define nutSpalartAllmarasWallFunctionFvPatchScalarField_H + +#include "fixedValueFvPatchFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class nutSpalartAllmarasWallFunctionFvPatch Declaration +\*---------------------------------------------------------------------------*/ + +class nutSpalartAllmarasWallFunctionFvPatchScalarField +: + public fixedValueFvPatchScalarField +{ + // Private data + + +public: + + //- Runtime type information + TypeName("nutSpalartAllmarasWallFunction"); + + + // Constructors + + //- Construct from patch and internal field + nutSpalartAllmarasWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + nutSpalartAllmarasWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given + // nutSpalartAllmarasWallFunctionFvPatchScalarField + // onto a new patch + nutSpalartAllmarasWallFunctionFvPatchScalarField + ( + const nutSpalartAllmarasWallFunctionFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + nutSpalartAllmarasWallFunctionFvPatchScalarField + ( + const nutSpalartAllmarasWallFunctionFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchScalarField> clone() const + { + return tmp<fvPatchScalarField> + ( + new nutSpalartAllmarasWallFunctionFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + nutSpalartAllmarasWallFunctionFvPatchScalarField + ( + const nutSpalartAllmarasWallFunctionFvPatchScalarField&, + 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 nutSpalartAllmarasWallFunctionFvPatchScalarField(*this, iF) + ); + } + + + // Member functions + + // Evaluation functions + + //- Evaluate the patchField + virtual void evaluate + ( + const Pstream::commsTypes commsType=Pstream::blocking + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.C new file mode 100644 index 00000000000..d86963a7921 --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.C @@ -0,0 +1,157 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "nutWallFunctionFvPatchScalarField.H" +#include "RASModel.H" +#include "fvPatchFieldMapper.H" +#include "volFields.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +nutWallFunctionFvPatchScalarField:: +nutWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchScalarField(p, iF) +{} + + +nutWallFunctionFvPatchScalarField:: +nutWallFunctionFvPatchScalarField +( + const nutWallFunctionFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + fixedValueFvPatchScalarField(ptf, p, iF, mapper) +{} + + +nutWallFunctionFvPatchScalarField:: +nutWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + fixedValueFvPatchScalarField(p, iF, dict) +{} + + +nutWallFunctionFvPatchScalarField:: +nutWallFunctionFvPatchScalarField +( + const nutWallFunctionFvPatchScalarField& tppsf +) +: + fixedValueFvPatchScalarField(tppsf) +{} + + +nutWallFunctionFvPatchScalarField:: +nutWallFunctionFvPatchScalarField +( + const nutWallFunctionFvPatchScalarField& tppsf, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchScalarField(tppsf, iF) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void nutWallFunctionFvPatchScalarField::updateCoeffs() +{ + const RASModel& ras = db().lookupObject<RASModel>("RASProperties"); + + const scalar Cmu = ras.Cmu().value(); + const scalar Cmu25 = pow(Cmu, 0.25); + const scalar kappa = ras.kappa().value(); + const scalar E = ras.E().value(); + const scalar yPlusLam = ras.yPlusLam(); + + const scalarField& y = ras.y()[patch().index()]; + + const volScalarField& k = db().lookupObject<volScalarField>("k"); + + const scalarField& nuw = + patch().lookupPatchField<volScalarField, scalar>("nu"); + + scalarField& nutw = *this; + + forAll(nutw, faceI) + { + label faceCellI = patch().faceCells()[faceI]; + + scalar yPlus = Cmu25*y[faceI]*sqrt(k[faceCellI])/nuw[faceI]; + + if (yPlus > yPlusLam) + { + nutw[faceI] = nuw[faceI]*(yPlus*kappa/log(E*yPlus) - 1); + } + else + { + nutw[faceI] = 0.0; + } + } +} + + +void nutWallFunctionFvPatchScalarField::write(Ostream& os) const +{ + fvPatchField<scalar>::write(os); + writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField(fvPatchScalarField, nutWallFunctionFvPatchScalarField); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.H new file mode 100644 index 00000000000..ffb370608ab --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.H @@ -0,0 +1,155 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::incompressible::RASModels::nutWallFunctionFvPatchScalarField + +Description + Boundary condition for turbulent (kinematic) viscosity when using wall + functions + - replicates OpenFOAM v1.5 (and earlier) behaviour + +SourceFiles + nutWallFunctionFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef nutWallFunctionFvPatchScalarField_H +#define nutWallFunctionFvPatchScalarField_H + +#include "fixedValueFvPatchFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class nutWallFunctionFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class nutWallFunctionFvPatchScalarField +: + public fixedValueFvPatchScalarField +{ + +public: + + //- Runtime type information + TypeName("nutWallFunction"); + + + // Constructors + + //- Construct from patch and internal field + nutWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + nutWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given + // nutWallFunctionFvPatchScalarField + // onto a new patch + nutWallFunctionFvPatchScalarField + ( + const nutWallFunctionFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + nutWallFunctionFvPatchScalarField + ( + const nutWallFunctionFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchScalarField> clone() const + { + return tmp<fvPatchScalarField> + ( + new nutWallFunctionFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + nutWallFunctionFvPatchScalarField + ( + const nutWallFunctionFvPatchScalarField&, + 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 nutWallFunctionFvPatchScalarField(*this, iF) + ); + } + + + // Member functions + + // Evaluation functions + + //- Update the coefficients associated with the patch field + virtual void updateCoeffs(); + + + // I-O + + //- Write + void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C new file mode 100644 index 00000000000..84793a2c420 --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C @@ -0,0 +1,204 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "omegaWallFunctionFvPatchScalarField.H" +#include "RASModel.H" +#include "fvPatchFieldMapper.H" +#include "volFields.H" +#include "addToRunTimeSelectionTable.H" +#include "wallFvPatch.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +void omegaWallFunctionFvPatchScalarField::checkType() +{ + if (!isA<wallFvPatch>(patch())) + { + FatalErrorIn("omegaWallFunctionFvPatchScalarField::checkType()") + << "Invalid wall function specification" << nl + << " Patch type for patch " << patch().name() + << " must be wall" << nl + << " Current patch type is " << patch().type() << nl << endl + << abort(FatalError); + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedInternalValueFvPatchField<scalar>(p, iF) +{ + checkType(); +} + + +omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField +( + const omegaWallFunctionFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + fixedInternalValueFvPatchField<scalar>(ptf, p, iF, mapper) +{ + checkType(); +} + + +omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + fixedInternalValueFvPatchField<scalar>(p, iF, dict) +{ + checkType(); +} + + +omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField +( + const omegaWallFunctionFvPatchScalarField& ewfpsf +) +: + fixedInternalValueFvPatchField<scalar>(ewfpsf) +{ + checkType(); +} + + +omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField +( + const omegaWallFunctionFvPatchScalarField& ewfpsf, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedInternalValueFvPatchField<scalar>(ewfpsf, iF) +{ + checkType(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void omegaWallFunctionFvPatchScalarField::updateCoeffs() +{ + const RASModel& ras = db().lookupObject<RASModel>("RASProperties"); + + const scalar Cmu = ras.Cmu().value(); + const scalar Cmu25 = pow(Cmu, 0.25); + + const scalar kappa = ras.kappa().value(); + const scalar yPlusLam = ras.yPlusLam(); + + const scalarField& y = ras.y()[patch().index()]; + + volScalarField& G = const_cast<volScalarField&> + (db().lookupObject<volScalarField>("G")); + + volScalarField& omega = const_cast<volScalarField&> + (db().lookupObject<volScalarField>("omega")); + + const scalarField& k = db().lookupObject<volScalarField>("k"); + + const scalarField& nuw = + patch().lookupPatchField<volScalarField, scalar>("nu"); + + const scalarField& nutw = + patch().lookupPatchField<volScalarField, scalar>("nut"); + + const fvPatchVectorField& Uw = + patch().lookupPatchField<volVectorField, vector>("U"); + + const scalarField magGradUw = mag(Uw.snGrad()); + + // Set epsilon and G + forAll(nutw, faceI) + { + label faceCellI = patch().faceCells()[faceI]; + + scalar yPlus = Cmu25*y[faceI]*sqrt(k[faceCellI])/nuw[faceI]; + + omega[faceCellI] = sqrt(k[faceCellI])/(Cmu25*kappa*y[faceI]); + + if (yPlus > yPlusLam) + { + G[faceCellI] = + (nutw[faceI] + nuw[faceI]) + *magGradUw[faceI] + *Cmu25*sqrt(k[faceCellI]) + /(kappa*y[faceI]); + } + else + { + G[faceCellI] = 0.0; + } + } + + // TODO: perform averaging for cells sharing more than one boundary face +} + + +void omegaWallFunctionFvPatchScalarField::write(Ostream& os) const +{ + fixedInternalValueFvPatchField<scalar>::write(os); + writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField +( + fvPatchScalarField, + omegaWallFunctionFvPatchScalarField +); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.H new file mode 100644 index 00000000000..37c8d90188a --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.H @@ -0,0 +1,159 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::incompressible::RASModels::omegaWallFunctionFvPatchScalarField + +Description + Replaces functionality in wallFunctionsI.H + +SourceFiles + omegaWallFunctionFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef omegaWallFunctionFvPatchScalarField_H +#define omegaWallFunctionFvPatchScalarField_H + +#include "fixedInternalValueFvPatchField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class omegaWallFunctionFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class omegaWallFunctionFvPatchScalarField +: + public fixedInternalValueFvPatchField<scalar> +{ + + // Private member functions + + //- Check the type of the patch + void checkType(); + + +public: + + //- Runtime type information + TypeName("omegaWallFunction"); + + + // Constructors + + //- Construct from patch and internal field + omegaWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + omegaWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given + // omegaWallFunctionFvPatchScalarField + // onto a new patch + omegaWallFunctionFvPatchScalarField + ( + const omegaWallFunctionFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + omegaWallFunctionFvPatchScalarField + ( + const omegaWallFunctionFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchScalarField> clone() const + { + return tmp<fvPatchScalarField> + ( + new omegaWallFunctionFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + omegaWallFunctionFvPatchScalarField + ( + const omegaWallFunctionFvPatchScalarField&, + 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 omegaWallFunctionFvPatchScalarField(*this, iF) + ); + } + + + // Member functions + + // Evaluation functions + + //- Update the coefficients associated with the patch field + virtual void updateCoeffs(); + + + // I-O + + //- Write + void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/include/nonLinearWallFunctionsI.H b/src/turbulenceModels/incompressible/RAS/include/nonLinearWallFunctionsI.H new file mode 100644 index 00000000000..2efc4efe966 --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/include/nonLinearWallFunctionsI.H @@ -0,0 +1,127 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Global + nonLinearwallFunctions + +Description + Calculate wall generation and dissipation from wall-functions + for non-linear models. + +\*---------------------------------------------------------------------------*/ + +{ + labelList cellBoundaryFaceCount(epsilon_.size(), 0); + + const fvPatchList& patches = mesh_.boundary(); + + //- Initialise the near-wall G and epsilon fields to zero + forAll(patches, patchi) + { + const fvPatch& curPatch = patches[patchi]; + + if (isType<wallFvPatch>(curPatch)) + { + forAll(curPatch, facei) + { + label faceCelli = curPatch.faceCells()[facei]; + + epsilon_[faceCelli] = 0.0; + G[faceCelli] = 0.0; + } + } + } + + //- Accumulate the wall face contributions to epsilon and G + // Increment cellBoundaryFaceCount for each face for averaging + forAll(patches, patchi) + { + const fvPatch& curPatch = patches[patchi]; + + if (isType<wallFvPatch>(curPatch)) + { +# include "checkPatchFieldTypes.H" + + const scalarField& nuw = nu().boundaryField()[patchi]; + const scalarField& nutw = nut_.boundaryField()[patchi]; + + scalarField magFaceGradU = mag(U_.boundaryField()[patchi].snGrad()); + + forAll(curPatch, facei) + { + label faceCelli = curPatch.faceCells()[facei]; + + //- using local Cmu ! + scalar Cmu25 = pow(Cmu_[faceCelli], 0.25); + scalar Cmu75 = pow(Cmu_[faceCelli], 0.75); + + scalar yPlus = + Cmu25*y_[patchi][facei] + *sqrt(k_[faceCelli]) + /nuw[facei]; + + // For corner cells (with two boundary or more faces), + // epsilon and G in the near-wall cell are calculated + // as an average + + cellBoundaryFaceCount[faceCelli]++; + + epsilon_[faceCelli] += + Cmu75*pow(k_[faceCelli], 1.5) + /(kappa_.value()*y_[patchi][facei]); + + if (yPlus > yPlusLam_) + { + G[faceCelli] += + (nutw[facei] + nuw[facei]) + *magFaceGradU[facei] + *Cmu25*sqrt(k_[faceCelli]) + /(kappa_.value()*y_[patchi][facei]) + - (nonlinearStress_[faceCelli] && gradU_[faceCelli]); + } + } + } + } + + // Perform the averaging + + forAll(patches, patchi) + { + const fvPatch& curPatch = patches[patchi]; + + if (isType<wallFvPatch>(curPatch)) + { + forAll(curPatch, facei) + { + label faceCelli = curPatch.faceCells()[facei]; + + epsilon_[faceCelli] /= cellBoundaryFaceCount[faceCelli]; + G[faceCelli] /= cellBoundaryFaceCount[faceCelli]; + } + } + } +} + + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/include/wallDissipationI.H b/src/turbulenceModels/incompressible/RAS/include/wallDissipationI.H new file mode 100644 index 00000000000..5eb3f49171c --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/include/wallDissipationI.H @@ -0,0 +1,51 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Global + wallDissipation + +Description + Set wall dissipation in the epsilon matrix + +\*---------------------------------------------------------------------------*/ + +{ + const fvPatchList& patches = mesh_.boundary(); + + forAll(patches, patchi) + { + const fvPatch& p = patches[patchi]; + + if (isType<wallFvPatch>(p)) + { + epsEqn().setValues + ( + p.faceCells(), + epsilon_.boundaryField()[patchi].patchInternalField() + ); + } + } +} + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/include/wallFunctionsI.H.old b/src/turbulenceModels/incompressible/RAS/include/wallFunctionsI.H.old new file mode 100644 index 00000000000..ce89e329ffc --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/include/wallFunctionsI.H.old @@ -0,0 +1,126 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Global + wallFunctions + +Description + Calculate wall generation and dissipation from wall-functions. + +\*---------------------------------------------------------------------------*/ + +{ + labelList cellBoundaryFaceCount(epsilon_.size(), 0); + + scalar Cmu25 = pow(Cmu_.value(), 0.25); + scalar Cmu75 = pow(Cmu_.value(), 0.75); + + const fvPatchList& patches = mesh_.boundary(); + + //- Initialise the near-wall epsilon and G fields to zero + forAll(patches, patchi) + { + const fvPatch& curPatch = patches[patchi]; + + if (isType<wallFvPatch>(curPatch)) + { + forAll(curPatch, facei) + { + label faceCelli = curPatch.faceCells()[facei]; + + epsilon_[faceCelli] = 0.0; + G[faceCelli] = 0.0; + } + } + } + + //- Accumulate the wall face contributions to epsilon and G + // Increment cellBoundaryFaceCount for each face for averaging + forAll(patches, patchi) + { + const fvPatch& curPatch = patches[patchi]; + + if (isType<wallFvPatch>(curPatch)) + { +# include "checkPatchFieldTypes.H" + + const scalarField& nuw = nu().boundaryField()[patchi]; + const scalarField& nutw = nut_.boundaryField()[patchi]; + + scalarField magFaceGradU = + mag(U_.boundaryField()[patchi].snGrad()); + + forAll(curPatch, facei) + { + label faceCelli = curPatch.faceCells()[facei]; + + scalar yPlus = + Cmu25*RASModel::y_[patchi][facei] + *sqrt(k_[faceCelli]) + /nuw[facei]; + + // For corner cells (with two boundary or more faces), + // epsilon and G in the near-wall cell are calculated + // as an average + + cellBoundaryFaceCount[faceCelli]++; + + epsilon_[faceCelli] += + Cmu75*pow(k_[faceCelli], 1.5) + /(kappa_.value()*RASModel::y_[patchi][facei]); + + if (yPlus > yPlusLam_) + { + G[faceCelli] += + (nutw[facei] + nuw[facei]) + *magFaceGradU[facei] + *Cmu25*sqrt(k_[faceCelli]) + /(kappa_.value()*RASModel::y_[patchi][facei]); + } + } + } + } + + + // Perform the averaging + + forAll(patches, patchi) + { + const fvPatch& curPatch = patches[patchi]; + + if (isType<wallFvPatch>(curPatch)) + { + forAll(curPatch, facei) + { + label faceCelli = curPatch.faceCells()[facei]; + + epsilon_[faceCelli] /= cellBoundaryFaceCount[faceCelli]; + G[faceCelli] /= cellBoundaryFaceCount[faceCelli]; + } + } + } +} + + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/include/wallNonlinearViscosityI.H b/src/turbulenceModels/incompressible/RAS/include/wallNonlinearViscosityI.H new file mode 100644 index 00000000000..2c5517b468e --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/include/wallNonlinearViscosityI.H @@ -0,0 +1,70 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Global + wallNonlinearViscosity + +Description + Calculate wall viscosity for non-linear models + +\*---------------------------------------------------------------------------*/ + +{ + const fvPatchList& patches = mesh_.boundary(); + + forAll(patches, patchi) + { + const fvPatch& curPatch = patches[patchi]; + + if (isType<wallFvPatch>(curPatch)) + { + const scalarField& nuw = nu().boundaryField()[patchi]; + scalarField& nutw = nut_.boundaryField()[patchi]; + + forAll(curPatch, facei) + { + label faceCelli = curPatch.faceCells()[facei]; + + //- Using local Cmu + scalar Cmu25 = pow(Cmu_[faceCelli], 0.25); + + scalar yPlus = + Cmu25*y_[patchi][facei]*sqrt(k_[faceCelli])/nuw[facei]; + + if (yPlus > yPlusLam_) + { + nutw[facei] = nuw[facei] + *(yPlus*kappa_.value()/log(E_.value()*yPlus) - 1); + } + else + { + nutw[facei] = 0.0; + } + } + } + } +} + + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/include/wallViscosityI.H.old b/src/turbulenceModels/incompressible/RAS/include/wallViscosityI.H.old new file mode 100644 index 00000000000..a9a8e8bafa5 --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/include/wallViscosityI.H.old @@ -0,0 +1,70 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Global + wallViscosity + +Description + Calculate wall viscosity from wall-functions. + +\*---------------------------------------------------------------------------*/ + +{ + scalar Cmu25 = pow(Cmu_.value(), 0.25); + + const fvPatchList& patches = mesh_.boundary(); + + forAll(patches, patchi) + { + const fvPatch& curPatch = patches[patchi]; + + if (isType<wallFvPatch>(curPatch)) + { + const scalarField& nuw = nu().boundaryField()[patchi]; + scalarField& nutw = nut_.boundaryField()[patchi]; + + forAll(curPatch, facei) + { + label faceCelli = curPatch.faceCells()[facei]; + + scalar yPlus = + Cmu25*y_[patchi][facei]*sqrt(k_[faceCelli])/nuw[facei]; + + if (yPlus > yPlusLam_) + { + nutw[facei] = + nuw[facei] + *(yPlus*kappa_.value()/log(E_.value()*yPlus) - 1); + } + else + { + nutw[facei] = 0.0; + } + } + } + } +} + + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/kEpsilon/kEpsilon.C b/src/turbulenceModels/incompressible/RAS/kEpsilon/kEpsilon.C new file mode 100644 index 00000000000..38b382b86aa --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/kEpsilon/kEpsilon.C @@ -0,0 +1,273 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "kEpsilon.H" +#include "addToRunTimeSelectionTable.H" +#include "wallFvPatch.H" + +#include "backwardsCompatibilityWallFunctions.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(kEpsilon, 0); +addToRunTimeSelectionTable(RASModel, kEpsilon, dictionary); + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +kEpsilon::kEpsilon +( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& lamTransportModel +) +: + RASModel(typeName, U, phi, lamTransportModel), + + Cmu_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Cmu", + coeffDict_, + 0.09 + ) + ), + C1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "C1", + coeffDict_, + 1.44 + ) + ), + C2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "C2", + coeffDict_, + 1.92 + ) + ), + alphaEps_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphaEps", + coeffDict_, + 0.76923 + ) + ), + + k_ + ( + IOobject + ( + "k", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + autoCreateK("k", mesh_) + ), + epsilon_ + ( + IOobject + ( + "epsilon", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + autoCreateEpsilon("epsilon", mesh_) + ), + nut_ + ( + IOobject + ( + "nut", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + autoCreateNut("nut", mesh_) + ) +{ + nut_ == Cmu_*sqr(k_)/(epsilon_ + epsilonSmall_); + nut_.correctBoundaryConditions(); + + printCoeffs(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +tmp<volSymmTensorField> kEpsilon::R() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + "R", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + ((2.0/3.0)*I)*k_ - nut_*twoSymm(fvc::grad(U_)), + k_.boundaryField().types() + ) + ); +} + + +tmp<volSymmTensorField> kEpsilon::devReff() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + "devRhoReff", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + -nuEff()*dev(twoSymm(fvc::grad(U_))) + ) + ); +} + + +tmp<fvVectorMatrix> kEpsilon::divDevReff(volVectorField& U) const +{ + return + ( + - fvm::laplacian(nuEff(), U) + - fvc::div(nuEff()*dev(fvc::grad(U)().T())) + ); +} + + +bool kEpsilon::read() +{ + if (RASModel::read()) + { + Cmu_.readIfPresent(coeffDict_); + C1_.readIfPresent(coeffDict_); + C2_.readIfPresent(coeffDict_); + alphaEps_.readIfPresent(coeffDict_); + + return true; + } + else + { + return false; + } +} + + +void kEpsilon::correct() +{ + RASModel::correct(); + + if (!turbulence_) + { + return; + } + + volScalarField G("G", nut_*2*magSqr(symm(fvc::grad(U_)))); + + // Update espsilon and G at the wall + epsilon_.boundaryField().updateCoeffs(); + + // Dissipation equation + tmp<fvScalarMatrix> epsEqn + ( + fvm::ddt(epsilon_) + + fvm::div(phi_, epsilon_) + - fvm::Sp(fvc::div(phi_), epsilon_) + - fvm::laplacian(DepsilonEff(), epsilon_) + == + C1_*G*epsilon_/k_ + - fvm::Sp(C2_*epsilon_/k_, epsilon_) + ); + + epsEqn().relax(); + + epsEqn().boundaryManipulate(epsilon_.boundaryField()); + + solve(epsEqn); + bound(epsilon_, epsilon0_); + + + // Turbulent kinetic energy equation + tmp<fvScalarMatrix> kEqn + ( + fvm::ddt(k_) + + fvm::div(phi_, k_) + - fvm::Sp(fvc::div(phi_), k_) + - fvm::laplacian(DkEff(), k_) + == + G + - fvm::Sp(epsilon_/k_, k_) + ); + + kEqn().relax(); + solve(kEqn); + bound(k_, k0_); + + + // Re-calculate viscosity + nut_ == Cmu_*sqr(k_)/epsilon_; + nut_.correctBoundaryConditions(); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/kEpsilon/kEpsilon.H b/src/turbulenceModels/incompressible/RAS/kEpsilon/kEpsilon.H new file mode 100644 index 00000000000..52e3f70d84c --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/kEpsilon/kEpsilon.H @@ -0,0 +1,175 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::incompressible::RASModels::kEpsilon + +Description + Standard k-epsilon turbulence model for incompressible flows. + + The default model coefficients correspond to the following: + @verbatim + kEpsilonCoeffs + { + Cmu 0.09; + C1 1.44; + C2 1.92; + C3 -0.33; // only for compressible + alphak 1.0; // only for compressible + alphaEps 0.76923; + alphah 1.0; // only for compressible + } + @endverbatim + +SourceFiles + kEpsilon.C + +\*---------------------------------------------------------------------------*/ + +#ifndef kEpsilon_H +#define kEpsilon_H + +#include "RASModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class kEpsilon Declaration +\*---------------------------------------------------------------------------*/ + +class kEpsilon +: + public RASModel +{ + // Private data + + // Model coefficients + + dimensionedScalar Cmu_; + dimensionedScalar C1_; + dimensionedScalar C2_; + dimensionedScalar alphaEps_; + + + // Fields + + volScalarField k_; + volScalarField epsilon_; + volScalarField nut_; + + +public: + + //- Runtime type information + TypeName("kEpsilon"); + + // Constructors + + //- Construct from components + kEpsilon + ( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport + ); + + + //- Destructor + virtual ~kEpsilon() + {} + + + // Member Functions + + //- Return the turbulence viscosity + virtual tmp<volScalarField> nut() const + { + return nut_; + } + + //- Return the effective diffusivity for k + tmp<volScalarField> DkEff() const + { + return tmp<volScalarField> + ( + new volScalarField("DkEff", nut_ + nu()) + ); + } + + //- Return the effective diffusivity for epsilon + tmp<volScalarField> DepsilonEff() const + { + return tmp<volScalarField> + ( + new volScalarField("DepsilonEff", alphaEps_*nut_ + nu()) + ); + } + + //- Return the turbulence kinetic energy + virtual tmp<volScalarField> k() const + { + return k_; + } + + //- Return the turbulence kinetic energy dissipation rate + virtual tmp<volScalarField> epsilon() const + { + return epsilon_; + } + + //- Return the Reynolds stress tensor + virtual tmp<volSymmTensorField> R() const; + + //- Return the effective stress tensor including the laminar stress + virtual tmp<volSymmTensorField> devReff() const; + + //- Return the source term for the momentum equation + virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const; + + //- Solve the turbulence equations and correct the turbulence viscosity + virtual void correct(); + + //- Read turbulenceProperties dictionary + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/kOmega/kOmega.C b/src/turbulenceModels/incompressible/RAS/kOmega/kOmega.C new file mode 100644 index 00000000000..bb53b7e765b --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/kOmega/kOmega.C @@ -0,0 +1,285 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "kOmega.H" +#include "addToRunTimeSelectionTable.H" +#include "wallFvPatch.H" + +#include "backwardsCompatibilityWallFunctions.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(kOmega, 0); +addToRunTimeSelectionTable(RASModel, kOmega, dictionary); + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +kOmega::kOmega +( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& lamTransportModel +) +: + RASModel(typeName, U, phi, lamTransportModel), + + Cmu_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "betaStar", + coeffDict_, + 0.09 + ) + ), + beta_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "beta", + coeffDict_, + 0.072 + ) + ), + alpha_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alpha", + coeffDict_, + 0.52 + ) + ), + alphaK_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphaK", + coeffDict_, + 0.5 + ) + ), + alphaOmega_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphaOmega", + coeffDict_, + 0.5 + ) + ), + + omega0_("omega0", dimless/dimTime, SMALL), + omegaSmall_("omegaSmall", dimless/dimTime, SMALL), + + k_ + ( + IOobject + ( + "k", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + autoCreateK("k", mesh_) + ), + omega_ + ( + IOobject + ( + "omega", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + autoCreateOmega("omega", mesh_) + ), + nut_ + ( + IOobject + ( + "nut", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + autoCreateNut("nut", mesh_) + ) +{ + nut_ == k_/(omega_ + omegaSmall_); + nut_.correctBoundaryConditions(); + + printCoeffs(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +tmp<volSymmTensorField> kOmega::R() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + "R", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + ((2.0/3.0)*I)*k_ - nut_*twoSymm(fvc::grad(U_)), + k_.boundaryField().types() + ) + ); +} + + +tmp<volSymmTensorField> kOmega::devReff() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + "devRhoReff", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + -nuEff()*dev(twoSymm(fvc::grad(U_))) + ) + ); +} + + +tmp<fvVectorMatrix> kOmega::divDevReff(volVectorField& U) const +{ + return + ( + - fvm::laplacian(nuEff(), U) + - fvc::div(nuEff()*dev(fvc::grad(U)().T())) + ); +} + + +bool kOmega::read() +{ + if (RASModel::read()) + { + Cmu_.readIfPresent(coeffDict_); + beta_.readIfPresent(coeffDict_); + alphaK_.readIfPresent(coeffDict_); + alphaOmega_.readIfPresent(coeffDict_); + + return true; + } + else + { + return false; + } +} + + +void kOmega::correct() +{ + RASModel::correct(); + + if (!turbulence_) + { + return; + } + + volScalarField G("G", nut_*2*magSqr(symm(fvc::grad(U_)))); + + // Update omega and G at the wall + omega_.boundaryField().updateCoeffs(); + + // Turbulence specific dissipation rate equation + tmp<fvScalarMatrix> omegaEqn + ( + fvm::ddt(omega_) + + fvm::div(phi_, omega_) + - fvm::Sp(fvc::div(phi_), omega_) + - fvm::laplacian(DomegaEff(), omega_) + == + alpha_*G*omega_/k_ + - fvm::Sp(beta_*omega_, omega_) + ); + + omegaEqn().relax(); + + omegaEqn().boundaryManipulate(omega_.boundaryField()); + + solve(omegaEqn); + bound(omega_, omega0_); + + + // Turbulent kinetic energy equation + tmp<fvScalarMatrix> kEqn + ( + fvm::ddt(k_) + + fvm::div(phi_, k_) + - fvm::Sp(fvc::div(phi_), k_) + - fvm::laplacian(DkEff(), k_) + == + G + - fvm::Sp(Cmu_*omega_, k_) + ); + + kEqn().relax(); + solve(kEqn); + bound(k_, k0_); + + + // Re-calculate viscosity + nut_ == k_/omega_; + nut_.correctBoundaryConditions(); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/kOmega/kOmega.H b/src/turbulenceModels/incompressible/RAS/kOmega/kOmega.H new file mode 100644 index 00000000000..cb387cd10ed --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/kOmega/kOmega.H @@ -0,0 +1,209 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::incompressible::RASModels::kOmega + +Description + Standard high Reynolds-number k-omega turbulence model for + incompressible flows. + + References: + @verbatim + "Turbulence Modeling for CFD" + D. C. Wilcox, + DCW Industries, Inc., La Canada, + California, 1998. + + See also: + http://www.cfd-online.com/Wiki/Wilcox's_k-omega_model + @endverbatim + + The default model coefficients correspond to the following: + @verbatim + kOmegaCoeffs + { + Cmu 0.09; // Equivalent to betaStar + alpha 0.52; + beta 0.072; + alphak 0.5; + alphaOmega 0.5; + } + @endverbatim + +SourceFiles + kOmega.C + +\*---------------------------------------------------------------------------*/ + +#ifndef kOmega_H +#define kOmega_H + +#include "RASModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class kOmega Declaration +\*---------------------------------------------------------------------------*/ + +class kOmega +: + public RASModel +{ + // Private data + + // Model coefficients + + dimensionedScalar Cmu_; + dimensionedScalar beta_; + dimensionedScalar alpha_; + dimensionedScalar alphaK_; + dimensionedScalar alphaOmega_; + + + dimensionedScalar omega0_; + dimensionedScalar omegaSmall_; + + + // Fields + + volScalarField k_; + volScalarField omega_; + volScalarField nut_; + + +public: + + //- Runtime type information + TypeName("kOmega"); + + // Constructors + + //- Construct from components + kOmega + ( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport + ); + + + // Destructor + virtual ~kOmega() + {} + + + // Member Functions + + //- Return the turbulence viscosity + virtual tmp<volScalarField> nut() const + { + return nut_; + } + + //- Return the effective diffusivity for k + tmp<volScalarField> DkEff() const + { + return tmp<volScalarField> + ( + new volScalarField("DkEff", alphaK_*nut_ + nu()) + ); + } + + //- Return the effective diffusivity for omega + tmp<volScalarField> DomegaEff() const + { + return tmp<volScalarField> + ( + new volScalarField("DomegaEff", alphaOmega_*nut_ + nu()) + ); + } + + //- Return the turbulence kinetic energy + virtual tmp<volScalarField> k() const + { + return k_; + } + + //- Return the turbulence specific dissipation rate + virtual tmp<volScalarField> omega() const + { + return omega_; + } + + //- Return the turbulence kinetic energy dissipation rate + virtual tmp<volScalarField> epsilon() const + { + return tmp<volScalarField> + ( + new volScalarField + ( + IOobject + ( + "epsilon", + mesh_.time().timeName(), + mesh_ + ), + Cmu_*k_*omega_, + omega_.boundaryField().types() + ) + ); + } + + //- Return the Reynolds stress tensor + virtual tmp<volSymmTensorField> R() const; + + //- Return the effective stress tensor including the laminar stress + virtual tmp<volSymmTensorField> devReff() const; + + //- Return the source term for the momentum equation + virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const; + + //- Solve the turbulence equations and correct the turbulence viscosity + virtual void correct(); + + //- Read turbulenceProperties dictionary + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C b/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C new file mode 100644 index 00000000000..cff3a3dc566 --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C @@ -0,0 +1,423 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "kOmegaSST.H" +#include "addToRunTimeSelectionTable.H" +#include "wallFvPatch.H" + +#include "backwardsCompatibilityWallFunctions.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(kOmegaSST, 0); +addToRunTimeSelectionTable(RASModel, kOmegaSST, dictionary); + +// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // + +tmp<volScalarField> kOmegaSST::F1(const volScalarField& CDkOmega) const +{ + volScalarField CDkOmegaPlus = max + ( + CDkOmega, + dimensionedScalar("1.0e-10", dimless/sqr(dimTime), 1.0e-10) + ); + + volScalarField arg1 = min + ( + min + ( + max + ( + (scalar(1)/betaStar_)*sqrt(k_)/(omega_*y_), + scalar(500)*nu()/(sqr(y_)*omega_) + ), + (4*alphaOmega2_)*k_/(CDkOmegaPlus*sqr(y_)) + ), + scalar(10) + ); + + return tanh(pow4(arg1)); +} + +tmp<volScalarField> kOmegaSST::F2() const +{ + volScalarField arg2 = min + ( + max + ( + (scalar(2)/betaStar_)*sqrt(k_)/(omega_*y_), + scalar(500)*nu()/(sqr(y_)*omega_) + ), + scalar(100) + ); + + return tanh(sqr(arg2)); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +kOmegaSST::kOmegaSST +( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& lamTransportModel +) +: + RASModel(typeName, U, phi, lamTransportModel), + + alphaK1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphaK1", + coeffDict_, + 0.85034 + ) + ), + alphaK2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphaK2", + coeffDict_, + 1.0 + ) + ), + alphaOmega1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphaOmega1", + coeffDict_, + 0.5 + ) + ), + alphaOmega2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphaOmega2", + coeffDict_, + 0.85616 + ) + ), + gamma1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "gamma1", + coeffDict_, + 0.5532 + ) + ), + gamma2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "gamma2", + coeffDict_, + 0.4403 + ) + ), + beta1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "beta1", + coeffDict_, + 0.075 + ) + ), + beta2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "beta2", + coeffDict_, + 0.0828 + ) + ), + betaStar_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "betaStar", + coeffDict_, + 0.09 + ) + ), + a1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "a1", + coeffDict_, + 0.31 + ) + ), + c1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "c1", + coeffDict_, + 10.0 + ) + ), + + omega0_("omega0", dimless/dimTime, SMALL), + omegaSmall_("omegaSmall", dimless/dimTime, SMALL), + + Cmu_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Cmu", + coeffDict_, + 0.09 + ) + ), + + y_(mesh_), + + k_ + ( + IOobject + ( + "k", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + autoCreateK("k", mesh_) + ), + omega_ + ( + IOobject + ( + "omega", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + autoCreateOmega("omega", mesh_) + ), + nut_ + ( + IOobject + ( + "nut", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + autoCreateNut("nut", mesh_) + ) +{ + nut_ == + a1_*k_ + /max + ( + a1_*(omega_ + omegaSmall_), + F2()*mag(symm(fvc::grad(U_))) + ); + nut_.correctBoundaryConditions(); + + printCoeffs(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +tmp<volSymmTensorField> kOmegaSST::R() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + "R", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + ((2.0/3.0)*I)*k_ - nut_*twoSymm(fvc::grad(U_)), + k_.boundaryField().types() + ) + ); +} + + +tmp<volSymmTensorField> kOmegaSST::devReff() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + "devRhoReff", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + -nuEff()*dev(twoSymm(fvc::grad(U_))) + ) + ); +} + + +tmp<fvVectorMatrix> kOmegaSST::divDevReff(volVectorField& U) const +{ + return + ( + - fvm::laplacian(nuEff(), U) + - fvc::div(nuEff()*dev(fvc::grad(U)().T())) + ); +} + + +bool kOmegaSST::read() +{ + if (RASModel::read()) + { + alphaK1_.readIfPresent(coeffDict_); + alphaK2_.readIfPresent(coeffDict_); + alphaOmega1_.readIfPresent(coeffDict_); + alphaOmega2_.readIfPresent(coeffDict_); + gamma1_.readIfPresent(coeffDict_); + gamma2_.readIfPresent(coeffDict_); + beta1_.readIfPresent(coeffDict_); + beta2_.readIfPresent(coeffDict_); + betaStar_.readIfPresent(coeffDict_); + a1_.readIfPresent(coeffDict_); + c1_.readIfPresent(coeffDict_); + Cmu_.readIfPresent(coeffDict_); + + return true; + } + else + { + return false; + } +} + + +void kOmegaSST::correct() +{ + RASModel::correct(); + + if (!turbulence_) + { + return; + } + + if (mesh_.changing()) + { + y_.correct(); + } + + volScalarField S2 = magSqr(symm(fvc::grad(U_))); + volScalarField G("G", nut_*2*S2); + + // Update omega and G at the wall + omega_.boundaryField().updateCoeffs(); + + volScalarField CDkOmega = + (2*alphaOmega2_)*(fvc::grad(k_) & fvc::grad(omega_))/omega_; + + volScalarField F1 = this->F1(CDkOmega); + + // Turbulent frequency equation + tmp<fvScalarMatrix> omegaEqn + ( + fvm::ddt(omega_) + + fvm::div(phi_, omega_) + - fvm::Sp(fvc::div(phi_), omega_) + - fvm::laplacian(DomegaEff(F1), omega_) + == + gamma(F1)*2*S2 + - fvm::Sp(beta(F1)*omega_, omega_) + - fvm::SuSp + ( + (F1 - scalar(1))*CDkOmega/omega_, + omega_ + ) + ); + + omegaEqn().relax(); + + omegaEqn().boundaryManipulate(omega_.boundaryField()); + + solve(omegaEqn); + bound(omega_, omega0_); + + // Turbulent kinetic energy equation + tmp<fvScalarMatrix> kEqn + ( + fvm::ddt(k_) + + fvm::div(phi_, k_) + - fvm::Sp(fvc::div(phi_), k_) + - fvm::laplacian(DkEff(F1), k_) + == + min(G, c1_*betaStar_*k_*omega_) + - fvm::Sp(betaStar_*omega_, k_) + ); + + kEqn().relax(); + solve(kEqn); + bound(k_, k0_); + + + // Re-calculate viscosity + nut_ == a1_*k_/max(a1_*omega_, F2()*sqrt(S2)); + nut_.correctBoundaryConditions(); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.H b/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.H new file mode 100644 index 00000000000..646f3ad15e4 --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.H @@ -0,0 +1,289 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::incompressible::RASModels::kOmegaSST + +Description + Implementation of the k-omega-SST turbulence model for incompressible + flows. + + Turbulence model described in: + @verbatim + Menter, F., Esch, T. + "Elements of Industrial Heat Transfer Prediction" + 16th Brazilian Congress of Mechanical Engineering (COBEM), + Nov. 2001 + @endverbatim + + Note that this implementation is written in terms of alpha diffusion + coefficients rather than the more traditional sigma (alpha = 1/sigma) so + that the blending can be applied to all coefficuients in a consistent + manner. The paper suggests that sigma is blended but this would not be + consistent with the blending of the k-epsilon and k-omega models. + + Also note that the error in the last term of equation (2) relating to + sigma has been corrected. + + Wall-functions are applied in this implementation by using equations (14) + to specify the near-wall omega as appropriate. + + The blending functions (15) and (16) are not currently used because of the + uncertainty in their origin, range of applicability and that is y+ becomes + sufficiently small blending u_tau in this manner clearly becomes nonsense. + + The default model coefficients correspond to the following: + @verbatim + kOmegaSST + { + Cmu 0.09; + alphaK1 0.85034; + alphaK2 1.0; + alphaOmega1 0.5; + alphaOmega2 0.85616; + alphah 1.0; // only for compressible + beta1 0.075; + beta2 0.0828; + betaStar 0.09; + gamma1 0.5532; + gamma2 0.4403; + a1 0.31; + c1 10.0; + } + @endverbatim + +SourceFiles + kOmegaSST.C + +\*---------------------------------------------------------------------------*/ + +#ifndef kOmegaSST_H +#define kOmegaSST_H + +#include "RASModel.H" +#include "wallDist.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class kOmega Declaration +\*---------------------------------------------------------------------------*/ + +class kOmegaSST +: + public RASModel +{ + // Private data + + dimensionedScalar alphaK1_; + dimensionedScalar alphaK2_; + + dimensionedScalar alphaOmega1_; + dimensionedScalar alphaOmega2_; + + dimensionedScalar gamma1_; + dimensionedScalar gamma2_; + + dimensionedScalar beta1_; + dimensionedScalar beta2_; + + dimensionedScalar betaStar_; + + dimensionedScalar a1_; + dimensionedScalar c1_; + + dimensionedScalar omega0_; + dimensionedScalar omegaSmall_; + + dimensionedScalar Cmu_; + + wallDist y_; + + volScalarField k_; + volScalarField omega_; + volScalarField nut_; + + + // Private member functions + + tmp<volScalarField> F1(const volScalarField& CDkOmega) const; + tmp<volScalarField> F2() const; + + tmp<volScalarField> blend + ( + const volScalarField& F1, + const dimensionedScalar& psi1, + const dimensionedScalar& psi2 + ) const + { + return F1*(psi1 - psi2) + psi2; + } + + tmp<volScalarField> alphaK + ( + const volScalarField& F1 + ) const + { + return blend(F1, alphaK1_, alphaK2_); + } + + tmp<volScalarField> alphaOmega + ( + const volScalarField& F1 + ) const + { + return blend(F1, alphaOmega1_, alphaOmega2_); + } + + tmp<volScalarField> beta + ( + const volScalarField& F1 + ) const + { + return blend(F1, beta1_, beta2_); + } + + tmp<volScalarField> gamma + ( + const volScalarField& F1 + ) const + { + return blend(F1, gamma1_, gamma2_); + } + + +public: + + //- Runtime type information + TypeName("kOmegaSST"); + + + // Constructors + + //- Construct from components + kOmegaSST + ( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport + ); + + + //- Destructor + virtual ~kOmegaSST() + {} + + + // Member Functions + + //- Return the turbulence viscosity + virtual tmp<volScalarField> nut() const + { + return nut_; + } + + //- Return the effective diffusivity for k + tmp<volScalarField> DkEff(const volScalarField& F1) const + { + return tmp<volScalarField> + ( + new volScalarField("DkEff", alphaK(F1)*nut_ + nu()) + ); + } + + //- Return the effective diffusivity for omega + tmp<volScalarField> DomegaEff(const volScalarField& F1) const + { + return tmp<volScalarField> + ( + new volScalarField("DomegaEff", alphaOmega(F1)*nut_ + nu()) + ); + } + + //- Return the turbulence kinetic energy + virtual tmp<volScalarField> k() const + { + return k_; + } + + //- Return the turbulence specific dissipation rate + virtual tmp<volScalarField> omega() const + { + return omega_; + } + + //- Return the turbulence kinetic energy dissipation rate + virtual tmp<volScalarField> epsilon() const + { + return tmp<volScalarField> + ( + new volScalarField + ( + IOobject + ( + "epsilon", + mesh_.time().timeName(), + mesh_ + ), + betaStar_*k_*omega_, + omega_.boundaryField().types() + ) + ); + } + + //- Return the Reynolds stress tensor + virtual tmp<volSymmTensorField> R() const; + + //- Return the effective stress tensor including the laminar stress + virtual tmp<volSymmTensorField> devReff() const; + + //- Return the source term for the momentum equation + virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const; + + //- Solve the turbulence equations and correct the turbulence viscosity + virtual void correct(); + + //- Read turbulenceProperties dictionary + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/laminar/laminar.C b/src/turbulenceModels/incompressible/RAS/laminar/laminar.C new file mode 100644 index 00000000000..2c871874c96 --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/laminar/laminar.C @@ -0,0 +1,203 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "laminar.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(laminar, 0); +addToRunTimeSelectionTable(RASModel, laminar, dictionary); + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +laminar::laminar +( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& lamTransportModel +) +: + RASModel(typeName, U, phi, lamTransportModel) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +tmp<volScalarField> laminar::nut() const +{ + return tmp<volScalarField> + ( + new volScalarField + ( + IOobject + ( + "nut", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensionedScalar("nut", nu().dimensions(), 0.0) + ) + ); +} + + +tmp<volScalarField> laminar::nuEff() const +{ + return tmp<volScalarField>(new volScalarField("nuEff", nu())); +} + + +tmp<volScalarField> laminar::k() const +{ + return tmp<volScalarField> + ( + new volScalarField + ( + IOobject + ( + "k", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensionedScalar("k", sqr(U_.dimensions()), 0.0) + ) + ); +} + + +tmp<volScalarField> laminar::epsilon() const +{ + return tmp<volScalarField> + ( + new volScalarField + ( + IOobject + ( + "epsilon", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensionedScalar + ( + "epsilon", sqr(U_.dimensions())/dimTime, 0.0 + ) + ) + ); +} + + +tmp<volSymmTensorField> laminar::R() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + "R", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensionedSymmTensor + ( + "R", sqr(U_.dimensions()), symmTensor::zero + ) + ) + ); +} + + +tmp<volSymmTensorField> laminar::devReff() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + "devRhoReff", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + -nu()*dev(twoSymm(fvc::grad(U_))) + ) + ); +} + + +tmp<fvVectorMatrix> laminar::divDevReff(volVectorField& U) const +{ + return + ( + - fvm::laplacian(nuEff(), U) + - fvc::div(nuEff()*dev(fvc::grad(U)().T())) + ); +} + + +bool laminar::read() +{ + return RASModel::read(); +} + + +void laminar::correct() +{ + turbulenceModel::correct(); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/laminar/laminar.H b/src/turbulenceModels/incompressible/RAS/laminar/laminar.H new file mode 100644 index 00000000000..6675a336cbd --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/laminar/laminar.H @@ -0,0 +1,122 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::incompressible::RASModels::laminar + +Description + Dummy turbulence model for laminar incompressible flow. + +SourceFiles + laminar.C + +\*---------------------------------------------------------------------------*/ + +#ifndef laminar_H +#define laminar_H + +#include "RASModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class laminar Declaration +\*---------------------------------------------------------------------------*/ + +class laminar +: + public RASModel +{ + +public: + + //- Runtime type information + TypeName("laminar"); + + // Constructors + + //- from components + laminar + ( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport + ); + + + //- Destructor + virtual ~laminar() + {} + + + // Member Functions + + //- Return the turbulence viscosity, i.e. 0 for laminar flow + virtual tmp<volScalarField> nut() const; + + //- Return the effective viscosity, i.e. the laminar viscosity + virtual tmp<volScalarField> nuEff() const; + + //- Return the turbulence kinetic energy, i.e. 0 for laminar flow + virtual tmp<volScalarField> k() const; + + //- Return the turbulence kinetic energy dissipation rate, + // i.e. 0 for laminar flow + virtual tmp<volScalarField> epsilon() const; + + //- Return the Reynolds stress tensor, i.e. 0 for laminar flow + virtual tmp<volSymmTensorField> R() const; + + //- Return the effective stress tensor including the laminar stress + virtual tmp<volSymmTensorField> devReff() const; + + //- Return the source term for the momentum equation + virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const; + + //- Correct the laminar viscosity + virtual void correct(); + + //- Read turbulenceProperties dictionary + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/realizableKE/realizableKE.C b/src/turbulenceModels/incompressible/RAS/realizableKE/realizableKE.C new file mode 100644 index 00000000000..f44f0e53e8c --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/realizableKE/realizableKE.C @@ -0,0 +1,338 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "realizableKE.H" +#include "addToRunTimeSelectionTable.H" +#include "wallFvPatch.H" + +#include "backwardsCompatibilityWallFunctions.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(realizableKE, 0); +addToRunTimeSelectionTable(RASModel, realizableKE, dictionary); + +// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // + +tmp<volScalarField> realizableKE::rCmu +( + const volTensorField& gradU, + const volScalarField& S2, + const volScalarField& magS +) +{ + tmp<volSymmTensorField> tS = dev(symm(gradU)); + const volSymmTensorField& S = tS(); + + volScalarField W = + (2*sqrt(2.0))*((S&S)&&S) + /( + magS*S2 + + dimensionedScalar("small", dimensionSet(0, 0, -3, 0, 0), SMALL) + ); + + tS.clear(); + + volScalarField phis = + (1.0/3.0)*acos(min(max(sqrt(6.0)*W, -scalar(1)), scalar(1))); + volScalarField As = sqrt(6.0)*cos(phis); + volScalarField Us = sqrt(S2/2.0 + magSqr(skew(gradU))); + + return 1.0/(A0_ + As*Us*k_/(epsilon_ + epsilonSmall_)); +} + + +tmp<volScalarField> realizableKE::rCmu +( + const volTensorField& gradU +) +{ + volScalarField S2 = 2*magSqr(dev(symm(gradU))); + volScalarField magS = sqrt(S2); + return rCmu(gradU, S2, magS); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +realizableKE::realizableKE +( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& lamTransportModel +) +: + RASModel(typeName, U, phi, lamTransportModel), + + Cmu_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Cmu", + coeffDict_, + 0.09 + ) + ), + A0_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "A0", + coeffDict_, + 4.0 + ) + ), + C2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "C2", + coeffDict_, + 1.9 + ) + ), + alphak_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphak", + coeffDict_, + 1.0 + ) + ), + alphaEps_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphaEps", + coeffDict_, + 0.833333 + ) + ), + + k_ + ( + IOobject + ( + "k", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + autoCreateK("k", mesh_) + ), + epsilon_ + ( + IOobject + ( + "epsilon", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + autoCreateEpsilon("epsilon", mesh_) + ), + nut_ + ( + IOobject + ( + "nut", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + autoCreateNut("nut", mesh_) + ) +{ + bound(k_, k0_); + bound(epsilon_, epsilon0_); + + nut_ == rCmu(fvc::grad(U_))*sqr(k_)/(epsilon_ + epsilonSmall_); + nut_.correctBoundaryConditions(); + + printCoeffs(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +tmp<volSymmTensorField> realizableKE::R() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + "R", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + ((2.0/3.0)*I)*k_ - nut_*twoSymm(fvc::grad(U_)), + k_.boundaryField().types() + ) + ); +} + + +tmp<volSymmTensorField> realizableKE::devReff() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + "devRhoReff", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + -nuEff()*dev(twoSymm(fvc::grad(U_))) + ) + ); +} + + +tmp<fvVectorMatrix> realizableKE::divDevReff(volVectorField& U) const +{ + return + ( + - fvm::laplacian(nuEff(), U) + - fvc::div(nuEff()*dev(fvc::grad(U)().T())) + ); +} + + +bool realizableKE::read() +{ + if (RASModel::read()) + { + Cmu_.readIfPresent(coeffDict_); + A0_.readIfPresent(coeffDict_); + C2_.readIfPresent(coeffDict_); + alphak_.readIfPresent(coeffDict_); + alphaEps_.readIfPresent(coeffDict_); + + return true; + } + else + { + return false; + } +} + + +void realizableKE::correct() +{ + RASModel::correct(); + + if (!turbulence_) + { + return; + } + + volTensorField gradU = fvc::grad(U_); + volScalarField S2 = 2*magSqr(dev(symm(gradU))); + volScalarField magS = sqrt(S2); + + volScalarField eta = magS*k_/epsilon_; + volScalarField C1 = max(eta/(scalar(5) + eta), scalar(0.43)); + + volScalarField G("G", nut_*S2); + + // Update espsilon and G at the wall + epsilon_.boundaryField().updateCoeffs(); + + + // Dissipation equation + tmp<fvScalarMatrix> epsEqn + ( + fvm::ddt(epsilon_) + + fvm::div(phi_, epsilon_) + - fvm::Sp(fvc::div(phi_), epsilon_) + - fvm::laplacian(DepsilonEff(), epsilon_) + == + C1*magS*epsilon_ + - fvm::Sp + ( + C2_*epsilon_/(k_ + sqrt(nu()*epsilon_)), + epsilon_ + ) + ); + + epsEqn().relax(); + + epsEqn().boundaryManipulate(epsilon_.boundaryField()); + + solve(epsEqn); + bound(epsilon_, epsilon0_); + + + // Turbulent kinetic energy equation + tmp<fvScalarMatrix> kEqn + ( + fvm::ddt(k_) + + fvm::div(phi_, k_) + - fvm::Sp(fvc::div(phi_), k_) + - fvm::laplacian(DkEff(), k_) + == + G - fvm::Sp(epsilon_/k_, k_) + ); + + kEqn().relax(); + solve(kEqn); + bound(k_, k0_); + + + // Re-calculate viscosity + nut_ == rCmu(gradU, S2, magS)*sqr(k_)/epsilon_; + nut_.correctBoundaryConditions(); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/realizableKE/realizableKE.H b/src/turbulenceModels/incompressible/RAS/realizableKE/realizableKE.H new file mode 100644 index 00000000000..9a633006537 --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/realizableKE/realizableKE.H @@ -0,0 +1,192 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::incompressible::RASModels::realizableKE + +Description + Realizable k-epsilon turbulence model for incompressible flows. + + Model described in the paper: + @verbatim + "A New k-epsilon Eddy Viscosity Model for High Reynolds Number + Turbulent Flows" + + Tsan-Hsing Shih, William W. Liou, Aamir Shabbir, Zhigang Tang and + Jiang Zhu + + Computers and Fluids Vol. 24, No. 3, pp. 227-238, 1995 + @endverbatim + + The default model coefficients correspond to the following: + @verbatim + realizableKE + { + Cmu 0.09; + A0 4.0; + C2 1.9; + alphak 1.0; + alphaEps 0.833333; + alphah 1.0; // only for compressible + } + @endverbatim + +SourceFiles + realizableKE.C + +\*---------------------------------------------------------------------------*/ + +#ifndef realizableKE_H +#define realizableKE_H + +#include "RASModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class realizableKE Declaration +\*---------------------------------------------------------------------------*/ + +class realizableKE +: + public RASModel +{ + // Private data + + dimensionedScalar Cmu_; + dimensionedScalar A0_; + dimensionedScalar C2_; + dimensionedScalar alphak_; + dimensionedScalar alphaEps_; + + volScalarField k_; + volScalarField epsilon_; + volScalarField nut_; + + tmp<volScalarField> rCmu + ( + const volTensorField& gradU, + const volScalarField& S2, + const volScalarField& magS + ); + + tmp<volScalarField> rCmu + ( + const volTensorField& gradU + ); + +public: + + //- Runtime type information + TypeName("realizableKE"); + + // Constructors + + //- from components + realizableKE + ( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport + ); + + + //- Destructor + virtual ~realizableKE() + {} + + + // Member Functions + + //- Return the turbulence viscosity + virtual tmp<volScalarField> nut() const + { + return nut_; + } + + //- Return the effective diffusivity for k + tmp<volScalarField> DkEff() const + { + return tmp<volScalarField> + ( + new volScalarField("DkEff", alphak_*nut_ + nu()) + ); + } + + //- Return the effective diffusivity for epsilon + tmp<volScalarField> DepsilonEff() const + { + return tmp<volScalarField> + ( + new volScalarField("DepsilonEff", alphaEps_*nut_ + nu()) + ); + } + + //- Return the turbulence kinetic energy + virtual tmp<volScalarField> k() const + { + return k_; + } + + //- Return the turbulence kinetic energy dissipation rate + virtual tmp<volScalarField> epsilon() const + { + return epsilon_; + } + + //- Return the Reynolds stress tensor + virtual tmp<volSymmTensorField> R() const; + + //- Return the effective stress tensor including the laminar stress + virtual tmp<volSymmTensorField> devReff() const; + + //- Return the source term for the momentum equation + virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const; + + //- Solve the turbulence equations and correct the turbulence viscosity + virtual void correct(); + + //- Read turbulenceProperties dictionary + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/turbulenceModel/Make/files b/src/turbulenceModels/incompressible/turbulenceModel/Make/files new file mode 100644 index 00000000000..80aac836901 --- /dev/null +++ b/src/turbulenceModels/incompressible/turbulenceModel/Make/files @@ -0,0 +1,5 @@ +turbulenceModel.C +newTurbulenceModel.C +laminar/laminar.C + +LIB = $(FOAM_LIBBIN)/libincompressibleTurbulenceModel diff --git a/src/turbulenceModels/incompressible/turbulenceModel/Make/options b/src/turbulenceModels/incompressible/turbulenceModel/Make/options new file mode 100644 index 00000000000..6ade1173471 --- /dev/null +++ b/src/turbulenceModels/incompressible/turbulenceModel/Make/options @@ -0,0 +1,7 @@ +EXE_INC = \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/transportModels + +LIB_LIBS = \ + -lfiniteVolume + diff --git a/src/turbulenceModels/incompressible/turbulenceModel/laminar/laminar.C b/src/turbulenceModels/incompressible/turbulenceModel/laminar/laminar.C new file mode 100644 index 00000000000..a30a17924e6 --- /dev/null +++ b/src/turbulenceModels/incompressible/turbulenceModel/laminar/laminar.C @@ -0,0 +1,219 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "laminar.H" +#include "Time.H" +#include "volFields.H" +#include "fvcGrad.H" +#include "fvcDiv.H" +#include "fvmLaplacian.H" +#include "addToRunTimeSelectionTable.H" + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(laminar, 0); +addToRunTimeSelectionTable(turbulenceModel, laminar, turbulenceModel); + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +laminar::laminar +( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& lamTransportModel +) +: + turbulenceModel(U, phi, lamTransportModel) +{} + + +// * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * // + +autoPtr<laminar> laminar::New +( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& lamTransportModel +) +{ + return autoPtr<laminar>(new laminar(U, phi, lamTransportModel)); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +tmp<volScalarField> laminar::nut() const +{ + return tmp<volScalarField> + ( + new volScalarField + ( + IOobject + ( + "nut", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensionedScalar("nut", nu().dimensions(), 0.0) + ) + ); +} + + +tmp<volScalarField> laminar::nuEff() const +{ + return tmp<volScalarField>(new volScalarField("nuEff", nu())); +} + + +tmp<volScalarField> laminar::k() const +{ + return tmp<volScalarField> + ( + new volScalarField + ( + IOobject + ( + "k", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensionedScalar("k", sqr(U_.dimensions()), 0.0) + ) + ); +} + + +tmp<volScalarField> laminar::epsilon() const +{ + return tmp<volScalarField> + ( + new volScalarField + ( + IOobject + ( + "epsilon", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensionedScalar + ( + "epsilon", sqr(U_.dimensions())/dimTime, 0.0 + ) + ) + ); +} + + +tmp<volSymmTensorField> laminar::R() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + "R", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensionedSymmTensor + ( + "R", sqr(U_.dimensions()), symmTensor::zero + ) + ) + ); +} + + +tmp<volSymmTensorField> laminar::devReff() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + "devRhoReff", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + -nu()*dev(twoSymm(fvc::grad(U_))) + ) + ); +} + + +tmp<fvVectorMatrix> laminar::divDevReff(volVectorField& U) const +{ + return + ( + - fvm::laplacian(nuEff(), U) + - fvc::div(nuEff()*dev(fvc::grad(U)().T())) + ); +} + + +bool laminar::read() +{ + return true; +} + + +void laminar::correct() +{ + turbulenceModel::correct(); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/turbulenceModel/laminar/laminar.H b/src/turbulenceModels/incompressible/turbulenceModel/laminar/laminar.H new file mode 100644 index 00000000000..e617e90950c --- /dev/null +++ b/src/turbulenceModels/incompressible/turbulenceModel/laminar/laminar.H @@ -0,0 +1,130 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::incompressible::laminar + +Description + Turbulence model for laminar incompressible flow. + +SourceFiles + laminar.C + +\*---------------------------------------------------------------------------*/ + +#ifndef laminar_H +#define laminar_H + +#include "turbulenceModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ + +/*---------------------------------------------------------------------------*\ + Class laminar Declaration +\*---------------------------------------------------------------------------*/ + +class laminar +: + public turbulenceModel +{ + +public: + + //- Runtime type information + TypeName("laminar"); + + // Constructors + + //- Construct from components + laminar + ( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport + ); + + + // Selectors + + //- Return a reference to the selected turbulence model + static autoPtr<laminar> New + ( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& lamTransportModel + ); + + + //- Destructor + virtual ~laminar() + {} + + + // Member Functions + + //- Return the turbulence viscosity, i.e. 0 for laminar flow + virtual tmp<volScalarField> nut() const; + + //- Return the effective viscosity, i.e. the laminar viscosity + virtual tmp<volScalarField> nuEff() const; + + //- Return the turbulence kinetic energy, i.e. 0 for laminar flow + virtual tmp<volScalarField> k() const; + + //- Return the turbulence kinetic energy dissipation rate, + // i.e. 0 for laminar flow + virtual tmp<volScalarField> epsilon() const; + + //- Return the Reynolds stress tensor, i.e. 0 for laminar flow + virtual tmp<volSymmTensorField> R() const; + + //- Return the effective stress tensor including the laminar stress + virtual tmp<volSymmTensorField> devReff() const; + + //- Return the source term for the momentum equation + virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const; + + //- Correct the laminar viscosity + virtual void correct(); + + //- Read turbulenceProperties dictionary + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/turbulenceModel/newTurbulenceModel.C b/src/turbulenceModels/incompressible/turbulenceModel/newTurbulenceModel.C new file mode 100644 index 00000000000..ef609c61f15 --- /dev/null +++ b/src/turbulenceModels/incompressible/turbulenceModel/newTurbulenceModel.C @@ -0,0 +1,96 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "turbulenceModel.H" +#include "volFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +autoPtr<turbulenceModel> turbulenceModel::New +( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& transport +) +{ + word turbulenceModelTypeName; + + // Enclose the creation of the turbulencePropertiesDict to ensure it is + // deleted before the turbulenceModel is created otherwise the dictionary + // is entered in the database twice + { + IOdictionary turbulencePropertiesDict + ( + IOobject + ( + "turbulenceProperties", + U.time().constant(), + U.db(), + IOobject::MUST_READ, + IOobject::NO_WRITE + ) + ); + + turbulencePropertiesDict.lookup("simulationType") + >> turbulenceModelTypeName; + } + + Info<< "Selecting turbulence model type " + << turbulenceModelTypeName << endl; + + turbulenceModelConstructorTable::iterator cstrIter = + turbulenceModelConstructorTablePtr_->find(turbulenceModelTypeName); + + if (cstrIter == turbulenceModelConstructorTablePtr_->end()) + { + FatalErrorIn + ( + "turbulenceModel::New(const volVectorField&, " + "const surfaceScalarField&, transportModel&)" + ) << "Unknown turbulenceModel type " << turbulenceModelTypeName + << endl << endl + << "Valid turbulenceModel types are :" << endl + << turbulenceModelConstructorTablePtr_->toc() + << exit(FatalError); + } + + return autoPtr<turbulenceModel>(cstrIter()(U, phi, transport)); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/turbulenceModel/turbulenceModel.C b/src/turbulenceModels/incompressible/turbulenceModel/turbulenceModel.C new file mode 100644 index 00000000000..e3a4a00dafb --- /dev/null +++ b/src/turbulenceModels/incompressible/turbulenceModel/turbulenceModel.C @@ -0,0 +1,79 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "turbulenceModel.H" +#include "volFields.H" +#include "surfaceFields.H" +#include "wallFvPatch.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +defineTypeNameAndDebug(turbulenceModel, 0); +defineRunTimeSelectionTable(turbulenceModel, turbulenceModel); + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +turbulenceModel::turbulenceModel +( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& lamTransportModel +) +: + runTime_(U.time()), + mesh_(U.mesh()), + + U_(U), + phi_(phi), + transportModel_(lamTransportModel) +{} + + +turbulenceModel::~turbulenceModel() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void turbulenceModel::correct() +{ + transportModel_.correct(); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/turbulenceModel/turbulenceModel.H b/src/turbulenceModels/incompressible/turbulenceModel/turbulenceModel.H new file mode 100644 index 00000000000..490b59e14e6 --- /dev/null +++ b/src/turbulenceModels/incompressible/turbulenceModel/turbulenceModel.H @@ -0,0 +1,197 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Namespace + Foam::incompressible::turbulenceModels + +Description + Namespace for incompressible turbulence turbulence models. + +Class + Foam::incompressible::turbulenceModel + +Description + Abstract base class for incompressible turbulence models + (RAS, LES and laminar). + +SourceFiles + turbulenceModel.C + newTurbulenceModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef turbulenceModel_H +#define turbulenceModel_H + +#include "primitiveFieldsFwd.H" +#include "volFieldsFwd.H" +#include "surfaceFieldsFwd.H" +#include "fvMatricesFwd.H" +#include "incompressible/transportModel/transportModel.H" +#include "autoPtr.H" +#include "runTimeSelectionTables.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declarations +class fvMesh; + +namespace incompressible +{ + +/*---------------------------------------------------------------------------*\ + Class turbulenceModel Declaration +\*---------------------------------------------------------------------------*/ + +class turbulenceModel +{ + +protected: + + // Protected data + + const Time& runTime_; + const fvMesh& mesh_; + + const volVectorField& U_; + const surfaceScalarField& phi_; + + transportModel& transportModel_; + + +private: + + // Private Member Functions + + //- Disallow default bitwise copy construct + turbulenceModel(const turbulenceModel&); + + //- Disallow default bitwise assignment + void operator=(const turbulenceModel&); + + +public: + + //- Runtime type information + TypeName("turbulenceModel"); + + + // Declare run-time New selection table + + declareRunTimeNewSelectionTable + ( + autoPtr, + turbulenceModel, + turbulenceModel, + ( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& lamTransportModel + ), + (U, phi, lamTransportModel) + ); + + + // Constructors + + //- Construct from components + turbulenceModel + ( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& lamTransportModel + ); + + + // Selectors + + //- Return a reference to the selected turbulence model + static autoPtr<turbulenceModel> New + ( + const volVectorField& U, + const surfaceScalarField& phi, + transportModel& lamTransportModel + ); + + + //- Destructor + virtual ~turbulenceModel(); + + + // Member Functions + + //- Access function to incompressible transport model + inline transportModel& transport() const + { + return transportModel_; + } + + //- Return the laminar viscosity + const volScalarField& nu() const + { + return transportModel_.nu(); + } + + //- Return the turbulence viscosity + virtual tmp<volScalarField> nut() const = 0; + + //- Return the effective viscosity + virtual tmp<volScalarField> nuEff() const = 0; + + //- Return the turbulence kinetic energy + virtual tmp<volScalarField> k() const = 0; + + //- Return the turbulence kinetic energy dissipation rate + virtual tmp<volScalarField> epsilon() const = 0; + + //- Return the Reynolds stress tensor + virtual tmp<volSymmTensorField> R() const = 0; + + //- Return the effective stress tensor including the laminar stress + virtual tmp<volSymmTensorField> devReff() const = 0; + + //- Return the source term for the momentum equation + virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const = 0; + + //- Solve the turbulence equations and correct the turbulence viscosity + virtual void correct() = 0; + + //- Read turbulenceProperties dictionary + virtual bool read() = 0; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/tutorials/buoyantSimpleFoam/hotRoom/0/alphat b/tutorials/buoyantSimpleFoam/hotRoom/0/alphat new file mode 100644 index 00000000000..a413baf8ed5 --- /dev/null +++ b/tutorials/buoyantSimpleFoam/hotRoom/0/alphat @@ -0,0 +1,42 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object alphat; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + floor + { + type alphatWallFunction; + value uniform 0; + } + ceiling + { + type alphatWallFunction; + value uniform 0; + } + fixedWalls + { + type alphatWallFunction; + value uniform 0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/buoyantSimpleFoam/hotRoom/0/epsilon.old b/tutorials/buoyantSimpleFoam/hotRoom/0/epsilon.old new file mode 100644 index 00000000000..f39bcff9427 --- /dev/null +++ b/tutorials/buoyantSimpleFoam/hotRoom/0/epsilon.old @@ -0,0 +1,39 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object epsilon.old; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -3 0 0 0 0]; + +internalField uniform 0.01; + +boundaryField +{ + floor + { + type zeroGradient; + } + ceiling + { + type zeroGradient; + } + fixedWalls + { + type zeroGradient; + } +} + + +// ************************************************************************* // diff --git a/tutorials/buoyantSimpleFoam/hotRoom/0/k.old b/tutorials/buoyantSimpleFoam/hotRoom/0/k.old new file mode 100644 index 00000000000..6289576d782 --- /dev/null +++ b/tutorials/buoyantSimpleFoam/hotRoom/0/k.old @@ -0,0 +1,39 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object k.old; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 0.1; + +boundaryField +{ + floor + { + type zeroGradient; + } + ceiling + { + type zeroGradient; + } + fixedWalls + { + type zeroGradient; + } +} + + +// ************************************************************************* // diff --git a/tutorials/buoyantSimpleFoam/hotRoom/0/mut b/tutorials/buoyantSimpleFoam/hotRoom/0/mut new file mode 100644 index 00000000000..64a67eea2ad --- /dev/null +++ b/tutorials/buoyantSimpleFoam/hotRoom/0/mut @@ -0,0 +1,42 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object mut; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + floor + { + type mutWallFunction; + value uniform 0; + } + ceiling + { + type mutWallFunction; + value uniform 0; + } + fixedWalls + { + type mutWallFunction; + value uniform 0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/interFoam/damBreak/0/alpha1 b/tutorials/interFoam/damBreak/0/alpha1 new file mode 100644 index 00000000000..fcb8a585f3b --- /dev/null +++ b/tutorials/interFoam/damBreak/0/alpha1 @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object alpha; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + leftWall + { + type zeroGradient; + } + + rightWall + { + type zeroGradient; + } + + lowerWall + { + type zeroGradient; + } + + atmosphere + { + type inletOutlet; + inletValue uniform 0; + value uniform 0; + } + + defaultFaces + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/interFoam/damBreak/0/alpha1.org b/tutorials/interFoam/damBreak/0/alpha1.org new file mode 100644 index 00000000000..fcb8a585f3b --- /dev/null +++ b/tutorials/interFoam/damBreak/0/alpha1.org @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object alpha; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + leftWall + { + type zeroGradient; + } + + rightWall + { + type zeroGradient; + } + + lowerWall + { + type zeroGradient; + } + + atmosphere + { + type inletOutlet; + inletValue uniform 0; + value uniform 0; + } + + defaultFaces + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/interFoam/damBreak/constant/turbulenceProperties b/tutorials/interFoam/damBreak/constant/turbulenceProperties new file mode 100644 index 00000000000..11c91f0a1e4 --- /dev/null +++ b/tutorials/interFoam/damBreak/constant/turbulenceProperties @@ -0,0 +1,19 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType laminar; + +// ************************************************************************* // diff --git a/tutorials/interFoam/nozzleFlow2D/0/B b/tutorials/interFoam/nozzleFlow2D/0/B new file mode 100644 index 00000000000..393db806cff --- /dev/null +++ b/tutorials/interFoam/nozzleFlow2D/0/B @@ -0,0 +1,57 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volTensorField; + object B; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform (0 0 0 0 0 0 0 0 0); + +boundaryField +{ + axis + { + type empty; + } + + inlet + { + type fixedValue; + value uniform (0 0 0 0 0 0 0 0 0); + } + + wall + { + type zeroGradient; + } + + atmosphere + { + type inletOutlet; + inletValue uniform (0 0 0 0 0 0 0 0 0); + value uniform (0 0 0 0 0 0 0 0 0); + } + + front + { + type wedge; + } + + back + { + type wedge; + } +} + +// ************************************************************************* // diff --git a/tutorials/interFoam/nozzleFlow2D/0/U b/tutorials/interFoam/nozzleFlow2D/0/U new file mode 100644 index 00000000000..8e48224239a --- /dev/null +++ b/tutorials/interFoam/nozzleFlow2D/0/U @@ -0,0 +1,57 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + axis + { + type empty; + } + + inlet + { + type fixedValue; + value uniform (460 0 0); + } + + wall + { + type fixedValue; + value uniform (0 0 0); + } + + atmosphere + { + type pressureInletOutletVelocity; + value uniform (0 0 0); + } + + front + { + type wedge; + } + + back + { + type wedge; + } +} + +// ************************************************************************* // diff --git a/tutorials/interFoam/nozzleFlow2D/0/alpha1 b/tutorials/interFoam/nozzleFlow2D/0/alpha1 new file mode 100644 index 00000000000..592961a2ce8 --- /dev/null +++ b/tutorials/interFoam/nozzleFlow2D/0/alpha1 @@ -0,0 +1,57 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object alpha1; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + axis + { + type empty; + } + + inlet + { + type fixedValue; + value uniform 1; + } + + wall + { + type zeroGradient; + } + + atmosphere + { + type inletOutlet; + inletValue uniform 0; + value uniform 0; + } + + front + { + type wedge; + } + + back + { + type wedge; + } +} + +// ************************************************************************* // diff --git a/tutorials/interFoam/nozzleFlow2D/0/data/Ubulk b/tutorials/interFoam/nozzleFlow2D/0/data/Ubulk new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tutorials/interFoam/nozzleFlow2D/0/data/ptrace b/tutorials/interFoam/nozzleFlow2D/0/data/ptrace new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tutorials/interFoam/nozzleFlow2D/0/k b/tutorials/interFoam/nozzleFlow2D/0/k new file mode 100644 index 00000000000..20e12127aee --- /dev/null +++ b/tutorials/interFoam/nozzleFlow2D/0/k @@ -0,0 +1,58 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object k; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 1e-11; + +boundaryField +{ + axis + { + type empty; + } + + inlet + { + type fixedValue; + value uniform 1e-05; + } + + wall + { + type fixedValue; + value uniform 1e-11; + } + + atmosphere + { + type inletOutlet; + inletValue uniform 0.001; + value uniform 1e-11; + } + + front + { + type wedge; + } + + back + { + type wedge; + } +} + +// ************************************************************************* // diff --git a/tutorials/interFoam/nozzleFlow2D/0/nuSgs b/tutorials/interFoam/nozzleFlow2D/0/nuSgs new file mode 100644 index 00000000000..ba060ef66c5 --- /dev/null +++ b/tutorials/interFoam/nozzleFlow2D/0/nuSgs @@ -0,0 +1,54 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object nuSgs; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -1 0 0 0 0]; + +internalField uniform 1e-11; + +boundaryField +{ + axis + { + type empty; + } + + inlet + { + type zeroGradient; + } + + wall + { + type zeroGradient; + } + + atmosphere + { + type zeroGradient; + } + + front + { + type wedge; + } + + back + { + type wedge; + } +} + +// ************************************************************************* // diff --git a/tutorials/interFoam/nozzleFlow2D/0/nuTilda b/tutorials/interFoam/nozzleFlow2D/0/nuTilda new file mode 100644 index 00000000000..d02f2919636 --- /dev/null +++ b/tutorials/interFoam/nozzleFlow2D/0/nuTilda @@ -0,0 +1,58 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object nuTilda; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + axis + { + type empty; + } + + inlet + { + type fixedValue; + value uniform 0; + } + + wall + { + type fixedValue; + value uniform 0; + } + + atmosphere + { + type inletOutlet; + inletValue uniform 0; + value uniform 0; + } + + front + { + type wedge; + } + + back + { + type wedge; + } +} + +// ************************************************************************* // diff --git a/tutorials/interFoam/nozzleFlow2D/0/pd b/tutorials/interFoam/nozzleFlow2D/0/pd new file mode 100644 index 00000000000..58eb97f2613 --- /dev/null +++ b/tutorials/interFoam/nozzleFlow2D/0/pd @@ -0,0 +1,61 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object pd; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + axis + { + type empty; + } + + inlet + { + type zeroGradient; + } + + wall + { + type zeroGradient; + } + + atmosphere + { + type totalPressure; + p0 uniform 0; + U U; + phi phi; + rho none; + psi none; + gamma 1; + value uniform 0; + } + + front + { + type wedge; + } + + back + { + type wedge; + } +} + +// ************************************************************************* // diff --git a/tutorials/interFoam/nozzleFlow2D/Allclean b/tutorials/interFoam/nozzleFlow2D/Allclean new file mode 100755 index 00000000000..0bf8736235a --- /dev/null +++ b/tutorials/interFoam/nozzleFlow2D/Allclean @@ -0,0 +1,7 @@ +#!/bin/sh + +# Source tutorial clean functions +. $WM_PROJECT_DIR/bin/tools/CleanFunctions + +cleanCase +cp constant/polyMesh/boundary.org constant/polyMesh/boundary diff --git a/tutorials/interFoam/nozzleFlow2D/Allrun b/tutorials/interFoam/nozzleFlow2D/Allrun new file mode 100755 index 00000000000..8f801cc9ce5 --- /dev/null +++ b/tutorials/interFoam/nozzleFlow2D/Allrun @@ -0,0 +1,33 @@ +#!/bin/sh +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +# Get application name from directory +application="interFoam" + +runRefineMesh () +{ + echo "Running refineMesh on $PWD" + refineMesh -dict > log.refineMesh 2>&1 +} + +runApplication blockMesh + +i=1 +if [ -f log.cellSet ] ; then + i=3 +fi +while [ "$i" -lt 3 ] ; do + if [ -f log.cellSet ] ; then + mv log.cellSet log.cellSet.1 + fi + cp system/cellSetDict.${i} system/cellSetDict + runApplication cellSet + runRefineMesh + cp -r 1e-08/polyMesh/* constant/polyMesh + rm -rf 1e-08 + i=`expr $i + 1` +done +cp constant/polyMesh/boundary.org constant/polyMesh/boundary + +runApplication $application diff --git a/tutorials/interFoam/nozzleFlow2D/constant/LESProperties b/tutorials/interFoam/nozzleFlow2D/constant/LESProperties new file mode 100644 index 00000000000..568799d2231 --- /dev/null +++ b/tutorials/interFoam/nozzleFlow2D/constant/LESProperties @@ -0,0 +1,178 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object LESProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +LESModel oneEqEddy; + +turbulence on; + +delta smooth; + +printCoeffs on; + +laminarCoeffs +{ +} + +oneEqEddyCoeffs +{ + ck 0.07; + ce 1.05; +} + +dynOneEqEddyCoeffs +{ + ce 1.05; + filter simple; +} + +locDynOneEqEddyCoeffs +{ + ce 1.05; + filter simple; +} + +SmagorinskyCoeffs +{ + ce 1.05; + ck 0.07; +} + +Smagorinsky2Coeffs +{ + ce 1.05; + ck 0.07; + cD2 0.02; +} + +spectEddyViscCoeffs +{ + ce 1.05; + cB 8.22; + cK1 0.83; + cK2 1.03; + cK3 4.75; + cK4 2.55; +} + +dynSmagorinskyCoeffs +{ + ce 1.05; + filter simple; +} + +mixedSmagorinskyCoeffs +{ + ce 1.05; + ck 0.07; + filter simple; +} + +dynMixedSmagorinskyCoeffs +{ + ce 1.05; + filter simple; +} + +LRRDiffStressCoeffs +{ + ce 1.05; + ck 0.09; + c1 1.8; + c2 0.6; +} + +DeardorffDiffStressCoeffs +{ + ce 1.05; + ck 0.09; + cm 4.13; +} + +SpalartAllmarasCoeffs +{ + alphaNut 1.5; + Cb1 0.1355; + Cb2 0.622; + Cw2 0.3; + Cw3 2; + Cv1 7.1; + Cv2 5.0; + CDES 0.65; + ck 0.07; +} + +cubeRootVolCoeffs +{ + deltaCoeff 1; +} + +PrandtlCoeffs +{ + delta cubeRootVol; + cubeRootVolCoeffs + { + deltaCoeff 1; + } + smoothCoeffs + { + delta cubeRootVol; + cubeRootVolCoeffs + { + deltaCoeff 1; + } + maxDeltaRatio 1.1; + } + Cdelta 0.158; +} + +vanDriestCoeffs +{ + delta cubeRootVol; + cubeRootVolCoeffs + { + deltaCoeff 1; + } + smoothCoeffs + { + delta cubeRootVol; + cubeRootVolCoeffs + { + deltaCoeff 1; + } + maxDeltaRatio 1.1; + } + Aplus 26; + Cdelta 0.158; +} + +smoothCoeffs +{ + delta cubeRootVol; + cubeRootVolCoeffs + { + deltaCoeff 1; + } + maxDeltaRatio 1.1; +} + +kappa 0.4187; + +wallFunctionCoeffs +{ + E 9; +} + +// ************************************************************************* // diff --git a/tutorials/interFoam/nozzleFlow2D/constant/environmentalProperties b/tutorials/interFoam/nozzleFlow2D/constant/environmentalProperties new file mode 100644 index 00000000000..ca80af21ee6 --- /dev/null +++ b/tutorials/interFoam/nozzleFlow2D/constant/environmentalProperties @@ -0,0 +1,19 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object environmentalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +g g [0 1 -2 0 0 0 0] (0 0 0); + +// ************************************************************************* // diff --git a/tutorials/interFoam/nozzleFlow2D/constant/polyMesh/blockMeshDict b/tutorials/interFoam/nozzleFlow2D/constant/polyMesh/blockMeshDict new file mode 100644 index 00000000000..6285892ea29 --- /dev/null +++ b/tutorials/interFoam/nozzleFlow2D/constant/polyMesh/blockMeshDict @@ -0,0 +1,114 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +convertToMeters 1e-06; + +vertices +( + (0 0 0) + (3000 0 0) + (0 100 -4.36609429085) + (3000 300 -13.0982828726) + (0 400 -17.4643771634) + (3000 700 -30.562660036) + (0 800 -34.9287543268) + (3000 1000 -43.6609429085) + (0 1600 -69.8575086536) + (3000 1600 -69.8575086536) + + (0 100 4.36609429085) + (3000 300 13.0982828726) + (0 400 17.4643771634) + (3000 700 30.562660036) + (0 800 34.9287543268) + (3000 1000 43.6609429085) + (0 1600 69.8575086536) + (3000 1600 69.8575086536) +); + +blocks +( + hex (0 1 3 2 0 1 11 10) + (75 30 1) + edgeGrading (1 1 1 1 0.1666667 1 1 0.1666667 1 1 1 1) + + hex (2 3 5 4 10 11 13 12) + (75 40 1) + edgeGrading (1 1 1 1 20 1 1 20 1 1 1 1) + + hex (4 5 7 6 12 13 15 14) + (75 15 1) + simpleGrading (1.0 1.0 1.0) + + hex (6 7 9 8 14 15 17 16) + (75 15 1) + simpleGrading (1.0 1.0 1.0) +); + +edges +( +); + +patches +( + empty axis + ( + (0 1 1 0) + ) + + patch inlet + ( + (0 0 10 2) + ) + + wall wall + ( + (2 10 12 4) + (4 12 14 6) + (6 14 16 8) + ) + + patch atmosphere + ( + (8 16 17 9) + (7 9 17 15) + (5 7 15 13) + (3 5 13 11) + (1 3 11 1) + ) + + wedge front + ( + (0 1 11 10) + (10 11 13 12) + (12 13 15 14) + (14 15 17 16) + ) + + wedge back + ( + (0 2 3 1) + (2 4 5 3) + (4 6 7 5) + (6 8 9 7) + ) +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/tutorials/interFoam/nozzleFlow2D/constant/polyMesh/boundary b/tutorials/interFoam/nozzleFlow2D/constant/polyMesh/boundary new file mode 100644 index 00000000000..b3394ff8e88 --- /dev/null +++ b/tutorials/interFoam/nozzleFlow2D/constant/polyMesh/boundary @@ -0,0 +1,68 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class polyBoundaryMesh; + object boundary; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +6 +( +axis +{ + type empty; + physicalType empty; + nFaces 0; + startFace 41031; +} + +inlet +{ + type patch; + physicalType inlet; + nFaces 30; + startFace 41031; +} + +wall +{ + type wall; + physicalType wall; + nFaces 70; + startFace 41061; +} + +atmosphere +{ + type patch; + physicalType atmosphere; + nFaces 175; + startFace 41131; +} + +front +{ + type wedge; + physicalType wedge; + nFaces 20603; + startFace 41306; +} + +back +{ + type wedge; + physicalType wedge; + nFaces 20603; + startFace 61909; +} +) + +// ************************************************************************* // diff --git a/tutorials/interFoam/nozzleFlow2D/constant/polyMesh/boundary.org b/tutorials/interFoam/nozzleFlow2D/constant/polyMesh/boundary.org new file mode 100644 index 00000000000..b3394ff8e88 --- /dev/null +++ b/tutorials/interFoam/nozzleFlow2D/constant/polyMesh/boundary.org @@ -0,0 +1,68 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class polyBoundaryMesh; + object boundary; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +6 +( +axis +{ + type empty; + physicalType empty; + nFaces 0; + startFace 41031; +} + +inlet +{ + type patch; + physicalType inlet; + nFaces 30; + startFace 41031; +} + +wall +{ + type wall; + physicalType wall; + nFaces 70; + startFace 41061; +} + +atmosphere +{ + type patch; + physicalType atmosphere; + nFaces 175; + startFace 41131; +} + +front +{ + type wedge; + physicalType wedge; + nFaces 20603; + startFace 41306; +} + +back +{ + type wedge; + physicalType wedge; + nFaces 20603; + startFace 61909; +} +) + +// ************************************************************************* // diff --git a/tutorials/interFoam/nozzleFlow2D/constant/polyMesh/sets/c0 b/tutorials/interFoam/nozzleFlow2D/constant/polyMesh/sets/c0 new file mode 100644 index 00000000000..e2320b01cff --- /dev/null +++ b/tutorials/interFoam/nozzleFlow2D/constant/polyMesh/sets/c0 @@ -0,0 +1,7092 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class cellSet; + location "constant/polyMesh/sets"; + object c0; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + +7069 +( +10832 +0 +10833 +1 +10834 +2 +10835 +3 +10836 +4 +10837 +5 +10838 +6 +10839 +7 +10840 +8 +10841 +9 +10842 +10 +10843 +11 +10844 +12 +10845 +13 +10846 +14 +10847 +15 +10848 +16 +10849 +17 +10850 +18 +10851 +19 +10852 +20 +10853 +21 +10854 +22 +10855 +23 +10856 +24 +10857 +25 +10858 +26 +10859 +27 +10860 +28 +10861 +29 +10862 +30 +10863 +31 +10864 +32 +10865 +33 +10866 +34 +10867 +35 +10868 +36 +10869 +37 +10870 +38 +10871 +39 +10872 +40 +10873 +41 +10874 +42 +10875 +43 +10876 +44 +10877 +45 +10878 +46 +10879 +47 +10880 +48 +10881 +49 +10882 +50 +10883 +51 +10884 +52 +10885 +53 +10886 +54 +10887 +55 +10888 +56 +10889 +57 +10890 +58 +10891 +59 +10892 +60 +10893 +61 +10894 +62 +10895 +63 +10896 +64 +10897 +65 +10898 +66 +10899 +67 +10900 +68 +10901 +69 +10902 +70 +10903 +71 +10904 +72 +10905 +73 +10906 +74 +10907 +75 +10908 +76 +10909 +77 +10910 +78 +10911 +79 +10912 +80 +10913 +81 +10914 +82 +10915 +83 +10916 +84 +10917 +85 +10918 +86 +10919 +87 +10920 +88 +10921 +89 +10922 +90 +10923 +91 +10924 +92 +10925 +93 +10926 +94 +10927 +95 +10928 +96 +10929 +97 +10930 +98 +10931 +99 +10932 +100 +10933 +101 +10934 +102 +10935 +103 +10936 +104 +10937 +105 +10938 +106 +10939 +107 +10940 +108 +10941 +109 +10942 +110 +10943 +111 +10944 +112 +10945 +113 +10946 +114 +10947 +115 +10948 +116 +10949 +117 +10950 +118 +10951 +119 +10952 +120 +10953 +121 +10954 +122 +10955 +123 +10956 +124 +10957 +125 +10958 +126 +10959 +127 +10960 +128 +10961 +129 +10962 +130 +10963 +131 +10964 +132 +10965 +133 +10966 +134 +10967 +135 +10968 +136 +10969 +137 +10970 +138 +10971 +139 +10972 +140 +10973 +141 +10974 +142 +10975 +143 +10976 +144 +10977 +145 +10978 +146 +10979 +147 +10980 +148 +10981 +149 +10982 +150 +10983 +151 +10984 +152 +10985 +153 +10986 +154 +10987 +155 +10988 +156 +10989 +157 +10990 +158 +10991 +159 +10992 +160 +10993 +161 +10994 +162 +10995 +163 +10996 +164 +10997 +165 +10998 +166 +10999 +167 +11000 +168 +11001 +169 +11002 +170 +11003 +171 +11004 +172 +11005 +173 +11006 +174 +11007 +175 +11008 +176 +11009 +177 +11010 +178 +11011 +179 +11012 +180 +11013 +181 +11014 +182 +11015 +183 +11016 +184 +11017 +185 +11018 +186 +11019 +187 +11020 +188 +11021 +189 +11022 +190 +11023 +191 +11024 +192 +11025 +193 +11026 +194 +11027 +195 +11028 +196 +11029 +197 +11030 +198 +11031 +199 +11032 +200 +11033 +201 +11034 +202 +11035 +203 +11036 +204 +11037 +205 +11038 +206 +11039 +207 +11040 +208 +11041 +209 +11042 +210 +11043 +211 +11044 +212 +11045 +213 +11046 +214 +11047 +215 +11048 +216 +11049 +217 +11050 +218 +11051 +219 +11052 +220 +11053 +221 +11054 +222 +11055 +223 +11056 +224 +11057 +225 +11058 +226 +11059 +227 +11060 +228 +11061 +229 +11062 +230 +11063 +231 +11064 +232 +11065 +233 +11066 +234 +11067 +235 +11068 +236 +11069 +237 +11070 +238 +11071 +239 +11072 +240 +11073 +241 +11074 +242 +11075 +243 +11076 +244 +11077 +245 +11078 +246 +11079 +247 +11080 +248 +11081 +249 +11082 +250 +11083 +251 +11084 +252 +11085 +253 +11086 +254 +11087 +255 +11088 +256 +11089 +257 +11090 +258 +11091 +259 +11092 +260 +11093 +261 +11094 +262 +11095 +263 +11096 +264 +11097 +265 +11098 +266 +11099 +267 +11100 +268 +11101 +269 +11102 +270 +11103 +271 +11104 +272 +11105 +273 +11106 +274 +11107 +275 +11108 +276 +11109 +277 +11110 +278 +11111 +279 +11112 +280 +11113 +281 +11114 +282 +11115 +283 +11116 +284 +11117 +285 +11118 +286 +11119 +287 +11120 +288 +11121 +289 +11122 +290 +11123 +291 +11124 +292 +11125 +293 +11126 +294 +11127 +295 +11128 +296 +11129 +297 +11130 +298 +11131 +299 +11132 +300 +11133 +301 +11134 +302 +11135 +303 +11136 +304 +11137 +305 +11138 +306 +11139 +307 +11140 +308 +11141 +309 +11142 +310 +11143 +311 +11144 +312 +11145 +313 +11146 +314 +11147 +315 +11148 +316 +11149 +317 +11150 +318 +11151 +319 +11152 +320 +11153 +321 +11154 +322 +11155 +323 +11156 +324 +11157 +325 +11158 +326 +11159 +327 +11160 +328 +11161 +329 +11162 +330 +11163 +331 +11164 +332 +11165 +333 +11166 +334 +11167 +335 +11168 +336 +11169 +337 +11170 +338 +11171 +339 +11172 +340 +11173 +341 +11174 +342 +11175 +343 +11176 +344 +11177 +345 +11178 +346 +11179 +347 +11180 +348 +11181 +349 +11182 +350 +11183 +351 +11184 +352 +11185 +353 +11186 +354 +11187 +355 +11188 +356 +11189 +357 +11190 +358 +11191 +359 +11192 +360 +11193 +361 +11194 +362 +11195 +363 +11196 +364 +11197 +365 +11198 +366 +11199 +367 +11200 +368 +11201 +369 +11202 +370 +11203 +371 +11204 +372 +11205 +373 +11206 +374 +11207 +375 +11208 +376 +11209 +377 +11210 +378 +11211 +379 +11212 +380 +11213 +381 +11214 +382 +11215 +383 +11216 +384 +11217 +385 +11218 +386 +11219 +387 +11220 +388 +11221 +389 +11222 +390 +11223 +391 +11224 +392 +11225 +393 +11226 +394 +11227 +395 +11228 +396 +11229 +397 +11230 +398 +11231 +399 +11232 +400 +11233 +401 +11234 +402 +11235 +403 +11236 +404 +11237 +405 +11238 +406 +11239 +407 +11240 +408 +11241 +409 +11242 +410 +11243 +411 +11244 +412 +11245 +413 +11246 +414 +11247 +415 +11248 +416 +11249 +417 +11250 +418 +11251 +419 +11252 +420 +11253 +421 +11254 +422 +11255 +423 +11256 +424 +11257 +425 +11258 +426 +11259 +427 +11260 +428 +11261 +429 +11262 +430 +11263 +431 +11264 +432 +11265 +433 +11266 +434 +11267 +435 +11268 +436 +11269 +437 +11270 +438 +11271 +439 +11272 +440 +11273 +441 +11274 +442 +11275 +443 +11276 +444 +11277 +445 +11278 +446 +11279 +447 +11280 +448 +11281 +449 +11282 +450 +11283 +451 +11284 +452 +11285 +453 +11286 +454 +11287 +455 +11288 +456 +11289 +457 +11290 +458 +11291 +459 +11292 +460 +11293 +461 +11294 +462 +11295 +463 +11296 +464 +11297 +465 +11298 +466 +11299 +467 +11300 +468 +11301 +469 +11302 +470 +11303 +471 +11304 +472 +11305 +473 +11306 +474 +11307 +475 +11308 +476 +11309 +477 +11310 +478 +11311 +479 +11312 +480 +11313 +481 +11314 +482 +11315 +483 +11316 +484 +11317 +485 +11318 +486 +11319 +487 +11320 +488 +11321 +489 +11322 +490 +11323 +491 +11324 +492 +11325 +493 +11326 +494 +11327 +495 +11328 +496 +11329 +497 +11330 +498 +11331 +499 +11332 +500 +11333 +501 +11334 +502 +11335 +503 +11336 +504 +11337 +505 +11338 +506 +11339 +507 +11340 +508 +11341 +509 +11342 +510 +11343 +511 +11344 +512 +11345 +513 +11346 +514 +11347 +515 +11348 +516 +11349 +517 +11350 +518 +11351 +519 +11352 +520 +11353 +521 +11354 +522 +11355 +523 +11356 +524 +11357 +525 +11358 +526 +11359 +527 +11360 +528 +11361 +529 +11362 +530 +11363 +531 +11364 +532 +11365 +533 +11366 +534 +11367 +535 +11368 +536 +11369 +537 +11370 +538 +11371 +539 +11372 +540 +11373 +541 +11374 +542 +11375 +543 +11376 +544 +11377 +545 +11378 +546 +11379 +547 +11380 +548 +11381 +549 +11382 +550 +11383 +551 +11384 +552 +11385 +553 +11386 +554 +11387 +555 +11388 +556 +11389 +557 +11390 +558 +11391 +559 +11392 +560 +11393 +561 +11394 +562 +11395 +563 +11396 +564 +11397 +565 +11398 +566 +11399 +567 +11400 +568 +11401 +569 +11402 +570 +11403 +571 +11404 +572 +11405 +573 +11406 +574 +11407 +575 +11408 +576 +11409 +577 +11410 +578 +11411 +579 +11412 +580 +11413 +581 +11414 +582 +11415 +583 +11416 +584 +11417 +585 +11418 +586 +11419 +587 +11420 +588 +11421 +589 +11422 +590 +11423 +591 +11424 +592 +11425 +593 +11426 +594 +11427 +595 +11428 +596 +11429 +597 +11430 +598 +11431 +599 +11432 +600 +11433 +601 +11434 +602 +11435 +603 +11436 +604 +11437 +605 +11438 +606 +11439 +607 +11440 +608 +11441 +609 +11442 +610 +11443 +611 +11444 +612 +11445 +613 +11446 +614 +11447 +615 +11448 +616 +11449 +617 +11450 +618 +11451 +619 +11452 +620 +11453 +621 +11454 +622 +11455 +623 +11456 +624 +11457 +625 +11458 +626 +11459 +627 +11460 +628 +11461 +629 +11462 +630 +11463 +631 +11464 +632 +11465 +633 +11466 +634 +11467 +635 +11468 +636 +11469 +637 +11470 +638 +11471 +639 +11472 +640 +11473 +641 +11474 +642 +11475 +643 +11476 +644 +11477 +645 +11478 +646 +11479 +647 +11480 +648 +11481 +649 +11482 +650 +11483 +651 +11484 +652 +11485 +653 +11486 +654 +11487 +655 +11488 +656 +11489 +657 +11490 +658 +11491 +659 +11492 +660 +11493 +661 +11494 +662 +11495 +663 +11496 +664 +11497 +665 +11498 +666 +11499 +667 +11500 +668 +11501 +669 +11502 +670 +11503 +671 +11504 +672 +11505 +673 +11506 +674 +11507 +675 +11508 +676 +11509 +677 +11510 +678 +11511 +679 +11512 +680 +11513 +681 +11514 +682 +11515 +683 +11516 +684 +11517 +685 +11518 +686 +11519 +687 +11520 +688 +11521 +689 +11522 +690 +11523 +691 +11524 +692 +11525 +693 +11526 +694 +11527 +695 +11528 +696 +11529 +697 +11530 +698 +11531 +699 +11532 +700 +11533 +701 +11534 +702 +11535 +703 +11536 +704 +11537 +705 +11538 +706 +11539 +707 +11540 +708 +11541 +709 +11542 +710 +11543 +711 +11544 +712 +11545 +713 +11546 +714 +11547 +715 +11548 +716 +11549 +717 +11550 +718 +11551 +719 +11552 +720 +11553 +721 +11554 +722 +11555 +723 +11556 +724 +11557 +725 +11558 +726 +11559 +727 +11560 +728 +11561 +729 +11562 +730 +11563 +731 +11564 +732 +11565 +733 +11566 +734 +11567 +735 +11568 +736 +11569 +737 +11570 +738 +11571 +739 +11572 +740 +11573 +741 +11574 +742 +11575 +743 +11576 +744 +11577 +745 +11578 +746 +11579 +747 +11580 +748 +11581 +749 +11582 +750 +11583 +751 +11584 +752 +11585 +753 +11586 +754 +11587 +755 +11588 +756 +11589 +757 +11590 +758 +11591 +759 +11592 +760 +11593 +761 +11594 +762 +11595 +763 +11596 +764 +11597 +765 +11598 +766 +11599 +767 +11600 +768 +11601 +769 +11602 +770 +11603 +771 +11604 +772 +11605 +773 +11606 +774 +11607 +775 +11608 +776 +11609 +777 +11610 +778 +11611 +779 +11612 +780 +11613 +781 +11614 +782 +11615 +783 +11616 +784 +11617 +785 +11618 +786 +11619 +787 +11620 +788 +11621 +789 +11622 +790 +11623 +791 +11624 +792 +11625 +793 +11626 +794 +11627 +795 +11628 +796 +11629 +797 +11630 +798 +11631 +799 +11632 +800 +11633 +801 +11634 +802 +11635 +803 +11636 +804 +11637 +805 +11638 +806 +11639 +807 +11640 +808 +11641 +809 +11642 +810 +11643 +811 +11644 +812 +11645 +813 +11646 +814 +11647 +815 +11648 +816 +11649 +817 +11650 +818 +11651 +819 +11652 +820 +11653 +821 +11654 +822 +11655 +823 +11656 +824 +11657 +825 +11658 +826 +11659 +827 +11660 +828 +11661 +829 +11662 +830 +11663 +831 +11664 +832 +11665 +833 +11666 +834 +11667 +835 +11668 +836 +11669 +837 +11670 +838 +11671 +839 +11672 +840 +11673 +841 +11674 +842 +11675 +843 +11676 +844 +11677 +845 +11678 +846 +11679 +847 +11680 +848 +11681 +849 +11682 +850 +11683 +851 +11684 +852 +11685 +853 +11686 +854 +11687 +855 +11688 +856 +11689 +857 +11690 +858 +11691 +859 +11692 +860 +11693 +861 +11694 +862 +11695 +863 +11696 +864 +11697 +865 +11698 +866 +11699 +867 +11700 +868 +11701 +869 +11702 +870 +11703 +871 +11704 +872 +11705 +873 +11706 +874 +11707 +875 +11708 +876 +11709 +877 +11710 +878 +11711 +879 +11712 +880 +11713 +881 +11714 +882 +11715 +883 +11716 +884 +11717 +885 +11718 +886 +11719 +887 +11720 +888 +11721 +889 +11722 +890 +11723 +891 +11724 +892 +11725 +893 +11726 +894 +11727 +895 +11728 +896 +11729 +897 +11730 +898 +11731 +899 +11732 +900 +11733 +901 +11734 +902 +903 +904 +905 +906 +907 +908 +909 +11742 +910 +11743 +911 +11744 +912 +11745 +913 +11746 +914 +11747 +915 +11748 +916 +11749 +917 +11750 +918 +11751 +919 +11752 +920 +11753 +921 +11754 +922 +11755 +923 +11756 +924 +11757 +925 +11758 +926 +11759 +927 +11760 +928 +11761 +929 +11762 +930 +11763 +931 +11764 +932 +11765 +933 +11766 +934 +11767 +935 +11768 +936 +11769 +937 +11770 +938 +11771 +939 +11772 +940 +11773 +941 +11774 +942 +11775 +943 +11776 +944 +11777 +945 +11778 +946 +11779 +947 +11780 +948 +11781 +949 +11782 +950 +11783 +951 +11784 +952 +11785 +953 +11786 +954 +11787 +955 +11788 +956 +11789 +957 +11790 +958 +11791 +959 +11792 +960 +11793 +961 +11794 +962 +11795 +963 +11796 +964 +11797 +965 +11798 +966 +11799 +967 +11800 +968 +11801 +969 +11802 +970 +11803 +971 +11804 +972 +973 +974 +975 +976 +977 +978 +979 +980 +981 +982 +983 +984 +11817 +985 +11818 +986 +11819 +987 +11820 +988 +11821 +989 +11822 +990 +11823 +991 +11824 +992 +11825 +993 +11826 +994 +11827 +995 +11828 +996 +11829 +997 +11830 +998 +11831 +999 +11832 +1000 +11833 +1001 +11834 +1002 +11835 +1003 +11836 +1004 +11837 +1005 +11838 +1006 +11839 +1007 +11840 +1008 +11841 +1009 +11842 +1010 +11843 +1011 +11844 +1012 +11845 +1013 +11846 +1014 +11847 +1015 +11848 +1016 +11849 +1017 +11850 +1018 +11851 +1019 +11852 +1020 +11853 +1021 +11854 +1022 +11855 +1023 +11856 +1024 +11857 +1025 +11858 +1026 +11859 +1027 +11860 +1028 +11861 +1029 +11862 +1030 +11863 +1031 +11864 +1032 +11865 +1033 +11866 +1034 +11867 +1035 +11868 +1036 +11869 +1037 +11870 +1038 +11871 +1039 +11872 +1040 +11873 +1041 +11874 +1042 +1043 +1044 +1045 +1046 +1047 +1048 +1049 +1050 +1051 +1052 +1053 +1054 +1055 +1056 +1057 +1058 +1059 +11892 +1060 +11893 +1061 +11894 +1062 +11895 +1063 +11896 +1064 +11897 +1065 +11898 +1066 +11899 +1067 +11900 +1068 +11901 +1069 +11902 +1070 +11903 +1071 +11904 +1072 +11905 +1073 +11906 +1074 +11907 +1075 +11908 +1076 +11909 +1077 +11910 +1078 +11911 +1079 +11912 +1080 +11913 +1081 +11914 +1082 +11915 +1083 +11916 +1084 +11917 +1085 +11918 +1086 +11919 +1087 +11920 +1088 +11921 +1089 +11922 +1090 +11923 +1091 +11924 +1092 +11925 +1093 +11926 +1094 +11927 +1095 +11928 +1096 +11929 +1097 +11930 +1098 +11931 +1099 +11932 +1100 +11933 +1101 +11934 +1102 +11935 +1103 +11936 +1104 +11937 +1105 +11938 +1106 +11939 +1107 +11940 +1108 +11941 +1109 +11942 +1110 +11943 +1111 +11944 +1112 +11945 +1113 +1114 +1115 +1116 +1117 +1118 +1119 +1120 +1121 +1122 +1123 +1124 +1125 +1126 +1127 +1128 +1129 +1130 +1131 +1132 +1133 +1134 +11967 +1135 +11968 +1136 +11969 +1137 +11970 +1138 +11971 +1139 +11972 +1140 +11973 +1141 +11974 +1142 +11975 +1143 +11976 +1144 +11977 +1145 +11978 +1146 +11979 +1147 +11980 +1148 +11981 +1149 +11982 +1150 +11983 +1151 +11984 +1152 +11985 +1153 +11986 +1154 +11987 +1155 +11988 +1156 +11989 +1157 +11990 +1158 +11991 +1159 +11992 +1160 +11993 +1161 +11994 +1162 +11995 +1163 +11996 +1164 +11997 +1165 +11998 +1166 +11999 +1167 +12000 +1168 +12001 +1169 +12002 +1170 +12003 +1171 +12004 +1172 +12005 +1173 +12006 +1174 +12007 +1175 +12008 +1176 +12009 +1177 +12010 +1178 +12011 +1179 +12012 +1180 +12013 +1181 +12014 +1182 +12015 +1183 +12016 +1184 +1185 +1186 +1187 +1188 +1189 +1190 +1191 +1192 +1193 +1194 +1195 +1196 +1197 +1198 +1199 +1200 +1201 +1202 +1203 +1204 +1205 +1206 +1207 +1208 +1209 +12042 +1210 +12043 +1211 +12044 +1212 +12045 +1213 +12046 +1214 +12047 +1215 +12048 +1216 +12049 +1217 +12050 +1218 +12051 +1219 +12052 +1220 +12053 +1221 +12054 +1222 +12055 +1223 +12056 +1224 +12057 +1225 +12058 +1226 +12059 +1227 +12060 +1228 +12061 +1229 +12062 +1230 +12063 +1231 +12064 +1232 +12065 +1233 +12066 +1234 +12067 +1235 +12068 +1236 +12069 +1237 +12070 +1238 +12071 +1239 +12072 +1240 +12073 +1241 +12074 +1242 +12075 +1243 +12076 +1244 +12077 +1245 +12078 +1246 +12079 +1247 +12080 +1248 +12081 +1249 +12082 +1250 +12083 +1251 +12084 +1252 +12085 +1253 +12086 +1254 +12087 +1255 +1256 +1257 +1258 +1259 +1260 +1261 +1262 +1263 +1264 +1265 +1266 +1267 +1268 +1269 +1270 +1271 +1272 +1273 +1274 +1275 +1276 +1277 +1278 +1279 +1280 +1281 +1282 +1283 +1284 +12117 +1285 +12118 +1286 +12119 +1287 +12120 +1288 +12121 +1289 +12122 +1290 +12123 +1291 +12124 +1292 +12125 +1293 +12126 +1294 +12127 +1295 +12128 +1296 +12129 +1297 +12130 +1298 +12131 +1299 +12132 +1300 +12133 +1301 +12134 +1302 +12135 +1303 +12136 +1304 +12137 +1305 +12138 +1306 +12139 +1307 +12140 +1308 +12141 +1309 +12142 +1310 +12143 +1311 +12144 +1312 +12145 +1313 +12146 +1314 +12147 +1315 +12148 +1316 +12149 +1317 +12150 +1318 +12151 +1319 +12152 +1320 +12153 +1321 +12154 +1322 +12155 +1323 +12156 +1324 +12157 +1325 +12158 +1326 +1327 +1328 +1329 +1330 +1331 +1332 +1333 +1334 +1335 +1336 +1337 +1338 +1339 +1340 +1341 +1342 +1343 +1344 +1345 +1346 +1347 +1348 +1349 +1350 +1351 +1352 +1353 +1354 +1355 +1356 +1357 +1358 +1359 +12192 +1360 +12193 +1361 +12194 +1362 +12195 +1363 +12196 +1364 +12197 +1365 +12198 +1366 +12199 +1367 +12200 +1368 +12201 +1369 +12202 +1370 +12203 +1371 +12204 +1372 +12205 +1373 +12206 +1374 +12207 +1375 +12208 +1376 +12209 +1377 +12210 +1378 +12211 +1379 +12212 +1380 +12213 +1381 +12214 +1382 +12215 +1383 +12216 +1384 +12217 +1385 +12218 +1386 +12219 +1387 +12220 +1388 +12221 +1389 +12222 +1390 +12223 +1391 +12224 +1392 +12225 +1393 +12226 +1394 +12227 +1395 +12228 +1396 +12229 +1397 +12230 +1398 +1399 +1400 +1401 +1402 +1403 +1404 +1405 +1406 +1407 +1408 +1409 +1410 +1411 +1412 +1413 +1414 +1415 +1416 +1417 +1418 +1419 +1420 +1421 +1422 +1423 +1424 +1425 +1426 +1427 +1428 +1429 +1430 +1431 +1432 +1433 +1434 +12267 +1435 +12268 +1436 +12269 +1437 +12270 +1438 +12271 +1439 +12272 +1440 +12273 +1441 +12274 +1442 +12275 +1443 +12276 +1444 +12277 +1445 +12278 +1446 +12279 +1447 +12280 +1448 +12281 +1449 +12282 +1450 +12283 +1451 +12284 +1452 +12285 +1453 +12286 +1454 +12287 +1455 +12288 +1456 +12289 +1457 +12290 +1458 +12291 +1459 +12292 +1460 +12293 +1461 +12294 +1462 +12295 +1463 +12296 +1464 +12297 +1465 +12298 +1466 +12299 +1467 +12300 +1468 +12301 +1469 +12302 +1470 +1471 +1472 +1473 +1474 +1475 +1476 +1477 +1478 +1479 +1480 +1481 +1482 +1483 +1484 +1485 +1486 +1487 +1488 +1489 +1490 +1491 +1492 +1493 +1494 +1495 +1496 +1497 +1498 +1499 +1500 +1501 +1502 +1503 +1504 +1505 +1506 +1507 +1508 +1509 +12342 +1510 +12343 +1511 +12344 +1512 +12345 +1513 +12346 +1514 +12347 +1515 +12348 +1516 +12349 +1517 +12350 +1518 +12351 +1519 +12352 +1520 +12353 +1521 +12354 +1522 +12355 +1523 +12356 +1524 +12357 +1525 +12358 +1526 +12359 +1527 +12360 +1528 +12361 +1529 +12362 +1530 +12363 +1531 +12364 +1532 +12365 +1533 +12366 +1534 +12367 +1535 +12368 +1536 +12369 +1537 +12370 +1538 +12371 +1539 +12372 +1540 +12373 +1541 +12374 +1542 +1543 +1544 +1545 +1546 +1547 +1548 +1549 +1550 +1551 +1552 +1553 +1554 +1555 +1556 +1557 +1558 +1559 +1560 +1561 +1562 +1563 +1564 +1565 +1566 +1567 +1568 +1569 +1570 +1571 +1572 +1573 +1574 +1575 +1576 +1577 +1578 +1579 +1580 +1581 +1582 +1583 +1584 +12417 +1585 +12418 +1586 +12419 +1587 +12420 +1588 +12421 +1589 +12422 +1590 +12423 +1591 +12424 +1592 +12425 +1593 +12426 +1594 +12427 +1595 +12428 +1596 +12429 +1597 +12430 +1598 +12431 +1599 +12432 +1600 +12433 +1601 +12434 +1602 +12435 +1603 +12436 +1604 +12437 +1605 +12438 +1606 +12439 +1607 +12440 +1608 +12441 +1609 +12442 +1610 +12443 +1611 +12444 +1612 +12445 +1613 +12446 +1614 +1615 +1616 +1617 +1618 +1619 +1620 +1621 +1622 +1623 +1624 +1625 +1626 +1627 +1628 +1629 +1630 +1631 +1632 +1633 +1634 +1635 +1636 +1637 +1638 +1639 +1640 +1641 +1642 +1643 +1644 +1645 +1646 +1647 +1648 +1649 +1650 +1651 +1652 +1653 +1654 +1655 +1656 +1657 +1658 +1659 +12492 +1660 +12493 +1661 +12494 +1662 +12495 +1663 +12496 +1664 +12497 +1665 +12498 +1666 +12499 +1667 +12500 +1668 +12501 +1669 +12502 +1670 +12503 +1671 +12504 +1672 +12505 +1673 +12506 +1674 +12507 +1675 +12508 +1676 +12509 +1677 +12510 +1678 +12511 +1679 +12512 +1680 +12513 +1681 +12514 +1682 +12515 +1683 +12516 +1684 +12517 +1685 +1686 +1687 +1688 +1689 +1690 +1691 +1692 +1693 +1694 +1695 +1696 +1697 +1698 +1699 +1700 +1701 +1702 +1703 +1704 +1705 +1706 +1707 +1708 +1709 +1710 +1711 +1712 +1713 +1714 +1715 +1716 +1717 +1718 +1719 +1720 +1721 +1722 +1723 +1724 +1725 +1726 +1727 +1728 +1729 +1730 +1731 +1732 +1733 +1734 +12567 +1735 +12568 +1736 +12569 +1737 +12570 +1738 +12571 +1739 +12572 +1740 +12573 +1741 +12574 +1742 +12575 +1743 +12576 +1744 +12577 +1745 +12578 +1746 +12579 +1747 +12580 +1748 +12581 +1749 +12582 +1750 +12583 +1751 +12584 +1752 +12585 +1753 +12586 +1754 +12587 +1755 +12588 +1756 +12589 +1757 +1758 +1759 +1760 +1761 +1762 +1763 +1764 +1765 +1766 +1767 +1768 +1769 +1770 +1771 +1772 +1773 +1774 +1775 +1776 +1777 +1778 +1779 +1780 +1781 +1782 +1783 +1784 +1785 +1786 +1787 +1788 +1789 +1790 +1791 +1792 +1793 +1794 +1795 +1796 +1797 +1798 +1799 +1800 +1801 +1802 +1803 +1804 +1805 +1806 +1807 +1808 +1809 +12642 +1810 +12643 +1811 +12644 +1812 +12645 +1813 +12646 +1814 +12647 +1815 +12648 +1816 +12649 +1817 +12650 +1818 +12651 +1819 +12652 +1820 +12653 +1821 +12654 +1822 +12655 +1823 +12656 +1824 +12657 +1825 +12658 +1826 +12659 +1827 +12660 +1828 +1829 +1830 +1831 +1832 +1833 +1834 +1835 +1836 +1837 +1838 +1839 +1840 +1841 +1842 +1843 +1844 +1845 +1846 +1847 +1848 +1849 +1850 +1851 +1852 +1853 +1854 +1855 +1856 +1857 +1858 +1859 +1860 +1861 +1862 +1863 +1864 +1865 +1866 +1867 +1868 +1869 +1870 +1871 +1872 +1873 +1874 +1875 +1876 +1877 +1878 +1879 +1880 +1881 +1882 +1883 +1884 +12717 +1885 +12718 +1886 +12719 +1887 +12720 +1888 +12721 +1889 +12722 +1890 +12723 +1891 +12724 +1892 +12725 +1893 +12726 +1894 +12727 +1895 +12728 +1896 +12729 +1897 +12730 +1898 +12731 +1899 +1900 +1901 +1902 +1903 +1904 +1905 +1906 +1907 +1908 +1909 +1910 +1911 +1912 +1913 +1914 +1915 +1916 +1917 +1918 +1919 +1920 +1921 +1922 +1923 +1924 +1925 +1926 +1927 +1928 +1929 +1930 +1931 +1932 +1933 +1934 +1935 +1936 +1937 +1938 +1939 +1940 +1941 +1942 +1943 +1944 +1945 +1946 +1947 +1948 +1949 +1950 +1951 +1952 +1953 +1954 +1955 +1956 +1957 +1958 +1959 +12792 +1960 +12793 +1961 +12794 +1962 +12795 +1963 +12796 +1964 +12797 +1965 +12798 +1966 +12799 +1967 +12800 +1968 +12801 +1969 +1970 +1971 +1972 +1973 +1974 +1975 +1976 +1977 +1978 +1979 +1980 +1981 +1982 +1983 +1984 +1985 +1986 +1987 +1988 +1989 +1990 +1991 +1992 +1993 +1994 +1995 +1996 +1997 +1998 +1999 +2000 +2001 +2002 +2003 +2004 +2005 +2006 +2007 +2008 +2009 +2010 +2011 +2012 +2013 +2014 +2015 +2016 +2017 +2018 +2019 +2020 +2021 +2022 +2023 +2024 +2025 +2026 +2027 +2028 +2029 +2030 +2031 +2032 +2033 +2034 +12867 +2035 +12868 +2036 +12869 +2037 +12870 +2038 +12871 +2039 +2040 +2041 +2042 +2043 +2044 +2045 +2046 +2047 +2048 +2049 +2050 +2051 +2052 +2053 +2054 +2055 +2056 +2057 +2058 +2059 +2060 +2061 +2062 +2063 +2064 +2065 +2066 +2067 +2068 +2069 +2070 +2071 +2072 +2073 +2074 +2075 +2076 +2077 +2078 +2079 +2080 +2081 +2082 +2083 +2084 +2085 +2086 +2087 +2088 +2089 +2090 +2091 +2092 +2093 +2094 +2095 +2096 +2097 +2098 +2099 +2100 +2101 +2102 +2103 +2104 +2105 +2106 +2107 +2108 +2109 +2110 +2111 +2112 +2113 +2114 +2115 +2116 +2117 +2118 +2119 +2120 +2121 +2122 +2123 +2124 +2125 +2126 +2127 +2128 +2129 +2130 +2131 +2132 +2133 +2134 +2135 +2136 +2137 +2138 +2139 +2140 +2141 +2142 +2143 +2144 +2145 +2146 +2147 +2148 +2149 +2150 +2151 +2152 +2153 +2154 +2155 +2156 +2157 +2158 +2159 +2160 +2161 +2162 +2163 +2164 +2165 +2166 +2167 +2168 +2169 +2170 +2171 +2172 +2173 +2174 +2175 +2176 +2177 +2178 +2179 +2180 +2181 +2182 +2183 +2184 +2185 +2186 +2187 +2188 +2189 +2190 +2191 +2192 +2193 +2194 +2195 +2196 +2197 +2198 +2199 +2200 +2201 +2202 +2203 +2204 +2205 +2206 +2207 +2208 +2209 +2210 +2211 +2212 +2213 +2214 +2215 +2216 +2217 +2218 +2219 +2220 +2221 +2222 +2223 +2224 +2225 +2226 +2227 +2228 +2229 +2230 +2231 +2232 +2233 +2234 +2235 +2236 +2237 +2238 +2239 +2240 +2241 +2242 +2243 +2244 +2245 +2246 +2247 +2248 +2249 +2250 +2251 +2252 +2253 +2254 +2255 +2256 +2257 +2258 +2259 +2260 +2261 +2262 +2263 +2264 +2265 +2266 +2267 +2268 +2269 +2270 +2271 +2272 +2273 +2274 +2275 +2276 +2277 +2278 +2279 +2280 +2281 +2282 +2283 +2284 +2285 +2286 +2287 +2288 +2289 +2290 +2291 +2292 +2293 +2294 +2295 +2296 +2297 +2298 +2299 +2300 +2301 +2302 +2303 +2304 +2305 +2306 +2307 +2308 +2309 +2310 +2311 +2312 +2313 +2314 +2315 +2316 +2317 +2318 +2319 +2320 +2321 +2322 +2325 +2326 +2327 +2328 +2329 +2330 +2331 +2332 +2333 +2334 +2335 +2336 +2337 +2338 +2339 +2340 +2341 +2342 +2343 +2344 +2345 +2346 +2347 +2348 +2349 +2350 +2351 +2352 +2353 +2354 +2355 +2356 +2357 +2358 +2359 +2360 +2361 +2362 +2363 +2364 +2365 +2366 +2367 +2368 +2369 +2370 +2371 +2372 +2373 +2374 +2375 +2376 +2377 +2378 +2379 +2380 +2381 +2382 +2383 +2384 +2385 +2386 +2387 +2388 +2389 +2390 +2391 +2392 +2393 +2394 +2400 +2401 +2402 +2403 +2404 +2405 +2406 +2407 +2408 +2409 +2410 +2411 +2412 +2413 +2414 +2415 +2416 +2417 +2418 +2419 +2420 +2421 +2422 +2423 +2424 +2425 +2426 +2427 +2428 +2429 +2430 +2431 +2432 +2433 +2434 +2435 +2436 +2437 +2438 +2439 +2440 +2441 +2442 +2443 +2444 +2445 +2446 +2447 +2448 +2449 +2450 +2451 +2452 +2453 +2454 +2455 +2456 +2457 +2458 +2459 +2460 +2461 +2462 +2463 +2464 +2465 +2466 +2475 +2476 +2477 +2478 +2479 +2480 +2481 +2482 +2483 +2484 +2485 +2486 +2487 +2488 +2489 +2490 +2491 +2492 +2493 +2494 +2495 +2496 +2497 +2498 +2499 +2500 +2501 +2502 +2503 +2504 +2505 +2506 +2507 +2508 +2509 +2510 +2511 +2512 +2513 +2514 +2515 +2516 +2517 +2518 +2519 +2520 +2521 +2522 +2523 +2524 +2525 +2526 +2527 +2528 +2529 +2530 +2531 +2532 +2533 +2534 +2535 +2536 +2537 +2538 +2550 +2551 +2552 +2553 +2554 +2555 +2556 +2557 +2558 +2559 +2560 +2561 +2562 +2563 +2564 +2565 +2566 +2567 +2568 +2569 +2570 +2571 +2572 +2573 +2574 +2575 +2576 +2577 +2578 +2579 +2580 +2581 +2582 +2583 +2584 +2585 +2586 +2587 +2588 +2589 +2590 +2591 +2592 +2593 +2594 +2595 +2596 +2597 +2598 +2599 +2600 +2601 +2602 +2603 +2604 +2605 +2606 +2607 +2608 +2609 +2610 +2625 +2626 +2627 +2628 +2629 +2630 +2631 +2632 +2633 +2634 +2635 +2636 +2637 +2638 +2639 +2640 +2641 +2642 +2643 +2644 +2645 +2646 +2647 +2648 +2649 +2650 +2651 +2652 +2653 +2654 +2655 +2656 +2657 +2658 +2659 +2660 +2661 +2662 +2663 +2664 +2665 +2666 +2667 +2668 +2669 +2670 +2671 +2672 +2673 +2674 +2675 +2676 +2677 +2678 +2679 +2680 +2681 +2682 +2683 +2700 +2701 +2702 +2703 +2704 +2705 +2706 +2707 +2708 +2709 +2710 +2711 +2712 +2713 +2714 +2715 +2716 +2717 +2718 +2719 +2720 +2721 +2722 +2723 +2724 +2725 +2726 +2727 +2728 +2729 +2730 +2731 +2732 +2733 +2734 +2735 +2736 +2737 +2738 +2739 +2740 +2741 +2742 +2743 +2744 +2745 +2746 +2747 +2748 +2749 +2750 +2751 +2752 +2753 +2754 +2755 +2775 +2776 +2777 +2778 +2779 +2780 +2781 +2782 +2783 +2784 +2785 +2786 +2787 +2788 +2789 +2790 +2791 +2792 +2793 +2794 +2795 +2796 +2797 +2798 +2799 +2800 +2801 +2802 +2803 +2804 +2805 +2806 +2807 +2808 +2809 +2810 +2811 +2812 +2813 +2814 +2815 +2816 +2817 +2818 +2819 +2820 +2821 +2822 +2823 +2824 +2825 +2826 +2827 +2828 +2850 +2851 +2852 +2853 +2854 +2855 +2856 +2857 +2858 +2859 +2860 +2861 +2862 +2863 +2864 +2865 +2866 +2867 +2868 +2869 +2870 +2871 +2872 +2873 +2874 +2875 +2876 +2877 +2878 +2879 +2880 +2881 +2882 +2883 +2884 +2885 +2886 +2887 +2888 +2889 +2890 +2891 +2892 +2893 +2894 +2895 +2896 +2897 +2898 +2899 +2900 +2901 +2925 +2926 +2927 +2928 +2929 +2930 +2931 +2932 +2933 +2934 +2935 +2936 +2937 +2938 +2939 +2940 +2941 +2942 +2943 +2944 +2945 +2946 +2947 +2948 +2949 +2950 +2951 +2952 +2953 +2954 +2955 +2956 +2957 +2958 +2959 +2960 +2961 +2962 +2963 +2964 +2965 +2966 +2967 +2968 +2969 +2970 +2971 +2972 +2973 +2974 +3000 +3001 +3002 +3003 +3004 +3005 +3006 +3007 +3008 +3009 +3010 +3011 +3012 +3013 +3014 +3015 +3016 +3017 +3018 +3019 +3020 +3021 +3022 +3023 +3024 +3025 +3026 +3027 +3028 +3029 +3030 +3031 +3032 +3033 +3034 +3035 +3036 +3037 +3038 +3039 +3040 +3041 +3042 +3043 +3044 +3045 +3046 +3047 +3075 +3076 +3077 +3078 +3079 +3080 +3081 +3082 +3083 +3084 +3085 +3086 +3087 +3088 +3089 +3090 +3091 +3092 +3093 +3094 +3095 +3096 +3097 +3098 +3099 +3100 +3101 +3102 +3103 +3104 +3105 +3106 +3107 +3108 +3109 +3110 +3111 +3112 +3113 +3114 +3115 +3116 +3117 +3118 +3119 +3120 +3150 +3151 +3152 +3153 +3154 +3155 +3156 +3157 +3158 +3159 +3160 +3161 +3162 +3163 +3164 +3165 +3166 +3167 +3168 +3169 +3170 +3171 +3172 +3173 +3174 +3175 +3176 +3177 +3178 +3179 +3180 +3181 +3182 +3183 +3184 +3185 +3186 +3187 +3188 +3189 +3190 +3191 +3192 +3193 +3194 +3225 +3226 +3227 +3228 +3229 +3230 +3231 +3232 +3233 +3234 +3235 +3236 +3237 +3238 +3239 +3240 +3241 +3242 +3243 +3244 +3245 +3246 +3247 +3248 +3249 +3250 +3251 +3252 +3253 +3254 +3255 +3256 +3257 +3258 +3259 +3260 +3261 +3262 +3263 +3264 +3265 +3266 +3267 +3300 +3301 +3302 +3303 +3304 +3305 +3306 +3307 +3308 +3309 +3310 +3311 +3312 +3313 +3314 +3315 +3316 +3317 +3318 +3319 +3320 +3321 +3322 +3323 +3324 +3325 +3326 +3327 +3328 +3329 +3330 +3331 +3332 +3333 +3334 +3335 +3336 +3337 +3338 +3339 +3340 +3375 +3376 +3377 +3378 +3379 +3380 +3381 +3382 +3383 +3384 +3385 +3386 +3387 +3388 +3389 +3390 +3391 +3392 +3393 +3394 +3395 +3396 +3397 +3398 +3399 +3400 +3401 +3402 +3403 +3404 +3405 +3406 +3407 +3408 +3409 +3410 +3411 +3412 +3413 +3414 +3450 +3451 +3452 +3453 +3454 +3455 +3456 +3457 +3458 +3459 +3460 +3461 +3462 +3463 +3464 +3465 +3466 +3467 +3468 +3469 +3470 +3471 +3472 +3473 +3474 +3475 +3476 +3477 +3478 +3479 +3480 +3481 +3482 +3483 +3484 +3485 +3486 +3487 +3525 +3526 +3527 +3528 +3529 +3530 +3531 +3532 +3533 +3534 +3535 +3536 +3537 +3538 +3539 +3540 +3541 +3542 +3543 +3544 +3545 +3546 +3547 +3548 +3549 +3550 +3551 +3552 +3553 +3554 +3555 +3556 +3557 +3558 +3559 +3560 +3600 +3601 +3602 +3603 +3604 +3605 +3606 +3607 +3608 +3609 +3610 +3611 +3612 +3613 +3614 +3615 +3616 +3617 +3618 +3619 +3620 +3621 +3622 +3623 +3624 +3625 +3626 +3627 +3628 +3629 +3630 +3631 +3632 +3633 +3634 +3675 +3676 +3677 +3678 +3679 +3680 +3681 +3682 +3683 +3684 +3685 +3686 +3687 +3688 +3689 +3690 +3691 +3692 +3693 +3694 +3695 +3696 +3697 +3698 +3699 +3700 +3701 +3702 +3703 +3704 +3705 +3706 +3707 +3750 +3751 +3752 +3753 +3754 +3755 +3756 +3757 +3758 +3759 +3760 +3761 +3762 +3763 +3764 +3765 +3766 +3767 +3768 +3769 +3770 +3771 +3772 +3773 +3774 +3775 +3776 +3777 +3778 +3779 +3780 +3781 +3825 +3826 +3827 +3828 +3829 +3830 +3831 +3832 +3833 +3834 +3835 +3836 +3837 +3838 +3839 +3840 +3841 +3842 +3843 +3844 +3845 +3846 +3847 +3848 +3849 +3850 +3851 +3852 +3853 +3854 +3900 +3901 +3902 +3903 +3904 +3905 +3906 +3907 +3908 +3909 +3910 +3911 +3912 +3913 +3914 +3915 +3916 +3917 +3918 +3919 +3920 +3921 +3922 +3923 +3924 +3925 +3926 +3927 +3928 +3975 +3976 +3977 +3978 +3979 +3980 +3981 +3982 +3983 +3984 +3985 +3986 +3987 +3988 +3989 +3990 +3991 +3992 +3993 +3994 +3995 +3996 +3997 +3998 +3999 +4000 +4001 +4050 +4051 +4052 +4053 +4054 +4055 +4056 +4057 +4058 +4059 +4060 +4061 +4062 +4063 +4064 +4065 +4066 +4067 +4068 +4069 +4070 +4071 +4072 +4073 +4074 +4125 +4126 +4127 +4128 +4129 +4130 +4131 +4132 +4133 +4134 +4135 +4136 +4137 +4138 +4139 +4140 +4141 +4142 +4143 +4144 +4145 +4146 +4147 +4148 +4200 +4201 +4202 +4203 +4204 +4205 +4206 +4207 +4208 +4209 +4210 +4211 +4212 +4213 +4214 +4215 +4216 +4217 +4218 +4219 +4220 +4221 +4275 +4276 +4277 +4278 +4279 +4280 +4281 +4282 +4283 +4284 +4285 +4286 +4287 +4288 +4289 +4290 +4291 +4292 +4293 +4294 +4350 +4351 +4352 +4353 +4354 +4355 +4356 +4357 +4358 +4359 +4360 +4361 +4362 +4363 +4364 +4365 +4366 +4367 +4425 +4426 +4427 +4428 +4429 +4430 +4431 +4432 +4433 +4434 +4435 +4436 +4437 +4438 +4439 +4440 +4500 +4501 +4502 +4503 +4504 +4505 +4506 +4507 +4508 +4509 +4510 +4511 +4512 +4575 +4576 +4577 +4578 +4579 +4580 +4581 +4582 +4583 +4584 +4585 +4650 +4651 +4652 +4653 +4654 +4655 +4656 +4657 +4725 +4726 +4727 +4728 +4729 +4800 +4801 +7500 +7501 +7502 +7503 +7504 +7505 +7506 +7507 +7508 +7509 +7510 +7511 +7512 +7513 +7514 +7515 +7516 +7517 +7518 +7519 +7520 +7521 +7522 +7523 +7524 +7525 +7526 +7527 +7528 +7529 +7530 +7531 +7532 +7533 +7534 +7535 +7536 +7537 +7538 +7539 +7540 +7541 +7542 +7543 +7544 +7545 +7546 +7547 +7548 +7549 +7550 +7551 +7552 +7553 +7554 +7555 +7556 +7557 +7558 +7559 +7560 +7561 +7562 +7563 +7564 +7565 +7566 +7567 +7568 +7569 +7570 +7571 +7572 +7573 +7574 +7575 +7576 +7577 +7578 +7579 +7580 +7581 +7582 +7583 +7584 +7585 +7586 +7587 +7588 +7589 +7590 +7591 +7592 +7593 +7594 +7595 +7596 +7597 +7598 +7599 +7600 +7601 +7602 +7603 +7604 +7605 +7606 +7607 +7608 +7609 +7610 +7611 +7612 +7613 +7614 +7615 +7616 +7617 +7618 +7619 +7620 +7621 +7622 +7623 +7624 +7625 +7626 +7627 +7628 +7629 +7630 +7631 +7632 +7633 +7634 +7635 +7636 +7637 +7638 +7639 +7640 +7641 +7642 +7643 +7644 +7645 +7646 +7647 +7648 +7649 +7650 +7651 +7652 +7653 +7654 +7655 +7656 +7657 +7658 +7659 +7660 +7661 +7662 +7663 +7664 +7665 +7666 +7667 +7668 +7669 +7670 +7671 +7672 +7673 +7674 +7675 +7676 +7677 +7678 +7679 +7680 +7681 +7682 +7683 +7684 +7685 +7686 +7687 +7688 +7689 +7690 +7691 +7692 +7693 +7694 +7695 +7696 +7697 +7698 +7699 +7700 +7701 +7702 +7703 +7704 +7705 +7706 +7707 +7708 +7709 +7710 +7711 +7712 +7713 +7714 +7715 +7716 +7717 +7718 +7719 +7720 +7721 +7722 +7723 +7724 +7725 +7726 +7727 +7728 +7729 +7730 +7731 +7732 +7733 +7734 +7735 +7736 +7737 +7738 +7739 +7740 +7741 +7742 +7743 +7744 +7745 +7746 +7747 +7748 +7749 +7750 +7751 +7752 +7753 +7754 +7755 +7756 +7757 +7758 +7759 +7760 +7761 +7762 +7763 +7764 +7765 +7766 +7767 +7768 +7769 +7770 +7771 +7772 +7773 +7774 +7775 +7776 +7777 +7778 +7779 +7780 +7781 +7782 +7783 +7784 +7785 +7786 +7787 +7788 +7789 +7790 +7791 +7792 +7793 +7794 +7795 +7796 +7797 +7798 +7799 +7800 +7801 +7802 +7803 +7804 +7805 +7806 +7807 +7808 +7809 +7810 +7811 +7812 +7813 +7814 +7815 +7816 +7817 +7818 +7819 +7820 +7821 +7822 +7823 +7824 +7825 +7826 +7827 +7828 +7829 +7830 +7831 +7832 +7833 +7834 +7835 +7836 +7837 +7838 +7839 +7840 +7841 +7842 +7843 +7844 +7845 +7846 +7847 +7848 +7849 +7850 +7851 +7852 +7853 +7854 +7855 +7856 +7857 +7858 +7859 +7860 +7861 +7862 +7863 +7864 +7865 +7866 +7867 +7868 +7869 +7870 +7871 +7872 +7873 +7874 +7875 +7876 +7877 +7878 +7879 +7880 +7881 +7882 +7883 +7884 +7885 +7886 +7887 +7888 +7889 +7890 +7891 +7892 +7893 +7894 +7895 +7896 +7897 +7898 +7899 +7900 +7901 +7902 +7903 +7904 +7905 +7906 +7907 +7908 +7909 +7910 +7911 +7912 +7913 +7914 +7915 +7916 +7917 +7918 +7919 +7920 +7921 +7922 +7923 +7924 +7925 +7926 +7927 +7928 +7929 +7930 +7931 +7932 +7933 +7934 +7935 +7936 +7937 +7938 +7939 +7940 +7941 +7942 +7943 +7944 +7945 +7946 +7947 +7948 +7949 +7950 +7951 +7952 +7953 +7954 +7955 +7956 +7957 +7958 +7959 +7960 +7961 +7962 +7963 +7964 +7965 +7966 +7967 +7968 +7969 +7970 +7971 +7972 +7973 +7974 +7975 +7976 +7977 +7978 +7979 +7980 +7981 +7982 +7983 +7984 +7985 +7986 +7987 +7988 +7989 +7990 +7991 +7992 +7993 +7994 +7995 +7996 +7997 +7998 +7999 +8000 +8001 +8002 +8003 +8004 +8005 +8006 +8007 +8008 +8009 +8010 +8011 +8012 +8013 +8014 +8015 +8016 +8017 +8018 +8019 +8020 +8021 +8022 +8023 +8024 +8025 +8026 +8027 +8028 +8029 +8030 +8031 +8032 +8033 +8034 +8035 +8036 +8037 +8038 +8039 +8040 +8041 +8042 +8043 +8044 +8045 +8046 +8047 +8048 +8049 +8050 +8051 +8052 +8053 +8054 +8055 +8056 +8057 +8058 +8059 +8060 +8061 +8062 +8063 +8064 +8065 +8066 +8067 +8068 +8069 +8070 +8071 +8072 +8073 +8074 +8075 +8076 +8077 +8078 +8079 +8080 +8081 +8082 +8083 +8084 +8085 +8086 +8087 +8088 +8089 +8090 +8091 +8092 +8093 +8094 +8095 +8096 +8097 +8098 +8099 +8100 +8101 +8102 +8103 +8104 +8105 +8106 +8107 +8108 +8109 +8110 +8111 +8112 +8113 +8114 +8115 +8116 +8117 +8118 +8119 +8120 +8121 +8122 +8123 +8124 +8125 +8126 +8127 +8128 +8129 +8130 +8131 +8132 +8133 +8134 +8135 +8136 +8137 +8138 +8139 +8140 +8141 +8142 +8143 +8144 +8145 +8146 +8147 +8148 +8149 +8150 +8151 +8152 +8153 +8154 +8155 +8156 +8157 +8158 +8159 +8160 +8161 +8162 +8163 +8164 +8165 +8166 +8167 +8168 +8169 +8170 +8171 +8172 +8173 +8174 +8175 +8176 +8177 +8178 +8179 +8180 +8181 +8182 +8183 +8184 +8185 +8186 +8187 +8188 +8189 +8190 +8191 +8192 +8193 +8194 +8195 +8196 +8197 +8198 +8199 +8200 +8201 +8202 +8203 +8204 +8205 +8206 +8207 +8208 +8209 +8210 +8211 +8212 +8213 +8214 +8215 +8216 +8217 +8218 +8219 +8220 +8221 +8222 +8223 +8224 +8225 +8226 +8227 +8228 +8229 +8230 +8231 +8232 +8233 +8234 +8235 +8236 +8237 +8238 +8239 +8240 +8241 +8242 +8243 +8244 +8245 +8246 +8247 +8248 +8249 +8250 +8251 +8252 +8253 +8254 +8255 +8256 +8257 +8258 +8259 +8260 +8261 +8262 +8263 +8264 +8265 +8266 +8267 +8268 +8269 +8270 +8271 +8272 +8273 +8274 +8275 +8276 +8277 +8278 +8279 +8280 +8281 +8282 +8283 +8284 +8285 +8286 +8287 +8288 +8289 +8290 +8291 +8292 +8293 +8294 +8295 +8296 +8297 +8298 +8299 +8300 +8301 +8302 +8303 +8304 +8305 +8306 +8307 +8308 +8309 +8310 +8311 +8312 +8313 +8314 +8315 +8316 +8317 +8318 +8319 +8320 +8321 +8322 +8323 +8324 +8325 +8326 +8327 +8328 +8329 +8330 +8331 +8332 +8333 +8334 +8335 +8336 +8337 +8338 +8339 +8340 +8341 +8342 +8343 +8344 +8345 +8346 +8347 +8348 +8349 +8350 +8351 +8352 +8353 +8354 +8355 +8356 +8357 +8358 +8359 +8360 +8361 +8362 +8363 +8364 +8365 +8366 +8367 +8368 +8369 +8370 +8371 +8372 +8373 +8374 +8375 +8376 +8377 +8378 +8379 +8380 +8381 +8382 +8383 +8384 +8385 +8386 +8387 +8388 +8389 +8390 +8391 +8392 +8393 +8394 +8395 +8396 +8397 +8398 +8399 +8400 +8401 +8402 +8403 +8404 +8405 +8406 +8407 +8408 +8409 +8410 +8411 +8412 +8413 +8414 +8415 +8416 +8417 +8418 +8419 +8420 +8421 +8422 +8423 +8424 +8425 +8426 +8427 +8428 +8429 +8430 +8431 +8432 +8433 +8434 +8435 +8436 +8437 +8438 +8439 +8440 +8441 +8442 +8443 +8444 +8445 +8446 +8447 +8448 +8449 +8450 +8451 +8452 +8453 +8454 +8455 +8456 +8457 +8458 +8459 +8460 +8461 +8462 +8463 +8464 +8465 +8466 +8467 +8468 +8469 +8470 +8471 +8472 +8473 +8474 +8475 +8476 +8477 +8478 +8479 +8480 +8481 +8482 +8483 +8484 +8485 +8486 +8487 +8488 +8489 +8490 +8491 +8492 +8493 +8494 +8495 +8496 +8497 +8498 +8499 +8500 +8501 +8502 +8503 +8504 +8505 +8506 +8507 +8508 +8509 +8510 +8511 +8512 +8513 +8514 +8515 +8516 +8517 +8518 +8519 +8520 +8521 +8522 +8523 +8524 +8525 +8526 +8527 +8528 +8529 +8530 +8531 +8532 +8533 +8534 +8535 +8536 +8537 +8538 +8539 +8540 +8541 +8542 +8543 +8544 +8545 +8546 +8547 +8548 +8549 +8550 +8551 +8552 +8553 +8554 +8555 +8556 +8557 +8558 +8559 +8560 +8561 +8562 +8563 +8564 +8565 +8566 +8567 +8568 +8569 +8570 +8571 +8572 +8573 +8574 +8575 +8576 +8577 +8578 +8579 +8580 +8581 +8582 +8583 +8584 +8585 +8586 +8587 +8588 +8589 +8590 +8591 +8592 +8593 +8594 +8595 +8596 +8597 +8598 +8599 +8600 +8601 +8602 +8603 +8604 +8605 +8606 +8607 +8608 +8609 +8610 +8611 +8612 +8613 +8614 +8615 +8616 +8617 +8618 +8619 +8620 +8621 +8622 +8623 +8624 +8625 +8626 +8627 +8628 +8629 +8630 +8631 +8632 +8633 +8634 +8635 +8636 +8637 +8638 +8639 +8640 +8641 +8642 +8643 +8644 +8645 +8646 +8647 +8648 +8649 +8650 +8651 +8652 +8653 +8654 +8655 +8656 +8657 +8658 +8659 +8660 +8661 +8662 +8663 +8664 +8665 +8666 +8667 +8668 +8669 +8670 +8671 +8672 +8673 +8674 +8675 +8676 +8677 +8678 +8679 +8680 +8681 +8682 +8683 +8684 +8685 +8686 +8687 +8688 +8689 +8690 +8691 +8692 +8693 +8694 +8695 +8696 +8697 +8700 +8701 +8702 +8703 +8704 +8705 +8712 +8713 +8714 +8715 +8716 +8717 +8718 +8719 +8720 +8721 +8722 +8723 +8724 +8725 +8726 +8727 +8728 +8729 +8730 +8731 +8732 +8733 +8734 +8735 +8736 +8737 +8738 +8739 +8740 +8741 +8742 +8743 +8744 +8745 +8746 +8747 +8748 +8749 +8750 +8751 +8752 +8753 +8754 +8755 +8756 +8757 +8758 +8759 +8760 +8761 +8762 +8763 +8764 +8765 +8766 +8767 +8768 +8769 +8770 +8771 +8772 +8773 +8774 +8787 +8788 +8789 +8790 +8791 +8792 +8793 +8794 +8795 +8796 +8797 +8798 +8799 +8800 +8801 +8802 +8803 +8804 +8805 +8806 +8807 +8808 +8809 +8810 +8811 +8812 +8813 +8814 +8815 +8816 +8817 +8818 +8819 +8820 +8821 +8822 +8823 +8824 +8825 +8826 +8827 +8828 +8829 +8830 +8831 +8832 +8833 +8834 +8835 +8836 +8837 +8838 +8839 +8840 +8841 +8842 +8843 +8844 +8845 +8846 +8847 +8862 +8863 +8864 +8865 +8866 +8867 +8868 +8869 +8870 +8871 +8872 +8873 +8874 +8875 +8876 +8877 +8878 +8879 +8880 +8881 +8882 +8883 +8884 +8885 +8886 +8887 +8888 +8889 +8890 +8891 +8892 +8893 +8894 +8895 +8896 +8897 +8898 +8899 +8900 +8901 +8902 +8903 +8904 +8905 +8906 +8907 +8908 +8909 +8910 +8911 +8912 +8913 +8914 +8915 +8916 +8917 +8937 +8938 +8939 +8940 +8941 +8942 +8943 +8944 +8945 +8946 +8947 +8948 +8949 +8950 +8951 +8952 +8953 +8954 +8955 +8956 +8957 +8958 +8959 +8960 +8961 +8962 +8963 +8964 +8965 +8966 +8967 +8968 +8969 +8970 +8971 +8972 +8973 +8974 +8975 +8976 +8977 +8978 +8979 +8980 +8981 +8982 +8983 +8984 +8985 +8986 +8987 +8988 +9012 +9013 +9014 +9015 +9016 +9017 +9018 +9019 +9020 +9021 +9022 +9023 +9024 +9025 +9026 +9027 +9028 +9029 +9030 +9031 +9032 +9033 +9034 +9035 +9036 +9037 +9038 +9039 +9040 +9041 +9042 +9043 +9044 +9045 +9046 +9047 +9048 +9049 +9050 +9051 +9052 +9053 +9054 +9055 +9056 +9057 +9058 +9059 +9087 +9088 +9089 +9090 +9091 +9092 +9093 +9094 +9095 +9096 +9097 +9098 +9099 +9100 +9101 +9102 +9103 +9104 +9105 +9106 +9107 +9108 +9109 +9110 +9111 +9112 +9113 +9114 +9115 +9116 +9117 +9118 +9119 +9120 +9121 +9122 +9123 +9124 +9125 +9126 +9127 +9128 +9129 +9130 +9162 +9163 +9164 +9165 +9166 +9167 +9168 +9169 +9170 +9171 +9172 +9173 +9174 +9175 +9176 +9177 +9178 +9179 +9180 +9181 +9182 +9183 +9184 +9185 +9186 +9187 +9188 +9189 +9190 +9191 +9192 +9193 +9194 +9195 +9196 +9197 +9198 +9199 +9200 +9201 +9202 +9237 +9238 +9239 +9240 +9241 +9242 +9243 +9244 +9245 +9246 +9247 +9248 +9249 +9250 +9251 +9252 +9253 +9254 +9255 +9256 +9257 +9258 +9259 +9260 +9261 +9262 +9263 +9264 +9265 +9266 +9267 +9268 +9269 +9270 +9271 +9272 +9273 +9274 +9312 +9313 +9314 +9315 +9316 +9317 +9318 +9319 +9320 +9321 +9322 +9323 +9324 +9325 +9326 +9327 +9328 +9329 +9330 +9331 +9332 +9333 +9334 +9335 +9336 +9337 +9338 +9339 +9340 +9341 +9342 +9343 +9344 +9345 +9387 +9388 +9389 +9390 +9391 +9392 +9393 +9394 +9395 +9396 +9397 +9398 +9399 +9400 +9401 +9402 +9403 +9404 +9405 +9406 +9407 +9408 +9409 +9410 +9411 +9412 +9413 +9414 +9415 +9416 +9417 +9462 +9463 +9464 +9465 +9466 +9467 +9468 +9469 +9470 +9471 +9472 +9473 +9474 +9475 +9476 +9477 +9478 +9479 +9480 +9481 +9482 +9483 +9484 +9485 +9486 +9487 +9488 +9489 +9537 +9538 +9539 +9540 +9541 +9542 +9543 +9544 +9545 +9546 +9547 +9548 +9549 +9550 +9551 +9552 +9553 +9554 +9555 +9556 +9557 +9558 +9559 +9560 +9561 +9612 +9613 +9614 +9615 +9616 +9617 +9618 +9619 +9620 +9621 +9622 +9623 +9624 +9625 +9626 +9627 +9628 +9629 +9630 +9631 +9632 +9687 +9688 +9689 +9690 +9691 +9692 +9693 +9694 +9695 +9696 +9697 +9698 +9699 +9700 +9701 +9702 +9703 +9762 +9763 +9764 +9765 +9766 +9767 +9768 +9769 +9770 +9771 +9772 +9773 +9774 +9837 +9838 +9839 +9840 +9841 +9842 +9843 +9844 +9912 +9913 +10544 +10545 +10546 +10547 +10548 +10549 +10550 +10551 +10552 +10553 +10554 +10555 +10556 +10557 +10558 +10559 +10560 +10561 +10562 +10563 +10564 +10565 +10566 +10567 +10568 +10569 +10570 +10571 +10572 +10573 +10574 +10575 +10576 +10577 +10578 +10579 +10580 +10581 +10582 +10583 +10584 +10585 +10586 +10587 +10588 +10589 +10590 +10591 +10592 +10593 +10594 +10595 +10596 +10597 +10598 +10599 +10600 +10601 +10602 +10603 +10604 +10605 +10606 +10607 +10608 +10609 +10610 +10611 +10612 +10613 +10614 +10615 +10616 +10617 +10618 +10619 +10620 +10621 +10622 +10623 +10624 +10625 +10626 +10627 +10628 +10629 +10630 +10631 +10632 +10633 +10634 +10635 +10636 +10637 +10638 +10639 +10640 +10641 +10642 +10643 +10644 +10645 +10646 +10647 +10648 +10649 +10650 +10651 +10652 +10653 +10654 +10655 +10656 +10657 +10658 +10659 +10660 +10661 +10662 +10663 +10664 +10665 +10666 +10667 +10668 +10669 +10670 +10671 +10672 +10673 +10674 +10675 +10676 +10677 +10678 +10679 +10680 +10681 +10682 +10683 +10684 +10685 +10686 +10687 +10688 +10689 +10690 +10691 +10692 +10693 +10694 +10695 +10696 +10697 +10698 +10699 +10700 +10701 +10702 +10703 +10704 +10705 +10706 +10707 +10708 +10709 +10710 +10711 +10712 +10713 +10714 +10715 +10716 +10717 +10718 +10719 +10720 +10721 +10722 +10723 +10724 +10725 +10726 +10727 +10728 +10729 +10730 +10731 +10732 +10733 +10734 +10735 +10736 +10737 +10738 +10739 +10740 +10741 +10742 +10743 +10744 +10745 +10746 +10747 +10748 +10749 +10750 +10751 +10752 +10753 +10754 +10755 +10756 +10757 +10758 +10759 +10760 +10761 +10762 +10763 +10764 +10765 +10766 +10767 +10768 +10769 +10770 +10771 +10772 +10773 +10774 +10775 +10776 +10777 +10778 +10779 +10780 +10781 +10782 +10783 +10784 +10785 +10786 +10787 +10788 +10789 +10790 +10791 +10792 +10793 +10794 +10795 +10796 +10797 +10798 +10799 +10800 +10801 +10802 +10803 +10804 +10805 +10806 +10807 +10808 +10809 +10810 +10811 +10812 +10813 +10814 +10815 +10816 +10817 +10818 +10819 +10820 +10821 +10822 +10823 +10824 +10825 +10826 +10827 +10828 +10829 +10830 +10831 +) + +// ************************************************************************* // diff --git a/tutorials/interFoam/nozzleFlow2D/constant/polyMesh/sets/c0_old b/tutorials/interFoam/nozzleFlow2D/constant/polyMesh/sets/c0_old new file mode 100644 index 00000000000..250a0c6d531 --- /dev/null +++ b/tutorials/interFoam/nozzleFlow2D/constant/polyMesh/sets/c0_old @@ -0,0 +1,23 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class topoSet; + location "constant/polyMesh/sets"; + object c0_old; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + +0 +( +) + +// ************************************************************************* // diff --git a/tutorials/interFoam/nozzleFlow2D/constant/polyMesh/sets/refinedCells b/tutorials/interFoam/nozzleFlow2D/constant/polyMesh/sets/refinedCells new file mode 100644 index 00000000000..383d411db8a --- /dev/null +++ b/tutorials/interFoam/nozzleFlow2D/constant/polyMesh/sets/refinedCells @@ -0,0 +1,14161 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class cellSet; + location "1e-08/polyMesh/sets"; + object refinedCells; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + +14138 +( +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440 +441 +442 +443 +444 +445 +446 +447 +448 +449 +450 +451 +452 +453 +454 +455 +456 +457 +458 +459 +460 +461 +462 +463 +464 +465 +466 +467 +468 +469 +470 +471 +472 +473 +474 +475 +476 +477 +478 +479 +480 +481 +482 +483 +484 +485 +486 +487 +488 +489 +490 +491 +492 +493 +494 +495 +496 +497 +498 +499 +500 +501 +502 +503 +504 +505 +506 +507 +508 +509 +510 +511 +512 +513 +514 +515 +516 +517 +518 +519 +520 +521 +522 +523 +524 +525 +526 +527 +528 +529 +530 +531 +532 +533 +534 +535 +536 +537 +538 +539 +540 +541 +542 +543 +544 +545 +546 +547 +548 +549 +550 +551 +552 +553 +554 +555 +556 +557 +558 +559 +560 +561 +562 +563 +564 +565 +566 +567 +568 +569 +570 +571 +572 +573 +574 +575 +576 +577 +578 +579 +580 +581 +582 +583 +584 +585 +586 +587 +588 +589 +590 +591 +592 +593 +594 +595 +596 +597 +598 +599 +600 +601 +602 +603 +604 +605 +606 +607 +608 +609 +610 +611 +612 +613 +614 +615 +616 +617 +618 +619 +620 +621 +622 +623 +624 +625 +626 +627 +628 +629 +630 +631 +632 +633 +634 +635 +636 +637 +638 +639 +640 +641 +642 +643 +644 +645 +646 +647 +648 +649 +650 +651 +652 +653 +654 +655 +656 +657 +658 +659 +660 +661 +662 +663 +664 +665 +666 +667 +668 +669 +670 +671 +672 +673 +674 +675 +676 +677 +678 +679 +680 +681 +682 +683 +684 +685 +686 +687 +688 +689 +690 +691 +692 +693 +694 +695 +696 +697 +698 +699 +700 +701 +702 +703 +704 +705 +706 +707 +708 +709 +710 +711 +712 +713 +714 +715 +716 +717 +718 +719 +720 +721 +722 +723 +724 +725 +726 +727 +728 +729 +730 +731 +732 +733 +734 +735 +736 +737 +738 +739 +740 +741 +742 +743 +744 +745 +746 +747 +748 +749 +750 +751 +752 +753 +754 +755 +756 +757 +758 +759 +760 +761 +762 +763 +764 +765 +766 +767 +768 +769 +770 +771 +772 +773 +774 +775 +776 +777 +778 +779 +780 +781 +782 +783 +784 +785 +786 +787 +788 +789 +790 +791 +792 +793 +794 +795 +796 +797 +798 +799 +800 +801 +802 +803 +804 +805 +806 +807 +808 +809 +810 +811 +812 +813 +814 +815 +816 +817 +818 +819 +820 +821 +822 +823 +824 +825 +826 +827 +828 +829 +830 +831 +832 +833 +834 +835 +836 +837 +838 +839 +840 +841 +842 +843 +844 +845 +846 +847 +848 +849 +850 +851 +852 +853 +854 +855 +856 +857 +858 +859 +860 +861 +862 +863 +864 +865 +866 +867 +868 +869 +870 +871 +872 +873 +874 +875 +876 +877 +878 +879 +880 +881 +882 +883 +884 +885 +886 +887 +888 +889 +890 +891 +892 +893 +894 +895 +896 +897 +898 +899 +900 +901 +902 +903 +904 +905 +906 +907 +908 +909 +910 +911 +912 +913 +914 +915 +916 +917 +918 +919 +920 +921 +922 +923 +924 +925 +926 +927 +928 +929 +930 +931 +932 +933 +934 +935 +936 +937 +938 +939 +940 +941 +942 +943 +944 +945 +946 +947 +948 +949 +950 +951 +952 +953 +954 +955 +956 +957 +958 +959 +960 +961 +962 +963 +964 +965 +966 +967 +968 +969 +970 +971 +972 +973 +974 +975 +976 +977 +978 +979 +980 +981 +982 +983 +984 +985 +986 +987 +988 +989 +990 +991 +992 +993 +994 +995 +996 +997 +998 +999 +1000 +1001 +1002 +1003 +1004 +1005 +1006 +1007 +1008 +1009 +1010 +1011 +1012 +1013 +1014 +1015 +1016 +1017 +1018 +1019 +1020 +1021 +1022 +1023 +1024 +1025 +1026 +1027 +1028 +1029 +1030 +1031 +1032 +1033 +1034 +1035 +1036 +1037 +1038 +1039 +1040 +1041 +1042 +1043 +1044 +1045 +1046 +1047 +1048 +1049 +1050 +1051 +1052 +1053 +1054 +1055 +1056 +1057 +1058 +1059 +1060 +1061 +1062 +1063 +1064 +1065 +1066 +1067 +1068 +1069 +1070 +1071 +1072 +1073 +1074 +1075 +1076 +1077 +1078 +1079 +1080 +1081 +1082 +1083 +1084 +1085 +1086 +1087 +1088 +1089 +1090 +1091 +1092 +1093 +1094 +1095 +1096 +1097 +1098 +1099 +1100 +1101 +1102 +1103 +1104 +1105 +1106 +1107 +1108 +1109 +1110 +1111 +1112 +1113 +1114 +1115 +1116 +1117 +1118 +1119 +1120 +1121 +1122 +1123 +1124 +1125 +1126 +1127 +1128 +1129 +1130 +1131 +1132 +1133 +1134 +1135 +1136 +1137 +1138 +1139 +1140 +1141 +1142 +1143 +1144 +1145 +1146 +1147 +1148 +1149 +1150 +1151 +1152 +1153 +1154 +1155 +1156 +1157 +1158 +1159 +1160 +1161 +1162 +1163 +1164 +1165 +1166 +1167 +1168 +1169 +1170 +1171 +1172 +1173 +1174 +1175 +1176 +1177 +1178 +1179 +1180 +1181 +1182 +1183 +1184 +1185 +1186 +1187 +1188 +1189 +1190 +1191 +1192 +1193 +1194 +1195 +1196 +1197 +1198 +1199 +1200 +1201 +1202 +1203 +1204 +1205 +1206 +1207 +1208 +1209 +1210 +1211 +1212 +1213 +1214 +1215 +1216 +1217 +1218 +1219 +1220 +1221 +1222 +1223 +1224 +1225 +1226 +1227 +1228 +1229 +1230 +1231 +1232 +1233 +1234 +1235 +1236 +1237 +1238 +1239 +1240 +1241 +1242 +1243 +1244 +1245 +1246 +1247 +1248 +1249 +1250 +1251 +1252 +1253 +1254 +1255 +1256 +1257 +1258 +1259 +1260 +1261 +1262 +1263 +1264 +1265 +1266 +1267 +1268 +1269 +1270 +1271 +1272 +1273 +1274 +1275 +1276 +1277 +1278 +1279 +1280 +1281 +1282 +1283 +1284 +1285 +1286 +1287 +1288 +1289 +1290 +1291 +1292 +1293 +1294 +1295 +1296 +1297 +1298 +1299 +1300 +1301 +1302 +1303 +1304 +1305 +1306 +1307 +1308 +1309 +1310 +1311 +1312 +1313 +1314 +1315 +1316 +1317 +1318 +1319 +1320 +1321 +1322 +1323 +1324 +1325 +1326 +1327 +1328 +1329 +1330 +1331 +1332 +1333 +1334 +1335 +1336 +1337 +1338 +1339 +1340 +1341 +1342 +1343 +1344 +1345 +1346 +1347 +1348 +1349 +1350 +1351 +1352 +1353 +1354 +1355 +1356 +1357 +1358 +1359 +1360 +1361 +1362 +1363 +1364 +1365 +1366 +1367 +1368 +1369 +1370 +1371 +1372 +1373 +1374 +1375 +1376 +1377 +1378 +1379 +1380 +1381 +1382 +1383 +1384 +1385 +1386 +1387 +1388 +1389 +1390 +1391 +1392 +1393 +1394 +1395 +1396 +1397 +1398 +1399 +1400 +1401 +1402 +1403 +1404 +1405 +1406 +1407 +1408 +1409 +1410 +1411 +1412 +1413 +1414 +1415 +1416 +1417 +1418 +1419 +1420 +1421 +1422 +1423 +1424 +1425 +1426 +1427 +1428 +1429 +1430 +1431 +1432 +1433 +1434 +1435 +1436 +1437 +1438 +1439 +1440 +1441 +1442 +1443 +1444 +1445 +1446 +1447 +1448 +1449 +1450 +1451 +1452 +1453 +1454 +1455 +1456 +1457 +1458 +1459 +1460 +1461 +1462 +1463 +1464 +1465 +1466 +1467 +1468 +1469 +1470 +1471 +1472 +1473 +1474 +1475 +1476 +1477 +1478 +1479 +1480 +1481 +1482 +1483 +1484 +1485 +1486 +1487 +1488 +1489 +1490 +1491 +1492 +1493 +1494 +1495 +1496 +1497 +1498 +1499 +1500 +1501 +1502 +1503 +1504 +1505 +1506 +1507 +1508 +1509 +1510 +1511 +1512 +1513 +1514 +1515 +1516 +1517 +1518 +1519 +1520 +1521 +1522 +1523 +1524 +1525 +1526 +1527 +1528 +1529 +1530 +1531 +1532 +1533 +1534 +1535 +1536 +1537 +1538 +1539 +1540 +1541 +1542 +1543 +1544 +1545 +1546 +1547 +1548 +1549 +1550 +1551 +1552 +1553 +1554 +1555 +1556 +1557 +1558 +1559 +1560 +1561 +1562 +1563 +1564 +1565 +1566 +1567 +1568 +1569 +1570 +1571 +1572 +1573 +1574 +1575 +1576 +1577 +1578 +1579 +1580 +1581 +1582 +1583 +1584 +1585 +1586 +1587 +1588 +1589 +1590 +1591 +1592 +1593 +1594 +1595 +1596 +1597 +1598 +1599 +1600 +1601 +1602 +1603 +1604 +1605 +1606 +1607 +1608 +1609 +1610 +1611 +1612 +1613 +1614 +1615 +1616 +1617 +1618 +1619 +1620 +1621 +1622 +1623 +1624 +1625 +1626 +1627 +1628 +1629 +1630 +1631 +1632 +1633 +1634 +1635 +1636 +1637 +1638 +1639 +1640 +1641 +1642 +1643 +1644 +1645 +1646 +1647 +1648 +1649 +1650 +1651 +1652 +1653 +1654 +1655 +1656 +1657 +1658 +1659 +1660 +1661 +1662 +1663 +1664 +1665 +1666 +1667 +1668 +1669 +1670 +1671 +1672 +1673 +1674 +1675 +1676 +1677 +1678 +1679 +1680 +1681 +1682 +1683 +1684 +1685 +1686 +1687 +1688 +1689 +1690 +1691 +1692 +1693 +1694 +1695 +1696 +1697 +1698 +1699 +1700 +1701 +1702 +1703 +1704 +1705 +1706 +1707 +1708 +1709 +1710 +1711 +1712 +1713 +1714 +1715 +1716 +1717 +1718 +1719 +1720 +1721 +1722 +1723 +1724 +1725 +1726 +1727 +1728 +1729 +1730 +1731 +1732 +1733 +1734 +1735 +1736 +1737 +1738 +1739 +1740 +1741 +1742 +1743 +1744 +1745 +1746 +1747 +1748 +1749 +1750 +1751 +1752 +1753 +1754 +1755 +1756 +1757 +1758 +1759 +1760 +1761 +1762 +1763 +1764 +1765 +1766 +1767 +1768 +1769 +1770 +1771 +1772 +1773 +1774 +1775 +1776 +1777 +1778 +1779 +1780 +1781 +1782 +1783 +1784 +1785 +1786 +1787 +1788 +1789 +1790 +1791 +1792 +1793 +1794 +1795 +1796 +1797 +1798 +1799 +1800 +1801 +1802 +1803 +1804 +1805 +1806 +1807 +1808 +1809 +1810 +1811 +1812 +1813 +1814 +1815 +1816 +1817 +1818 +1819 +1820 +1821 +1822 +1823 +1824 +1825 +1826 +1827 +1828 +1829 +1830 +1831 +1832 +1833 +1834 +1835 +1836 +1837 +1838 +1839 +1840 +1841 +1842 +1843 +1844 +1845 +1846 +1847 +1848 +1849 +1850 +1851 +1852 +1853 +1854 +1855 +1856 +1857 +1858 +1859 +1860 +1861 +1862 +1863 +1864 +1865 +1866 +1867 +1868 +1869 +1870 +1871 +1872 +1873 +1874 +1875 +1876 +1877 +1878 +1879 +1880 +1881 +1882 +1883 +1884 +1885 +1886 +1887 +1888 +1889 +1890 +1891 +1892 +1893 +1894 +1895 +1896 +1897 +1898 +1899 +1900 +1901 +1902 +1903 +1904 +1905 +1906 +1907 +1908 +1909 +1910 +1911 +1912 +1913 +1914 +1915 +1916 +1917 +1918 +1919 +1920 +1921 +1922 +1923 +1924 +1925 +1926 +1927 +1928 +1929 +1930 +1931 +1932 +1933 +1934 +1935 +1936 +1937 +1938 +1939 +1940 +1941 +1942 +1943 +1944 +1945 +1946 +1947 +1948 +1949 +1950 +1951 +1952 +1953 +1954 +1955 +1956 +1957 +1958 +1959 +1960 +1961 +1962 +1963 +1964 +1965 +1966 +1967 +1968 +1969 +1970 +1971 +1972 +1973 +1974 +1975 +1976 +1977 +1978 +1979 +1980 +1981 +1982 +1983 +1984 +1985 +1986 +1987 +1988 +1989 +1990 +1991 +1992 +1993 +1994 +1995 +1996 +1997 +1998 +1999 +2000 +2001 +2002 +2003 +2004 +2005 +2006 +2007 +2008 +2009 +2010 +2011 +2012 +2013 +2014 +2015 +2016 +2017 +2018 +2019 +2020 +2021 +2022 +2023 +2024 +2025 +2026 +2027 +2028 +2029 +2030 +2031 +2032 +2033 +2034 +2035 +2036 +2037 +2038 +2039 +2040 +2041 +2042 +2043 +2044 +2045 +2046 +2047 +2048 +2049 +2050 +2051 +2052 +2053 +2054 +2055 +2056 +2057 +2058 +2059 +2060 +2061 +2062 +2063 +2064 +2065 +2066 +2067 +2068 +2069 +2070 +2071 +2072 +2073 +2074 +2075 +2076 +2077 +2078 +2079 +2080 +2081 +2082 +2083 +2084 +2085 +2086 +2087 +2088 +2089 +2090 +2091 +2092 +2093 +2094 +2095 +2096 +2097 +2098 +2099 +2100 +2101 +2102 +2103 +2104 +2105 +2106 +2107 +2108 +2109 +2110 +2111 +2112 +2113 +2114 +2115 +2116 +2117 +2118 +2119 +2120 +2121 +2122 +2123 +2124 +2125 +2126 +2127 +2128 +2129 +2130 +2131 +2132 +2133 +2134 +2135 +2136 +2137 +2138 +2139 +2140 +2141 +2142 +2143 +2144 +2145 +2146 +2147 +2148 +2149 +2150 +2151 +2152 +2153 +2154 +2155 +2156 +2157 +2158 +2159 +2160 +2161 +2162 +2163 +2164 +2165 +2166 +2167 +2168 +2169 +2170 +2171 +2172 +2173 +2174 +2175 +2176 +2177 +2178 +2179 +2180 +2181 +2182 +2183 +2184 +2185 +2186 +2187 +2188 +2189 +2190 +2191 +2192 +2193 +2194 +2195 +2196 +2197 +2198 +2199 +2200 +2201 +2202 +2203 +2204 +2205 +2206 +2207 +2208 +2209 +2210 +2211 +2212 +2213 +2214 +2215 +2216 +2217 +2218 +2219 +2220 +2221 +2222 +2223 +2224 +2225 +2226 +2227 +2228 +2229 +2230 +2231 +2232 +2233 +2234 +2235 +2236 +2237 +2238 +2239 +2240 +2241 +2242 +2243 +2244 +2245 +2246 +2247 +2248 +2249 +2250 +2251 +2252 +2253 +2254 +2255 +2256 +2257 +2258 +2259 +2260 +2261 +2262 +2263 +2264 +2265 +2266 +2267 +2268 +2269 +2270 +2271 +2272 +2273 +2274 +2275 +2276 +2277 +2278 +2279 +2280 +2281 +2282 +2283 +2284 +2285 +2286 +2287 +2288 +2289 +2290 +2291 +2292 +2293 +2294 +2295 +2296 +2297 +2298 +2299 +2300 +2301 +2302 +2303 +2304 +2305 +2306 +2307 +2308 +2309 +2310 +2311 +2312 +2313 +2314 +2315 +2316 +2317 +2318 +2319 +2320 +2321 +2322 +2325 +2326 +2327 +2328 +2329 +2330 +2331 +2332 +2333 +2334 +2335 +2336 +2337 +2338 +2339 +2340 +2341 +2342 +2343 +2344 +2345 +2346 +2347 +2348 +2349 +2350 +2351 +2352 +2353 +2354 +2355 +2356 +2357 +2358 +2359 +2360 +2361 +2362 +2363 +2364 +2365 +2366 +2367 +2368 +2369 +2370 +2371 +2372 +2373 +2374 +2375 +2376 +2377 +2378 +2379 +2380 +2381 +2382 +2383 +2384 +2385 +2386 +2387 +2388 +2389 +2390 +2391 +2392 +2393 +2394 +2400 +2401 +2402 +2403 +2404 +2405 +2406 +2407 +2408 +2409 +2410 +2411 +2412 +2413 +2414 +2415 +2416 +2417 +2418 +2419 +2420 +2421 +2422 +2423 +2424 +2425 +2426 +2427 +2428 +2429 +2430 +2431 +2432 +2433 +2434 +2435 +2436 +2437 +2438 +2439 +2440 +2441 +2442 +2443 +2444 +2445 +2446 +2447 +2448 +2449 +2450 +2451 +2452 +2453 +2454 +2455 +2456 +2457 +2458 +2459 +2460 +2461 +2462 +2463 +2464 +2465 +2466 +2475 +2476 +2477 +2478 +2479 +2480 +2481 +2482 +2483 +2484 +2485 +2486 +2487 +2488 +2489 +2490 +2491 +2492 +2493 +2494 +2495 +2496 +2497 +2498 +2499 +2500 +2501 +2502 +2503 +2504 +2505 +2506 +2507 +2508 +2509 +2510 +2511 +2512 +2513 +2514 +2515 +2516 +2517 +2518 +2519 +2520 +2521 +2522 +2523 +2524 +2525 +2526 +2527 +2528 +2529 +2530 +2531 +2532 +2533 +2534 +2535 +2536 +2537 +2538 +2550 +2551 +2552 +2553 +2554 +2555 +2556 +2557 +2558 +2559 +2560 +2561 +2562 +2563 +2564 +2565 +2566 +2567 +2568 +2569 +2570 +2571 +2572 +2573 +2574 +2575 +2576 +2577 +2578 +2579 +2580 +2581 +2582 +2583 +2584 +2585 +2586 +2587 +2588 +2589 +2590 +2591 +2592 +2593 +2594 +2595 +2596 +2597 +2598 +2599 +2600 +2601 +2602 +2603 +2604 +2605 +2606 +2607 +2608 +2609 +2610 +2625 +2626 +2627 +2628 +2629 +2630 +2631 +2632 +2633 +2634 +2635 +2636 +2637 +2638 +2639 +2640 +2641 +2642 +2643 +2644 +2645 +2646 +2647 +2648 +2649 +2650 +2651 +2652 +2653 +2654 +2655 +2656 +2657 +2658 +2659 +2660 +2661 +2662 +2663 +2664 +2665 +2666 +2667 +2668 +2669 +2670 +2671 +2672 +2673 +2674 +2675 +2676 +2677 +2678 +2679 +2680 +2681 +2682 +2683 +2700 +2701 +2702 +2703 +2704 +2705 +2706 +2707 +2708 +2709 +2710 +2711 +2712 +2713 +2714 +2715 +2716 +2717 +2718 +2719 +2720 +2721 +2722 +2723 +2724 +2725 +2726 +2727 +2728 +2729 +2730 +2731 +2732 +2733 +2734 +2735 +2736 +2737 +2738 +2739 +2740 +2741 +2742 +2743 +2744 +2745 +2746 +2747 +2748 +2749 +2750 +2751 +2752 +2753 +2754 +2755 +2775 +2776 +2777 +2778 +2779 +2780 +2781 +2782 +2783 +2784 +2785 +2786 +2787 +2788 +2789 +2790 +2791 +2792 +2793 +2794 +2795 +2796 +2797 +2798 +2799 +2800 +2801 +2802 +2803 +2804 +2805 +2806 +2807 +2808 +2809 +2810 +2811 +2812 +2813 +2814 +2815 +2816 +2817 +2818 +2819 +2820 +2821 +2822 +2823 +2824 +2825 +2826 +2827 +2828 +2850 +2851 +2852 +2853 +2854 +2855 +2856 +2857 +2858 +2859 +2860 +2861 +2862 +2863 +2864 +2865 +2866 +2867 +2868 +2869 +2870 +2871 +2872 +2873 +2874 +2875 +2876 +2877 +2878 +2879 +2880 +2881 +2882 +2883 +2884 +2885 +2886 +2887 +2888 +2889 +2890 +2891 +2892 +2893 +2894 +2895 +2896 +2897 +2898 +2899 +2900 +2901 +2925 +2926 +2927 +2928 +2929 +2930 +2931 +2932 +2933 +2934 +2935 +2936 +2937 +2938 +2939 +2940 +2941 +2942 +2943 +2944 +2945 +2946 +2947 +2948 +2949 +2950 +2951 +2952 +2953 +2954 +2955 +2956 +2957 +2958 +2959 +2960 +2961 +2962 +2963 +2964 +2965 +2966 +2967 +2968 +2969 +2970 +2971 +2972 +2973 +2974 +3000 +3001 +3002 +3003 +3004 +3005 +3006 +3007 +3008 +3009 +3010 +3011 +3012 +3013 +3014 +3015 +3016 +3017 +3018 +3019 +3020 +3021 +3022 +3023 +3024 +3025 +3026 +3027 +3028 +3029 +3030 +3031 +3032 +3033 +3034 +3035 +3036 +3037 +3038 +3039 +3040 +3041 +3042 +3043 +3044 +3045 +3046 +3047 +3075 +3076 +3077 +3078 +3079 +3080 +3081 +3082 +3083 +3084 +3085 +3086 +3087 +3088 +3089 +3090 +3091 +3092 +3093 +3094 +3095 +3096 +3097 +3098 +3099 +3100 +3101 +3102 +3103 +3104 +3105 +3106 +3107 +3108 +3109 +3110 +3111 +3112 +3113 +3114 +3115 +3116 +3117 +3118 +3119 +3120 +3150 +3151 +3152 +3153 +3154 +3155 +3156 +3157 +3158 +3159 +3160 +3161 +3162 +3163 +3164 +3165 +3166 +3167 +3168 +3169 +3170 +3171 +3172 +3173 +3174 +3175 +3176 +3177 +3178 +3179 +3180 +3181 +3182 +3183 +3184 +3185 +3186 +3187 +3188 +3189 +3190 +3191 +3192 +3193 +3194 +3225 +3226 +3227 +3228 +3229 +3230 +3231 +3232 +3233 +3234 +3235 +3236 +3237 +3238 +3239 +3240 +3241 +3242 +3243 +3244 +3245 +3246 +3247 +3248 +3249 +3250 +3251 +3252 +3253 +3254 +3255 +3256 +3257 +3258 +3259 +3260 +3261 +3262 +3263 +3264 +3265 +3266 +3267 +3300 +3301 +3302 +3303 +3304 +3305 +3306 +3307 +3308 +3309 +3310 +3311 +3312 +3313 +3314 +3315 +3316 +3317 +3318 +3319 +3320 +3321 +3322 +3323 +3324 +3325 +3326 +3327 +3328 +3329 +3330 +3331 +3332 +3333 +3334 +3335 +3336 +3337 +3338 +3339 +3340 +3375 +3376 +3377 +3378 +3379 +3380 +3381 +3382 +3383 +3384 +3385 +3386 +3387 +3388 +3389 +3390 +3391 +3392 +3393 +3394 +3395 +3396 +3397 +3398 +3399 +3400 +3401 +3402 +3403 +3404 +3405 +3406 +3407 +3408 +3409 +3410 +3411 +3412 +3413 +3414 +3450 +3451 +3452 +3453 +3454 +3455 +3456 +3457 +3458 +3459 +3460 +3461 +3462 +3463 +3464 +3465 +3466 +3467 +3468 +3469 +3470 +3471 +3472 +3473 +3474 +3475 +3476 +3477 +3478 +3479 +3480 +3481 +3482 +3483 +3484 +3485 +3486 +3487 +3525 +3526 +3527 +3528 +3529 +3530 +3531 +3532 +3533 +3534 +3535 +3536 +3537 +3538 +3539 +3540 +3541 +3542 +3543 +3544 +3545 +3546 +3547 +3548 +3549 +3550 +3551 +3552 +3553 +3554 +3555 +3556 +3557 +3558 +3559 +3560 +3600 +3601 +3602 +3603 +3604 +3605 +3606 +3607 +3608 +3609 +3610 +3611 +3612 +3613 +3614 +3615 +3616 +3617 +3618 +3619 +3620 +3621 +3622 +3623 +3624 +3625 +3626 +3627 +3628 +3629 +3630 +3631 +3632 +3633 +3634 +3675 +3676 +3677 +3678 +3679 +3680 +3681 +3682 +3683 +3684 +3685 +3686 +3687 +3688 +3689 +3690 +3691 +3692 +3693 +3694 +3695 +3696 +3697 +3698 +3699 +3700 +3701 +3702 +3703 +3704 +3705 +3706 +3707 +3750 +3751 +3752 +3753 +3754 +3755 +3756 +3757 +3758 +3759 +3760 +3761 +3762 +3763 +3764 +3765 +3766 +3767 +3768 +3769 +3770 +3771 +3772 +3773 +3774 +3775 +3776 +3777 +3778 +3779 +3780 +3781 +3825 +3826 +3827 +3828 +3829 +3830 +3831 +3832 +3833 +3834 +3835 +3836 +3837 +3838 +3839 +3840 +3841 +3842 +3843 +3844 +3845 +3846 +3847 +3848 +3849 +3850 +3851 +3852 +3853 +3854 +3900 +3901 +3902 +3903 +3904 +3905 +3906 +3907 +3908 +3909 +3910 +3911 +3912 +3913 +3914 +3915 +3916 +3917 +3918 +3919 +3920 +3921 +3922 +3923 +3924 +3925 +3926 +3927 +3928 +3975 +3976 +3977 +3978 +3979 +3980 +3981 +3982 +3983 +3984 +3985 +3986 +3987 +3988 +3989 +3990 +3991 +3992 +3993 +3994 +3995 +3996 +3997 +3998 +3999 +4000 +4001 +4050 +4051 +4052 +4053 +4054 +4055 +4056 +4057 +4058 +4059 +4060 +4061 +4062 +4063 +4064 +4065 +4066 +4067 +4068 +4069 +4070 +4071 +4072 +4073 +4074 +4125 +4126 +4127 +4128 +4129 +4130 +4131 +4132 +4133 +4134 +4135 +4136 +4137 +4138 +4139 +4140 +4141 +4142 +4143 +4144 +4145 +4146 +4147 +4148 +4200 +4201 +4202 +4203 +4204 +4205 +4206 +4207 +4208 +4209 +4210 +4211 +4212 +4213 +4214 +4215 +4216 +4217 +4218 +4219 +4220 +4221 +4275 +4276 +4277 +4278 +4279 +4280 +4281 +4282 +4283 +4284 +4285 +4286 +4287 +4288 +4289 +4290 +4291 +4292 +4293 +4294 +4350 +4351 +4352 +4353 +4354 +4355 +4356 +4357 +4358 +4359 +4360 +4361 +4362 +4363 +4364 +4365 +4366 +4367 +4425 +4426 +4427 +4428 +4429 +4430 +4431 +4432 +4433 +4434 +4435 +4436 +4437 +4438 +4439 +4440 +4500 +4501 +4502 +4503 +4504 +4505 +4506 +4507 +4508 +4509 +4510 +4511 +4512 +4575 +4576 +4577 +4578 +4579 +4580 +4581 +4582 +4583 +4584 +4585 +4650 +4651 +4652 +4653 +4654 +4655 +4656 +4657 +4725 +4726 +4727 +4728 +4729 +4800 +4801 +7500 +7501 +7502 +7503 +7504 +7505 +7506 +7507 +7508 +7509 +7510 +7511 +7512 +7513 +7514 +7515 +7516 +7517 +7518 +7519 +7520 +7521 +7522 +7523 +7524 +7525 +7526 +7527 +7528 +7529 +7530 +7531 +7532 +7533 +7534 +7535 +7536 +7537 +7538 +7539 +7540 +7541 +7542 +7543 +7544 +7545 +7546 +7547 +7548 +7549 +7550 +7551 +7552 +7553 +7554 +7555 +7556 +7557 +7558 +7559 +7560 +7561 +7562 +7563 +7564 +7565 +7566 +7567 +7568 +7569 +7570 +7571 +7572 +7573 +7574 +7575 +7576 +7577 +7578 +7579 +7580 +7581 +7582 +7583 +7584 +7585 +7586 +7587 +7588 +7589 +7590 +7591 +7592 +7593 +7594 +7595 +7596 +7597 +7598 +7599 +7600 +7601 +7602 +7603 +7604 +7605 +7606 +7607 +7608 +7609 +7610 +7611 +7612 +7613 +7614 +7615 +7616 +7617 +7618 +7619 +7620 +7621 +7622 +7623 +7624 +7625 +7626 +7627 +7628 +7629 +7630 +7631 +7632 +7633 +7634 +7635 +7636 +7637 +7638 +7639 +7640 +7641 +7642 +7643 +7644 +7645 +7646 +7647 +7648 +7649 +7650 +7651 +7652 +7653 +7654 +7655 +7656 +7657 +7658 +7659 +7660 +7661 +7662 +7663 +7664 +7665 +7666 +7667 +7668 +7669 +7670 +7671 +7672 +7673 +7674 +7675 +7676 +7677 +7678 +7679 +7680 +7681 +7682 +7683 +7684 +7685 +7686 +7687 +7688 +7689 +7690 +7691 +7692 +7693 +7694 +7695 +7696 +7697 +7698 +7699 +7700 +7701 +7702 +7703 +7704 +7705 +7706 +7707 +7708 +7709 +7710 +7711 +7712 +7713 +7714 +7715 +7716 +7717 +7718 +7719 +7720 +7721 +7722 +7723 +7724 +7725 +7726 +7727 +7728 +7729 +7730 +7731 +7732 +7733 +7734 +7735 +7736 +7737 +7738 +7739 +7740 +7741 +7742 +7743 +7744 +7745 +7746 +7747 +7748 +7749 +7750 +7751 +7752 +7753 +7754 +7755 +7756 +7757 +7758 +7759 +7760 +7761 +7762 +7763 +7764 +7765 +7766 +7767 +7768 +7769 +7770 +7771 +7772 +7773 +7774 +7775 +7776 +7777 +7778 +7779 +7780 +7781 +7782 +7783 +7784 +7785 +7786 +7787 +7788 +7789 +7790 +7791 +7792 +7793 +7794 +7795 +7796 +7797 +7798 +7799 +7800 +7801 +7802 +7803 +7804 +7805 +7806 +7807 +7808 +7809 +7810 +7811 +7812 +7813 +7814 +7815 +7816 +7817 +7818 +7819 +7820 +7821 +7822 +7823 +7824 +7825 +7826 +7827 +7828 +7829 +7830 +7831 +7832 +7833 +7834 +7835 +7836 +7837 +7838 +7839 +7840 +7841 +7842 +7843 +7844 +7845 +7846 +7847 +7848 +7849 +7850 +7851 +7852 +7853 +7854 +7855 +7856 +7857 +7858 +7859 +7860 +7861 +7862 +7863 +7864 +7865 +7866 +7867 +7868 +7869 +7870 +7871 +7872 +7873 +7874 +7875 +7876 +7877 +7878 +7879 +7880 +7881 +7882 +7883 +7884 +7885 +7886 +7887 +7888 +7889 +7890 +7891 +7892 +7893 +7894 +7895 +7896 +7897 +7898 +7899 +7900 +7901 +7902 +7903 +7904 +7905 +7906 +7907 +7908 +7909 +7910 +7911 +7912 +7913 +7914 +7915 +7916 +7917 +7918 +7919 +7920 +7921 +7922 +7923 +7924 +7925 +7926 +7927 +7928 +7929 +7930 +7931 +7932 +7933 +7934 +7935 +7936 +7937 +7938 +7939 +7940 +7941 +7942 +7943 +7944 +7945 +7946 +7947 +7948 +7949 +7950 +7951 +7952 +7953 +7954 +7955 +7956 +7957 +7958 +7959 +7960 +7961 +7962 +7963 +7964 +7965 +7966 +7967 +7968 +7969 +7970 +7971 +7972 +7973 +7974 +7975 +7976 +7977 +7978 +7979 +7980 +7981 +7982 +7983 +7984 +7985 +7986 +7987 +7988 +7989 +7990 +7991 +7992 +7993 +7994 +7995 +7996 +7997 +7998 +7999 +8000 +8001 +8002 +8003 +8004 +8005 +8006 +8007 +8008 +8009 +8010 +8011 +8012 +8013 +8014 +8015 +8016 +8017 +8018 +8019 +8020 +8021 +8022 +8023 +8024 +8025 +8026 +8027 +8028 +8029 +8030 +8031 +8032 +8033 +8034 +8035 +8036 +8037 +8038 +8039 +8040 +8041 +8042 +8043 +8044 +8045 +8046 +8047 +8048 +8049 +8050 +8051 +8052 +8053 +8054 +8055 +8056 +8057 +8058 +8059 +8060 +8061 +8062 +8063 +8064 +8065 +8066 +8067 +8068 +8069 +8070 +8071 +8072 +8073 +8074 +8075 +8076 +8077 +8078 +8079 +8080 +8081 +8082 +8083 +8084 +8085 +8086 +8087 +8088 +8089 +8090 +8091 +8092 +8093 +8094 +8095 +8096 +8097 +8098 +8099 +8100 +8101 +8102 +8103 +8104 +8105 +8106 +8107 +8108 +8109 +8110 +8111 +8112 +8113 +8114 +8115 +8116 +8117 +8118 +8119 +8120 +8121 +8122 +8123 +8124 +8125 +8126 +8127 +8128 +8129 +8130 +8131 +8132 +8133 +8134 +8135 +8136 +8137 +8138 +8139 +8140 +8141 +8142 +8143 +8144 +8145 +8146 +8147 +8148 +8149 +8150 +8151 +8152 +8153 +8154 +8155 +8156 +8157 +8158 +8159 +8160 +8161 +8162 +8163 +8164 +8165 +8166 +8167 +8168 +8169 +8170 +8171 +8172 +8173 +8174 +8175 +8176 +8177 +8178 +8179 +8180 +8181 +8182 +8183 +8184 +8185 +8186 +8187 +8188 +8189 +8190 +8191 +8192 +8193 +8194 +8195 +8196 +8197 +8198 +8199 +8200 +8201 +8202 +8203 +8204 +8205 +8206 +8207 +8208 +8209 +8210 +8211 +8212 +8213 +8214 +8215 +8216 +8217 +8218 +8219 +8220 +8221 +8222 +8223 +8224 +8225 +8226 +8227 +8228 +8229 +8230 +8231 +8232 +8233 +8234 +8235 +8236 +8237 +8238 +8239 +8240 +8241 +8242 +8243 +8244 +8245 +8246 +8247 +8248 +8249 +8250 +8251 +8252 +8253 +8254 +8255 +8256 +8257 +8258 +8259 +8260 +8261 +8262 +8263 +8264 +8265 +8266 +8267 +8268 +8269 +8270 +8271 +8272 +8273 +8274 +8275 +8276 +8277 +8278 +8279 +8280 +8281 +8282 +8283 +8284 +8285 +8286 +8287 +8288 +8289 +8290 +8291 +8292 +8293 +8294 +8295 +8296 +8297 +8298 +8299 +8300 +8301 +8302 +8303 +8304 +8305 +8306 +8307 +8308 +8309 +8310 +8311 +8312 +8313 +8314 +8315 +8316 +8317 +8318 +8319 +8320 +8321 +8322 +8323 +8324 +8325 +8326 +8327 +8328 +8329 +8330 +8331 +8332 +8333 +8334 +8335 +8336 +8337 +8338 +8339 +8340 +8341 +8342 +8343 +8344 +8345 +8346 +8347 +8348 +8349 +8350 +8351 +8352 +8353 +8354 +8355 +8356 +8357 +8358 +8359 +8360 +8361 +8362 +8363 +8364 +8365 +8366 +8367 +8368 +8369 +8370 +8371 +8372 +8373 +8374 +8375 +8376 +8377 +8378 +8379 +8380 +8381 +8382 +8383 +8384 +8385 +8386 +8387 +8388 +8389 +8390 +8391 +8392 +8393 +8394 +8395 +8396 +8397 +8398 +8399 +8400 +8401 +8402 +8403 +8404 +8405 +8406 +8407 +8408 +8409 +8410 +8411 +8412 +8413 +8414 +8415 +8416 +8417 +8418 +8419 +8420 +8421 +8422 +8423 +8424 +8425 +8426 +8427 +8428 +8429 +8430 +8431 +8432 +8433 +8434 +8435 +8436 +8437 +8438 +8439 +8440 +8441 +8442 +8443 +8444 +8445 +8446 +8447 +8448 +8449 +8450 +8451 +8452 +8453 +8454 +8455 +8456 +8457 +8458 +8459 +8460 +8461 +8462 +8463 +8464 +8465 +8466 +8467 +8468 +8469 +8470 +8471 +8472 +8473 +8474 +8475 +8476 +8477 +8478 +8479 +8480 +8481 +8482 +8483 +8484 +8485 +8486 +8487 +8488 +8489 +8490 +8491 +8492 +8493 +8494 +8495 +8496 +8497 +8498 +8499 +8500 +8501 +8502 +8503 +8504 +8505 +8506 +8507 +8508 +8509 +8510 +8511 +8512 +8513 +8514 +8515 +8516 +8517 +8518 +8519 +8520 +8521 +8522 +8523 +8524 +8525 +8526 +8527 +8528 +8529 +8530 +8531 +8532 +8533 +8534 +8535 +8536 +8537 +8538 +8539 +8540 +8541 +8542 +8543 +8544 +8545 +8546 +8547 +8548 +8549 +8550 +8551 +8552 +8553 +8554 +8555 +8556 +8557 +8558 +8559 +8560 +8561 +8562 +8563 +8564 +8565 +8566 +8567 +8568 +8569 +8570 +8571 +8572 +8573 +8574 +8575 +8576 +8577 +8578 +8579 +8580 +8581 +8582 +8583 +8584 +8585 +8586 +8587 +8588 +8589 +8590 +8591 +8592 +8593 +8594 +8595 +8596 +8597 +8598 +8599 +8600 +8601 +8602 +8603 +8604 +8605 +8606 +8607 +8608 +8609 +8610 +8611 +8612 +8613 +8614 +8615 +8616 +8617 +8618 +8619 +8620 +8621 +8622 +8623 +8624 +8625 +8626 +8627 +8628 +8629 +8630 +8631 +8632 +8633 +8634 +8635 +8636 +8637 +8638 +8639 +8640 +8641 +8642 +8643 +8644 +8645 +8646 +8647 +8648 +8649 +8650 +8651 +8652 +8653 +8654 +8655 +8656 +8657 +8658 +8659 +8660 +8661 +8662 +8663 +8664 +8665 +8666 +8667 +8668 +8669 +8670 +8671 +8672 +8673 +8674 +8675 +8676 +8677 +8678 +8679 +8680 +8681 +8682 +8683 +8684 +8685 +8686 +8687 +8688 +8689 +8690 +8691 +8692 +8693 +8694 +8695 +8696 +8697 +8700 +8701 +8702 +8703 +8704 +8705 +8712 +8713 +8714 +8715 +8716 +8717 +8718 +8719 +8720 +8721 +8722 +8723 +8724 +8725 +8726 +8727 +8728 +8729 +8730 +8731 +8732 +8733 +8734 +8735 +8736 +8737 +8738 +8739 +8740 +8741 +8742 +8743 +8744 +8745 +8746 +8747 +8748 +8749 +8750 +8751 +8752 +8753 +8754 +8755 +8756 +8757 +8758 +8759 +8760 +8761 +8762 +8763 +8764 +8765 +8766 +8767 +8768 +8769 +8770 +8771 +8772 +8773 +8774 +8787 +8788 +8789 +8790 +8791 +8792 +8793 +8794 +8795 +8796 +8797 +8798 +8799 +8800 +8801 +8802 +8803 +8804 +8805 +8806 +8807 +8808 +8809 +8810 +8811 +8812 +8813 +8814 +8815 +8816 +8817 +8818 +8819 +8820 +8821 +8822 +8823 +8824 +8825 +8826 +8827 +8828 +8829 +8830 +8831 +8832 +8833 +8834 +8835 +8836 +8837 +8838 +8839 +8840 +8841 +8842 +8843 +8844 +8845 +8846 +8847 +8862 +8863 +8864 +8865 +8866 +8867 +8868 +8869 +8870 +8871 +8872 +8873 +8874 +8875 +8876 +8877 +8878 +8879 +8880 +8881 +8882 +8883 +8884 +8885 +8886 +8887 +8888 +8889 +8890 +8891 +8892 +8893 +8894 +8895 +8896 +8897 +8898 +8899 +8900 +8901 +8902 +8903 +8904 +8905 +8906 +8907 +8908 +8909 +8910 +8911 +8912 +8913 +8914 +8915 +8916 +8917 +8937 +8938 +8939 +8940 +8941 +8942 +8943 +8944 +8945 +8946 +8947 +8948 +8949 +8950 +8951 +8952 +8953 +8954 +8955 +8956 +8957 +8958 +8959 +8960 +8961 +8962 +8963 +8964 +8965 +8966 +8967 +8968 +8969 +8970 +8971 +8972 +8973 +8974 +8975 +8976 +8977 +8978 +8979 +8980 +8981 +8982 +8983 +8984 +8985 +8986 +8987 +8988 +9012 +9013 +9014 +9015 +9016 +9017 +9018 +9019 +9020 +9021 +9022 +9023 +9024 +9025 +9026 +9027 +9028 +9029 +9030 +9031 +9032 +9033 +9034 +9035 +9036 +9037 +9038 +9039 +9040 +9041 +9042 +9043 +9044 +9045 +9046 +9047 +9048 +9049 +9050 +9051 +9052 +9053 +9054 +9055 +9056 +9057 +9058 +9059 +9087 +9088 +9089 +9090 +9091 +9092 +9093 +9094 +9095 +9096 +9097 +9098 +9099 +9100 +9101 +9102 +9103 +9104 +9105 +9106 +9107 +9108 +9109 +9110 +9111 +9112 +9113 +9114 +9115 +9116 +9117 +9118 +9119 +9120 +9121 +9122 +9123 +9124 +9125 +9126 +9127 +9128 +9129 +9130 +9162 +9163 +9164 +9165 +9166 +9167 +9168 +9169 +9170 +9171 +9172 +9173 +9174 +9175 +9176 +9177 +9178 +9179 +9180 +9181 +9182 +9183 +9184 +9185 +9186 +9187 +9188 +9189 +9190 +9191 +9192 +9193 +9194 +9195 +9196 +9197 +9198 +9199 +9200 +9201 +9202 +9237 +9238 +9239 +9240 +9241 +9242 +9243 +9244 +9245 +9246 +9247 +9248 +9249 +9250 +9251 +9252 +9253 +9254 +9255 +9256 +9257 +9258 +9259 +9260 +9261 +9262 +9263 +9264 +9265 +9266 +9267 +9268 +9269 +9270 +9271 +9272 +9273 +9274 +9312 +9313 +9314 +9315 +9316 +9317 +9318 +9319 +9320 +9321 +9322 +9323 +9324 +9325 +9326 +9327 +9328 +9329 +9330 +9331 +9332 +9333 +9334 +9335 +9336 +9337 +9338 +9339 +9340 +9341 +9342 +9343 +9344 +9345 +9387 +9388 +9389 +9390 +9391 +9392 +9393 +9394 +9395 +9396 +9397 +9398 +9399 +9400 +9401 +9402 +9403 +9404 +9405 +9406 +9407 +9408 +9409 +9410 +9411 +9412 +9413 +9414 +9415 +9416 +9417 +9462 +9463 +9464 +9465 +9466 +9467 +9468 +9469 +9470 +9471 +9472 +9473 +9474 +9475 +9476 +9477 +9478 +9479 +9480 +9481 +9482 +9483 +9484 +9485 +9486 +9487 +9488 +9489 +9537 +9538 +9539 +9540 +9541 +9542 +9543 +9544 +9545 +9546 +9547 +9548 +9549 +9550 +9551 +9552 +9553 +9554 +9555 +9556 +9557 +9558 +9559 +9560 +9561 +9612 +9613 +9614 +9615 +9616 +9617 +9618 +9619 +9620 +9621 +9622 +9623 +9624 +9625 +9626 +9627 +9628 +9629 +9630 +9631 +9632 +9687 +9688 +9689 +9690 +9691 +9692 +9693 +9694 +9695 +9696 +9697 +9698 +9699 +9700 +9701 +9702 +9703 +9762 +9763 +9764 +9765 +9766 +9767 +9768 +9769 +9770 +9771 +9772 +9773 +9774 +9837 +9838 +9839 +9840 +9841 +9842 +9843 +9844 +9912 +9913 +10544 +10545 +10546 +10547 +10548 +10549 +10550 +10551 +10552 +10553 +10554 +10555 +10556 +10557 +10558 +10559 +10560 +10561 +10562 +10563 +10564 +10565 +10566 +10567 +10568 +10569 +10570 +10571 +10572 +10573 +10574 +10575 +10576 +10577 +10578 +10579 +10580 +10581 +10582 +10583 +10584 +10585 +10586 +10587 +10588 +10589 +10590 +10591 +10592 +10593 +10594 +10595 +10596 +10597 +10598 +10599 +10600 +10601 +10602 +10603 +10604 +10605 +10606 +10607 +10608 +10609 +10610 +10611 +10612 +10613 +10614 +10615 +10616 +10617 +10618 +10619 +10620 +10621 +10622 +10623 +10624 +10625 +10626 +10627 +10628 +10629 +10630 +10631 +10632 +10633 +10634 +10635 +10636 +10637 +10638 +10639 +10640 +10641 +10642 +10643 +10644 +10645 +10646 +10647 +10648 +10649 +10650 +10651 +10652 +10653 +10654 +10655 +10656 +10657 +10658 +10659 +10660 +10661 +10662 +10663 +10664 +10665 +10666 +10667 +10668 +10669 +10670 +10671 +10672 +10673 +10674 +10675 +10676 +10677 +10678 +10679 +10680 +10681 +10682 +10683 +10684 +10685 +10686 +10687 +10688 +10689 +10690 +10691 +10692 +10693 +10694 +10695 +10696 +10697 +10698 +10699 +10700 +10701 +10702 +10703 +10704 +10705 +10706 +10707 +10708 +10709 +10710 +10711 +10712 +10713 +10714 +10715 +10716 +10717 +10718 +10719 +10720 +10721 +10722 +10723 +10724 +10725 +10726 +10727 +10728 +10729 +10730 +10731 +10732 +10733 +10734 +10735 +10736 +10737 +10738 +10739 +10740 +10741 +10742 +10743 +10744 +10745 +10746 +10747 +10748 +10749 +10750 +10751 +10752 +10753 +10754 +10755 +10756 +10757 +10758 +10759 +10760 +10761 +10762 +10763 +10764 +10765 +10766 +10767 +10768 +10769 +10770 +10771 +10772 +10773 +10774 +10775 +10776 +10777 +10778 +10779 +10780 +10781 +10782 +10783 +10784 +10785 +10786 +10787 +10788 +10789 +10790 +10791 +10792 +10793 +10794 +10795 +10796 +10797 +10798 +10799 +10800 +10801 +10802 +10803 +10804 +10805 +10806 +10807 +10808 +10809 +10810 +10811 +10812 +10813 +10814 +10815 +10816 +10817 +10818 +10819 +10820 +10821 +10822 +10823 +10824 +10825 +10826 +10827 +10828 +10829 +10830 +10831 +10832 +10833 +10834 +10835 +10836 +10837 +10838 +10839 +10840 +10841 +10842 +10843 +10844 +10845 +10846 +10847 +10848 +10849 +10850 +10851 +10852 +10853 +10854 +10855 +10856 +10857 +10858 +10859 +10860 +10861 +10862 +10863 +10864 +10865 +10866 +10867 +10868 +10869 +10870 +10871 +10872 +10873 +10874 +10875 +10876 +10877 +10878 +10879 +10880 +10881 +10882 +10883 +10884 +10885 +10886 +10887 +10888 +10889 +10890 +10891 +10892 +10893 +10894 +10895 +10896 +10897 +10898 +10899 +10900 +10901 +10902 +10903 +10904 +10905 +10906 +10907 +10908 +10909 +10910 +10911 +10912 +10913 +10914 +10915 +10916 +10917 +10918 +10919 +10920 +10921 +10922 +10923 +10924 +10925 +10926 +10927 +10928 +10929 +10930 +10931 +10932 +10933 +10934 +10935 +10936 +10937 +10938 +10939 +10940 +10941 +10942 +10943 +10944 +10945 +10946 +10947 +10948 +10949 +10950 +10951 +10952 +10953 +10954 +10955 +10956 +10957 +10958 +10959 +10960 +10961 +10962 +10963 +10964 +10965 +10966 +10967 +10968 +10969 +10970 +10971 +10972 +10973 +10974 +10975 +10976 +10977 +10978 +10979 +10980 +10981 +10982 +10983 +10984 +10985 +10986 +10987 +10988 +10989 +10990 +10991 +10992 +10993 +10994 +10995 +10996 +10997 +10998 +10999 +11000 +11001 +11002 +11003 +11004 +11005 +11006 +11007 +11008 +11009 +11010 +11011 +11012 +11013 +11014 +11015 +11016 +11017 +11018 +11019 +11020 +11021 +11022 +11023 +11024 +11025 +11026 +11027 +11028 +11029 +11030 +11031 +11032 +11033 +11034 +11035 +11036 +11037 +11038 +11039 +11040 +11041 +11042 +11043 +11044 +11045 +11046 +11047 +11048 +11049 +11050 +11051 +11052 +11053 +11054 +11055 +11056 +11057 +11058 +11059 +11060 +11061 +11062 +11063 +11064 +11065 +11066 +11067 +11068 +11069 +11070 +11071 +11072 +11073 +11074 +11075 +11076 +11077 +11078 +11079 +11080 +11081 +11082 +11083 +11084 +11085 +11086 +11087 +11088 +11089 +11090 +11091 +11092 +11093 +11094 +11095 +11096 +11097 +11098 +11099 +11100 +11101 +11102 +11103 +11104 +11105 +11106 +11107 +11108 +11109 +11110 +11111 +11112 +11113 +11114 +11115 +11116 +11117 +11118 +11119 +11120 +11121 +11122 +11123 +11124 +11125 +11126 +11127 +11128 +11129 +11130 +11131 +11132 +11133 +11134 +11135 +11136 +11137 +11138 +11139 +11140 +11141 +11142 +11143 +11144 +11145 +11146 +11147 +11148 +11149 +11150 +11151 +11152 +11153 +11154 +11155 +11156 +11157 +11158 +11159 +11160 +11161 +11162 +11163 +11164 +11165 +11166 +11167 +11168 +11169 +11170 +11171 +11172 +11173 +11174 +11175 +11176 +11177 +11178 +11179 +11180 +11181 +11182 +11183 +11184 +11185 +11186 +11187 +11188 +11189 +11190 +11191 +11192 +11193 +11194 +11195 +11196 +11197 +11198 +11199 +11200 +11201 +11202 +11203 +11204 +11205 +11206 +11207 +11208 +11209 +11210 +11211 +11212 +11213 +11214 +11215 +11216 +11217 +11218 +11219 +11220 +11221 +11222 +11223 +11224 +11225 +11226 +11227 +11228 +11229 +11230 +11231 +11232 +11233 +11234 +11235 +11236 +11237 +11238 +11239 +11240 +11241 +11242 +11243 +11244 +11245 +11246 +11247 +11248 +11249 +11250 +11251 +11252 +11253 +11254 +11255 +11256 +11257 +11258 +11259 +11260 +11261 +11262 +11263 +11264 +11265 +11266 +11267 +11268 +11269 +11270 +11271 +11272 +11273 +11274 +11275 +11276 +11277 +11278 +11279 +11280 +11281 +11282 +11283 +11284 +11285 +11286 +11287 +11288 +11289 +11290 +11291 +11292 +11293 +11294 +11295 +11296 +11297 +11298 +11299 +11300 +11301 +11302 +11303 +11304 +11305 +11306 +11307 +11308 +11309 +11310 +11311 +11312 +11313 +11314 +11315 +11316 +11317 +11318 +11319 +11320 +11321 +11322 +11323 +11324 +11325 +11326 +11327 +11328 +11329 +11330 +11331 +11332 +11333 +11334 +11335 +11336 +11337 +11338 +11339 +11340 +11341 +11342 +11343 +11344 +11345 +11346 +11347 +11348 +11349 +11350 +11351 +11352 +11353 +11354 +11355 +11356 +11357 +11358 +11359 +11360 +11361 +11362 +11363 +11364 +11365 +11366 +11367 +11368 +11369 +11370 +11371 +11372 +11373 +11374 +11375 +11376 +11377 +11378 +11379 +11380 +11381 +11382 +11383 +11384 +11385 +11386 +11387 +11388 +11389 +11390 +11391 +11392 +11393 +11394 +11395 +11396 +11397 +11398 +11399 +11400 +11401 +11402 +11403 +11404 +11405 +11406 +11407 +11408 +11409 +11410 +11411 +11412 +11413 +11414 +11415 +11416 +11417 +11418 +11419 +11420 +11421 +11422 +11423 +11424 +11425 +11426 +11427 +11428 +11429 +11430 +11431 +11432 +11433 +11434 +11435 +11436 +11437 +11438 +11439 +11440 +11441 +11442 +11443 +11444 +11445 +11446 +11447 +11448 +11449 +11450 +11451 +11452 +11453 +11454 +11455 +11456 +11457 +11458 +11459 +11460 +11461 +11462 +11463 +11464 +11465 +11466 +11467 +11468 +11469 +11470 +11471 +11472 +11473 +11474 +11475 +11476 +11477 +11478 +11479 +11480 +11481 +11482 +11483 +11484 +11485 +11486 +11487 +11488 +11489 +11490 +11491 +11492 +11493 +11494 +11495 +11496 +11497 +11498 +11499 +11500 +11501 +11502 +11503 +11504 +11505 +11506 +11507 +11508 +11509 +11510 +11511 +11512 +11513 +11514 +11515 +11516 +11517 +11518 +11519 +11520 +11521 +11522 +11523 +11524 +11525 +11526 +11527 +11528 +11529 +11530 +11531 +11532 +11533 +11534 +11535 +11536 +11537 +11538 +11539 +11540 +11541 +11542 +11543 +11544 +11545 +11546 +11547 +11548 +11549 +11550 +11551 +11552 +11553 +11554 +11555 +11556 +11557 +11558 +11559 +11560 +11561 +11562 +11563 +11564 +11565 +11566 +11567 +11568 +11569 +11570 +11571 +11572 +11573 +11574 +11575 +11576 +11577 +11578 +11579 +11580 +11581 +11582 +11583 +11584 +11585 +11586 +11587 +11588 +11589 +11590 +11591 +11592 +11593 +11594 +11595 +11596 +11597 +11598 +11599 +11600 +11601 +11602 +11603 +11604 +11605 +11606 +11607 +11608 +11609 +11610 +11611 +11612 +11613 +11614 +11615 +11616 +11617 +11618 +11619 +11620 +11621 +11622 +11623 +11624 +11625 +11626 +11627 +11628 +11629 +11630 +11631 +11632 +11633 +11634 +11635 +11636 +11637 +11638 +11639 +11640 +11641 +11642 +11643 +11644 +11645 +11646 +11647 +11648 +11649 +11650 +11651 +11652 +11653 +11654 +11655 +11656 +11657 +11658 +11659 +11660 +11661 +11662 +11663 +11664 +11665 +11666 +11667 +11668 +11669 +11670 +11671 +11672 +11673 +11674 +11675 +11676 +11677 +11678 +11679 +11680 +11681 +11682 +11683 +11684 +11685 +11686 +11687 +11688 +11689 +11690 +11691 +11692 +11693 +11694 +11695 +11696 +11697 +11698 +11699 +11700 +11701 +11702 +11703 +11704 +11705 +11706 +11707 +11708 +11709 +11710 +11711 +11712 +11713 +11714 +11715 +11716 +11717 +11718 +11719 +11720 +11721 +11722 +11723 +11724 +11725 +11726 +11727 +11728 +11729 +11730 +11731 +11732 +11733 +11734 +11742 +11743 +11744 +11745 +11746 +11747 +11748 +11749 +11750 +11751 +11752 +11753 +11754 +11755 +11756 +11757 +11758 +11759 +11760 +11761 +11762 +11763 +11764 +11765 +11766 +11767 +11768 +11769 +11770 +11771 +11772 +11773 +11774 +11775 +11776 +11777 +11778 +11779 +11780 +11781 +11782 +11783 +11784 +11785 +11786 +11787 +11788 +11789 +11790 +11791 +11792 +11793 +11794 +11795 +11796 +11797 +11798 +11799 +11800 +11801 +11802 +11803 +11804 +11817 +11818 +11819 +11820 +11821 +11822 +11823 +11824 +11825 +11826 +11827 +11828 +11829 +11830 +11831 +11832 +11833 +11834 +11835 +11836 +11837 +11838 +11839 +11840 +11841 +11842 +11843 +11844 +11845 +11846 +11847 +11848 +11849 +11850 +11851 +11852 +11853 +11854 +11855 +11856 +11857 +11858 +11859 +11860 +11861 +11862 +11863 +11864 +11865 +11866 +11867 +11868 +11869 +11870 +11871 +11872 +11873 +11874 +11892 +11893 +11894 +11895 +11896 +11897 +11898 +11899 +11900 +11901 +11902 +11903 +11904 +11905 +11906 +11907 +11908 +11909 +11910 +11911 +11912 +11913 +11914 +11915 +11916 +11917 +11918 +11919 +11920 +11921 +11922 +11923 +11924 +11925 +11926 +11927 +11928 +11929 +11930 +11931 +11932 +11933 +11934 +11935 +11936 +11937 +11938 +11939 +11940 +11941 +11942 +11943 +11944 +11945 +11967 +11968 +11969 +11970 +11971 +11972 +11973 +11974 +11975 +11976 +11977 +11978 +11979 +11980 +11981 +11982 +11983 +11984 +11985 +11986 +11987 +11988 +11989 +11990 +11991 +11992 +11993 +11994 +11995 +11996 +11997 +11998 +11999 +12000 +12001 +12002 +12003 +12004 +12005 +12006 +12007 +12008 +12009 +12010 +12011 +12012 +12013 +12014 +12015 +12016 +12042 +12043 +12044 +12045 +12046 +12047 +12048 +12049 +12050 +12051 +12052 +12053 +12054 +12055 +12056 +12057 +12058 +12059 +12060 +12061 +12062 +12063 +12064 +12065 +12066 +12067 +12068 +12069 +12070 +12071 +12072 +12073 +12074 +12075 +12076 +12077 +12078 +12079 +12080 +12081 +12082 +12083 +12084 +12085 +12086 +12087 +12117 +12118 +12119 +12120 +12121 +12122 +12123 +12124 +12125 +12126 +12127 +12128 +12129 +12130 +12131 +12132 +12133 +12134 +12135 +12136 +12137 +12138 +12139 +12140 +12141 +12142 +12143 +12144 +12145 +12146 +12147 +12148 +12149 +12150 +12151 +12152 +12153 +12154 +12155 +12156 +12157 +12158 +12192 +12193 +12194 +12195 +12196 +12197 +12198 +12199 +12200 +12201 +12202 +12203 +12204 +12205 +12206 +12207 +12208 +12209 +12210 +12211 +12212 +12213 +12214 +12215 +12216 +12217 +12218 +12219 +12220 +12221 +12222 +12223 +12224 +12225 +12226 +12227 +12228 +12229 +12230 +12267 +12268 +12269 +12270 +12271 +12272 +12273 +12274 +12275 +12276 +12277 +12278 +12279 +12280 +12281 +12282 +12283 +12284 +12285 +12286 +12287 +12288 +12289 +12290 +12291 +12292 +12293 +12294 +12295 +12296 +12297 +12298 +12299 +12300 +12301 +12302 +12342 +12343 +12344 +12345 +12346 +12347 +12348 +12349 +12350 +12351 +12352 +12353 +12354 +12355 +12356 +12357 +12358 +12359 +12360 +12361 +12362 +12363 +12364 +12365 +12366 +12367 +12368 +12369 +12370 +12371 +12372 +12373 +12374 +12417 +12418 +12419 +12420 +12421 +12422 +12423 +12424 +12425 +12426 +12427 +12428 +12429 +12430 +12431 +12432 +12433 +12434 +12435 +12436 +12437 +12438 +12439 +12440 +12441 +12442 +12443 +12444 +12445 +12446 +12492 +12493 +12494 +12495 +12496 +12497 +12498 +12499 +12500 +12501 +12502 +12503 +12504 +12505 +12506 +12507 +12508 +12509 +12510 +12511 +12512 +12513 +12514 +12515 +12516 +12517 +12567 +12568 +12569 +12570 +12571 +12572 +12573 +12574 +12575 +12576 +12577 +12578 +12579 +12580 +12581 +12582 +12583 +12584 +12585 +12586 +12587 +12588 +12589 +12642 +12643 +12644 +12645 +12646 +12647 +12648 +12649 +12650 +12651 +12652 +12653 +12654 +12655 +12656 +12657 +12658 +12659 +12660 +12717 +12718 +12719 +12720 +12721 +12722 +12723 +12724 +12725 +12726 +12727 +12728 +12729 +12730 +12731 +12792 +12793 +12794 +12795 +12796 +12797 +12798 +12799 +12800 +12801 +12867 +12868 +12869 +12870 +12871 +13534 +13535 +13536 +13537 +13538 +13539 +13540 +13541 +13542 +13543 +13544 +13545 +13546 +13547 +13548 +13549 +13550 +13551 +13552 +13553 +13554 +13555 +13556 +13557 +13558 +13559 +13560 +13561 +13562 +13563 +13564 +13565 +13566 +13567 +13568 +13569 +13570 +13571 +13572 +13573 +13574 +13575 +13576 +13577 +13578 +13579 +13580 +13581 +13582 +13583 +13584 +13585 +13586 +13587 +13588 +13589 +13590 +13591 +13592 +13593 +13594 +13595 +13596 +13597 +13598 +13599 +13600 +13601 +13602 +13603 +13604 +13605 +13606 +13607 +13608 +13609 +13610 +13611 +13612 +13613 +13614 +13615 +13616 +13617 +13618 +13619 +13620 +13621 +13622 +13623 +13624 +13625 +13626 +13627 +13628 +13629 +13630 +13631 +13632 +13633 +13634 +13635 +13636 +13637 +13638 +13639 +13640 +13641 +13642 +13643 +13644 +13645 +13646 +13647 +13648 +13649 +13650 +13651 +13652 +13653 +13654 +13655 +13656 +13657 +13658 +13659 +13660 +13661 +13662 +13663 +13664 +13665 +13666 +13667 +13668 +13669 +13670 +13671 +13672 +13673 +13674 +13675 +13676 +13677 +13678 +13679 +13680 +13681 +13682 +13683 +13684 +13685 +13686 +13687 +13688 +13689 +13690 +13691 +13692 +13693 +13694 +13695 +13696 +13697 +13698 +13699 +13700 +13701 +13702 +13703 +13704 +13705 +13706 +13707 +13708 +13709 +13710 +13711 +13712 +13713 +13714 +13715 +13716 +13717 +13718 +13719 +13720 +13721 +13722 +13723 +13724 +13725 +13726 +13727 +13728 +13729 +13730 +13731 +13732 +13733 +13734 +13735 +13736 +13737 +13738 +13739 +13740 +13741 +13742 +13743 +13744 +13745 +13746 +13747 +13748 +13749 +13750 +13751 +13752 +13753 +13754 +13755 +13756 +13757 +13758 +13759 +13760 +13761 +13762 +13763 +13764 +13765 +13766 +13767 +13768 +13769 +13770 +13771 +13772 +13773 +13774 +13775 +13776 +13777 +13778 +13779 +13780 +13781 +13782 +13783 +13784 +13785 +13786 +13787 +13788 +13789 +13790 +13791 +13792 +13793 +13794 +13795 +13796 +13797 +13798 +13799 +13800 +13801 +13802 +13803 +13804 +13805 +13806 +13807 +13808 +13809 +13810 +13811 +13812 +13813 +13814 +13815 +13816 +13817 +13818 +13819 +13820 +13821 +13822 +13823 +13824 +13825 +13826 +13827 +13828 +13829 +13830 +13831 +13832 +13833 +13834 +13835 +13836 +13837 +13838 +13839 +13840 +13841 +13842 +13843 +13844 +13845 +13846 +13847 +13848 +13849 +13850 +13851 +13852 +13853 +13854 +13855 +13856 +13857 +13858 +13859 +13860 +13861 +13862 +13863 +13864 +13865 +13866 +13867 +13868 +13869 +13870 +13871 +13872 +13873 +13874 +13875 +13876 +13877 +13878 +13879 +13880 +13881 +13882 +13883 +13884 +13885 +13886 +13887 +13888 +13889 +13890 +13891 +13892 +13893 +13894 +13895 +13896 +13897 +13898 +13899 +13900 +13901 +13902 +13903 +13904 +13905 +13906 +13907 +13908 +13909 +13910 +13911 +13912 +13913 +13914 +13915 +13916 +13917 +13918 +13919 +13920 +13921 +13922 +13923 +13924 +13925 +13926 +13927 +13928 +13929 +13930 +13931 +13932 +13933 +13934 +13935 +13936 +13937 +13938 +13939 +13940 +13941 +13942 +13943 +13944 +13945 +13946 +13947 +13948 +13949 +13950 +13951 +13952 +13953 +13954 +13955 +13956 +13957 +13958 +13959 +13960 +13961 +13962 +13963 +13964 +13965 +13966 +13967 +13968 +13969 +13970 +13971 +13972 +13973 +13974 +13975 +13976 +13977 +13978 +13979 +13980 +13981 +13982 +13983 +13984 +13985 +13986 +13987 +13988 +13989 +13990 +13991 +13992 +13993 +13994 +13995 +13996 +13997 +13998 +13999 +14000 +14001 +14002 +14003 +14004 +14005 +14006 +14007 +14008 +14009 +14010 +14011 +14012 +14013 +14014 +14015 +14016 +14017 +14018 +14019 +14020 +14021 +14022 +14023 +14024 +14025 +14026 +14027 +14028 +14029 +14030 +14031 +14032 +14033 +14034 +14035 +14036 +14037 +14038 +14039 +14040 +14041 +14042 +14043 +14044 +14045 +14046 +14047 +14048 +14049 +14050 +14051 +14052 +14053 +14054 +14055 +14056 +14057 +14058 +14059 +14060 +14061 +14062 +14063 +14064 +14065 +14066 +14067 +14068 +14069 +14070 +14071 +14072 +14073 +14074 +14075 +14076 +14077 +14078 +14079 +14080 +14081 +14082 +14083 +14084 +14085 +14086 +14087 +14088 +14089 +14090 +14091 +14092 +14093 +14094 +14095 +14096 +14097 +14098 +14099 +14100 +14101 +14102 +14103 +14104 +14105 +14106 +14107 +14108 +14109 +14110 +14111 +14112 +14113 +14114 +14115 +14116 +14117 +14118 +14119 +14120 +14121 +14122 +14123 +14124 +14125 +14126 +14127 +14128 +14129 +14130 +14131 +14132 +14133 +14134 +14135 +14136 +14137 +14138 +14139 +14140 +14141 +14142 +14143 +14144 +14145 +14146 +14147 +14148 +14149 +14150 +14151 +14152 +14153 +14154 +14155 +14156 +14157 +14158 +14159 +14160 +14161 +14162 +14163 +14164 +14165 +14166 +14167 +14168 +14169 +14170 +14171 +14172 +14173 +14174 +14175 +14176 +14177 +14178 +14179 +14180 +14181 +14182 +14183 +14184 +14185 +14186 +14187 +14188 +14189 +14190 +14191 +14192 +14193 +14194 +14195 +14196 +14197 +14198 +14199 +14200 +14201 +14202 +14203 +14204 +14205 +14206 +14207 +14208 +14209 +14210 +14211 +14212 +14213 +14214 +14215 +14216 +14217 +14218 +14219 +14220 +14221 +14222 +14223 +14224 +14225 +14226 +14227 +14228 +14229 +14230 +14231 +14232 +14233 +14234 +14235 +14236 +14237 +14238 +14239 +14240 +14241 +14242 +14243 +14244 +14245 +14246 +14247 +14248 +14249 +14250 +14251 +14252 +14253 +14254 +14255 +14256 +14257 +14258 +14259 +14260 +14261 +14262 +14263 +14264 +14265 +14266 +14267 +14268 +14269 +14270 +14271 +14272 +14273 +14274 +14275 +14276 +14277 +14278 +14279 +14280 +14281 +14282 +14283 +14284 +14285 +14286 +14287 +14288 +14289 +14290 +14291 +14292 +14293 +14294 +14295 +14296 +14297 +14298 +14299 +14300 +14301 +14302 +14303 +14304 +14305 +14306 +14307 +14308 +14309 +14310 +14311 +14312 +14313 +14314 +14315 +14316 +14317 +14318 +14319 +14320 +14321 +14322 +14323 +14324 +14325 +14326 +14327 +14328 +14329 +14330 +14331 +14332 +14333 +14334 +14335 +14336 +14337 +14338 +14339 +14340 +14341 +14342 +14343 +14344 +14345 +14346 +14347 +14348 +14349 +14350 +14351 +14352 +14353 +14354 +14355 +14356 +14357 +14358 +14359 +14360 +14361 +14362 +14363 +14364 +14365 +14366 +14367 +14368 +14369 +14370 +14371 +14372 +14373 +14374 +14375 +14376 +14377 +14378 +14379 +14380 +14381 +14382 +14383 +14384 +14385 +14386 +14387 +14388 +14389 +14390 +14391 +14392 +14393 +14394 +14395 +14396 +14397 +14398 +14399 +14400 +14401 +14402 +14403 +14404 +14405 +14406 +14407 +14408 +14409 +14410 +14411 +14412 +14413 +14414 +14415 +14416 +14417 +14418 +14419 +14420 +14421 +14422 +14423 +14424 +14425 +14426 +14427 +14428 +14429 +14430 +14431 +14432 +14433 +14434 +14435 +14436 +14437 +14438 +14439 +14440 +14441 +14442 +14443 +14444 +14445 +14446 +14447 +14448 +14449 +14450 +14451 +14452 +14453 +14454 +14455 +14456 +14457 +14458 +14459 +14460 +14461 +14462 +14463 +14464 +14465 +14466 +14467 +14468 +14469 +14470 +14471 +14472 +14473 +14474 +14475 +14476 +14477 +14478 +14479 +14480 +14481 +14482 +14483 +14484 +14485 +14486 +14487 +14488 +14489 +14490 +14491 +14492 +14493 +14494 +14495 +14496 +14497 +14498 +14499 +14500 +14501 +14502 +14503 +14504 +14505 +14506 +14507 +14508 +14509 +14510 +14511 +14512 +14513 +14514 +14515 +14516 +14517 +14518 +14519 +14520 +14521 +14522 +14523 +14524 +14525 +14526 +14527 +14528 +14529 +14530 +14531 +14532 +14533 +14534 +14535 +14536 +14537 +14538 +14539 +14540 +14541 +14542 +14543 +14544 +14545 +14546 +14547 +14548 +14549 +14550 +14551 +14552 +14553 +14554 +14555 +14556 +14557 +14558 +14559 +14560 +14561 +14562 +14563 +14564 +14565 +14566 +14567 +14568 +14569 +14570 +14571 +14572 +14573 +14574 +14575 +14576 +14577 +14578 +14579 +14580 +14581 +14582 +14583 +14584 +14585 +14586 +14587 +14588 +14589 +14590 +14591 +14592 +14593 +14594 +14595 +14596 +14597 +14598 +14599 +14600 +14601 +14602 +14603 +14604 +14605 +14606 +14607 +14608 +14609 +14610 +14611 +14612 +14613 +14614 +14615 +14616 +14617 +14618 +14619 +14620 +14621 +14622 +14623 +14624 +14625 +14626 +14627 +14628 +14629 +14630 +14631 +14632 +14633 +14634 +14635 +14636 +14637 +14638 +14639 +14640 +14641 +14642 +14643 +14644 +14645 +14646 +14647 +14648 +14649 +14650 +14651 +14652 +14653 +14654 +14655 +14656 +14657 +14658 +14659 +14660 +14661 +14662 +14663 +14664 +14665 +14666 +14667 +14668 +14669 +14670 +14671 +14672 +14673 +14674 +14675 +14676 +14677 +14678 +14679 +14680 +14681 +14682 +14683 +14684 +14685 +14686 +14687 +14688 +14689 +14690 +14691 +14692 +14693 +14694 +14695 +14696 +14697 +14698 +14699 +14700 +14701 +14702 +14703 +14704 +14705 +14706 +14707 +14708 +14709 +14710 +14711 +14712 +14713 +14714 +14715 +14716 +14717 +14718 +14719 +14720 +14721 +14722 +14723 +14724 +14725 +14726 +14727 +14728 +14729 +14730 +14731 +14732 +14733 +14734 +14735 +14736 +14737 +14738 +14739 +14740 +14741 +14742 +14743 +14744 +14745 +14746 +14747 +14748 +14749 +14750 +14751 +14752 +14753 +14754 +14755 +14756 +14757 +14758 +14759 +14760 +14761 +14762 +14763 +14764 +14765 +14766 +14767 +14768 +14769 +14770 +14771 +14772 +14773 +14774 +14775 +14776 +14777 +14778 +14779 +14780 +14781 +14782 +14783 +14784 +14785 +14786 +14787 +14788 +14789 +14790 +14791 +14792 +14793 +14794 +14795 +14796 +14797 +14798 +14799 +14800 +14801 +14802 +14803 +14804 +14805 +14806 +14807 +14808 +14809 +14810 +14811 +14812 +14813 +14814 +14815 +14816 +14817 +14818 +14819 +14820 +14821 +14822 +14823 +14824 +14825 +14826 +14827 +14828 +14829 +14830 +14831 +14832 +14833 +14834 +14835 +14836 +14837 +14838 +14839 +14840 +14841 +14842 +14843 +14844 +14845 +14846 +14847 +14848 +14849 +14850 +14851 +14852 +14853 +14854 +14855 +14856 +14857 +14858 +14859 +14860 +14861 +14862 +14863 +14864 +14865 +14866 +14867 +14868 +14869 +14870 +14871 +14872 +14873 +14874 +14875 +14876 +14877 +14878 +14879 +14880 +14881 +14882 +14883 +14884 +14885 +14886 +14887 +14888 +14889 +14890 +14891 +14892 +14893 +14894 +14895 +14896 +14897 +14898 +14899 +14900 +14901 +14902 +14903 +14904 +14905 +14906 +14907 +14908 +14909 +14910 +14911 +14912 +14913 +14914 +14915 +14916 +14917 +14918 +14919 +14920 +14921 +14922 +14923 +14924 +14925 +14926 +14927 +14928 +14929 +14930 +14931 +14932 +14933 +14934 +14935 +14936 +14937 +14938 +14939 +14940 +14941 +14942 +14943 +14944 +14945 +14946 +14947 +14948 +14949 +14950 +14951 +14952 +14953 +14954 +14955 +14956 +14957 +14958 +14959 +14960 +14961 +14962 +14963 +14964 +14965 +14966 +14967 +14968 +14969 +14970 +14971 +14972 +14973 +14974 +14975 +14976 +14977 +14978 +14979 +14980 +14981 +14982 +14983 +14984 +14985 +14986 +14987 +14988 +14989 +14990 +14991 +14992 +14993 +14994 +14995 +14996 +14997 +14998 +14999 +15000 +15001 +15002 +15003 +15004 +15005 +15006 +15007 +15008 +15009 +15010 +15011 +15012 +15013 +15014 +15015 +15016 +15017 +15018 +15019 +15020 +15021 +15022 +15023 +15024 +15025 +15026 +15027 +15028 +15029 +15030 +15031 +15032 +15033 +15034 +15035 +15036 +15037 +15038 +15039 +15040 +15041 +15042 +15043 +15044 +15045 +15046 +15047 +15048 +15049 +15050 +15051 +15052 +15053 +15054 +15055 +15056 +15057 +15058 +15059 +15060 +15061 +15062 +15063 +15064 +15065 +15066 +15067 +15068 +15069 +15070 +15071 +15072 +15073 +15074 +15075 +15076 +15077 +15078 +15079 +15080 +15081 +15082 +15083 +15084 +15085 +15086 +15087 +15088 +15089 +15090 +15091 +15092 +15093 +15094 +15095 +15096 +15097 +15098 +15099 +15100 +15101 +15102 +15103 +15104 +15105 +15106 +15107 +15108 +15109 +15110 +15111 +15112 +15113 +15114 +15115 +15116 +15117 +15118 +15119 +15120 +15121 +15122 +15123 +15124 +15125 +15126 +15127 +15128 +15129 +15130 +15131 +15132 +15133 +15134 +15135 +15136 +15137 +15138 +15139 +15140 +15141 +15142 +15143 +15144 +15145 +15146 +15147 +15148 +15149 +15150 +15151 +15152 +15153 +15154 +15155 +15156 +15157 +15158 +15159 +15160 +15161 +15162 +15163 +15164 +15165 +15166 +15167 +15168 +15169 +15170 +15171 +15172 +15173 +15174 +15175 +15176 +15177 +15178 +15179 +15180 +15181 +15182 +15183 +15184 +15185 +15186 +15187 +15188 +15189 +15190 +15191 +15192 +15193 +15194 +15195 +15196 +15197 +15198 +15199 +15200 +15201 +15202 +15203 +15204 +15205 +15206 +15207 +15208 +15209 +15210 +15211 +15212 +15213 +15214 +15215 +15216 +15217 +15218 +15219 +15220 +15221 +15222 +15223 +15224 +15225 +15226 +15227 +15228 +15229 +15230 +15231 +15232 +15233 +15234 +15235 +15236 +15237 +15238 +15239 +15240 +15241 +15242 +15243 +15244 +15245 +15246 +15247 +15248 +15249 +15250 +15251 +15252 +15253 +15254 +15255 +15256 +15257 +15258 +15259 +15260 +15261 +15262 +15263 +15264 +15265 +15266 +15267 +15268 +15269 +15270 +15271 +15272 +15273 +15274 +15275 +15276 +15277 +15278 +15279 +15280 +15281 +15282 +15283 +15284 +15285 +15286 +15287 +15288 +15289 +15290 +15291 +15292 +15293 +15294 +15295 +15296 +15297 +15298 +15299 +15300 +15301 +15302 +15303 +15304 +15305 +15306 +15307 +15308 +15309 +15310 +15311 +15312 +15313 +15314 +15315 +15316 +15317 +15318 +15319 +15320 +15321 +15322 +15323 +15324 +15325 +15326 +15327 +15328 +15329 +15330 +15331 +15332 +15333 +15334 +15335 +15336 +15337 +15338 +15339 +15340 +15341 +15342 +15343 +15344 +15345 +15346 +15347 +15348 +15349 +15350 +15351 +15352 +15353 +15354 +15355 +15356 +15357 +15358 +15359 +15360 +15361 +15362 +15363 +15364 +15365 +15366 +15367 +15368 +15369 +15370 +15371 +15372 +15373 +15374 +15375 +15376 +15377 +15378 +15379 +15380 +15381 +15382 +15383 +15384 +15385 +15386 +15387 +15388 +15389 +15390 +15391 +15392 +15393 +15394 +15395 +15396 +15397 +15398 +15399 +15400 +15401 +15402 +15403 +15404 +15405 +15406 +15407 +15408 +15409 +15410 +15411 +15412 +15413 +15414 +15415 +15416 +15417 +15418 +15419 +15420 +15421 +15422 +15423 +15424 +15425 +15426 +15427 +15428 +15429 +15430 +15431 +15432 +15433 +15434 +15435 +15436 +15437 +15438 +15439 +15440 +15441 +15442 +15443 +15444 +15445 +15446 +15447 +15448 +15449 +15450 +15451 +15452 +15453 +15454 +15455 +15456 +15457 +15458 +15459 +15460 +15461 +15462 +15463 +15464 +15465 +15466 +15467 +15468 +15469 +15470 +15471 +15472 +15473 +15474 +15475 +15476 +15477 +15478 +15479 +15480 +15481 +15482 +15483 +15484 +15485 +15486 +15487 +15488 +15489 +15490 +15491 +15492 +15493 +15494 +15495 +15496 +15497 +15498 +15499 +15500 +15501 +15502 +15503 +15504 +15505 +15506 +15507 +15508 +15509 +15510 +15511 +15512 +15513 +15514 +15515 +15516 +15517 +15518 +15519 +15520 +15521 +15522 +15523 +15524 +15525 +15526 +15527 +15528 +15529 +15530 +15531 +15532 +15533 +15534 +15535 +15536 +15537 +15538 +15539 +15540 +15541 +15542 +15543 +15544 +15545 +15546 +15547 +15548 +15549 +15550 +15551 +15552 +15553 +15554 +15555 +15556 +15557 +15558 +15559 +15560 +15561 +15562 +15563 +15564 +15565 +15566 +15567 +15568 +15569 +15570 +15571 +15572 +15573 +15574 +15575 +15576 +15577 +15578 +15579 +15580 +15581 +15582 +15583 +15584 +15585 +15586 +15587 +15588 +15589 +15590 +15591 +15592 +15593 +15594 +15595 +15596 +15597 +15598 +15599 +15600 +15601 +15602 +15603 +15604 +15605 +15606 +15607 +15608 +15609 +15610 +15611 +15612 +15613 +15614 +15615 +15616 +15617 +15618 +15619 +15620 +15621 +15622 +15623 +15624 +15625 +15626 +15627 +15628 +15629 +15630 +15631 +15632 +15633 +15634 +15635 +15636 +15637 +15638 +15639 +15640 +15641 +15642 +15643 +15644 +15645 +15646 +15647 +15648 +15649 +15650 +15651 +15652 +15653 +15654 +15655 +15656 +15657 +15658 +15659 +15660 +15661 +15662 +15663 +15664 +15665 +15666 +15667 +15668 +15669 +15670 +15671 +15672 +15673 +15674 +15675 +15676 +15677 +15678 +15679 +15680 +15681 +15682 +15683 +15684 +15685 +15686 +15687 +15688 +15689 +15690 +15691 +15692 +15693 +15694 +15695 +15696 +15697 +15698 +15699 +15700 +15701 +15702 +15703 +15704 +15705 +15706 +15707 +15708 +15709 +15710 +15711 +15712 +15713 +15714 +15715 +15716 +15717 +15718 +15719 +15720 +15721 +15722 +15723 +15724 +15725 +15726 +15727 +15728 +15729 +15730 +15731 +15732 +15733 +15734 +15735 +15736 +15737 +15738 +15739 +15740 +15741 +15742 +15743 +15744 +15745 +15746 +15747 +15748 +15749 +15750 +15751 +15752 +15753 +15754 +15755 +15756 +15757 +15758 +15759 +15760 +15761 +15762 +15763 +15764 +15765 +15766 +15767 +15768 +15769 +15770 +15771 +15772 +15773 +15774 +15775 +15776 +15777 +15778 +15779 +15780 +15781 +15782 +15783 +15784 +15785 +15786 +15787 +15788 +15789 +15790 +15791 +15792 +15793 +15794 +15795 +15796 +15797 +15798 +15799 +15800 +15801 +15802 +15803 +15804 +15805 +15806 +15807 +15808 +15809 +15810 +15811 +15812 +15813 +15814 +15815 +15816 +15817 +15818 +15819 +15820 +15821 +15822 +15823 +15824 +15825 +15826 +15827 +15828 +15829 +15830 +15831 +15832 +15833 +15834 +15835 +15836 +15837 +15838 +15839 +15840 +15841 +15842 +15843 +15844 +15845 +15846 +15847 +15848 +15849 +15850 +15851 +15852 +15853 +15854 +15855 +15856 +15857 +15858 +15859 +15860 +15861 +15862 +15863 +15864 +15865 +15866 +15867 +15868 +15869 +15870 +15871 +15872 +15873 +15874 +15875 +15876 +15877 +15878 +15879 +15880 +15881 +15882 +15883 +15884 +15885 +15886 +15887 +15888 +15889 +15890 +15891 +15892 +15893 +15894 +15895 +15896 +15897 +15898 +15899 +15900 +15901 +15902 +15903 +15904 +15905 +15906 +15907 +15908 +15909 +15910 +15911 +15912 +15913 +15914 +15915 +15916 +15917 +15918 +15919 +15920 +15921 +15922 +15923 +15924 +15925 +15926 +15927 +15928 +15929 +15930 +15931 +15932 +15933 +15934 +15935 +15936 +15937 +15938 +15939 +15940 +15941 +15942 +15943 +15944 +15945 +15946 +15947 +15948 +15949 +15950 +15951 +15952 +15953 +15954 +15955 +15956 +15957 +15958 +15959 +15960 +15961 +15962 +15963 +15964 +15965 +15966 +15967 +15968 +15969 +15970 +15971 +15972 +15973 +15974 +15975 +15976 +15977 +15978 +15979 +15980 +15981 +15982 +15983 +15984 +15985 +15986 +15987 +15988 +15989 +15990 +15991 +15992 +15993 +15994 +15995 +15996 +15997 +15998 +15999 +16000 +16001 +16002 +16003 +16004 +16005 +16006 +16007 +16008 +16009 +16010 +16011 +16012 +16013 +16014 +16015 +16016 +16017 +16018 +16019 +16020 +16021 +16022 +16023 +16024 +16025 +16026 +16027 +16028 +16029 +16030 +16031 +16032 +16033 +16034 +16035 +16036 +16037 +16038 +16039 +16040 +16041 +16042 +16043 +16044 +16045 +16046 +16047 +16048 +16049 +16050 +16051 +16052 +16053 +16054 +16055 +16056 +16057 +16058 +16059 +16060 +16061 +16062 +16063 +16064 +16065 +16066 +16067 +16068 +16069 +16070 +16071 +16072 +16073 +16074 +16075 +16076 +16077 +16078 +16079 +16080 +16081 +16082 +16083 +16084 +16085 +16086 +16087 +16088 +16089 +16090 +16091 +16092 +16093 +16094 +16095 +16096 +16097 +16098 +16099 +16100 +16101 +16102 +16103 +16104 +16105 +16106 +16107 +16108 +16109 +16110 +16111 +16112 +16113 +16114 +16115 +16116 +16117 +16118 +16119 +16120 +16121 +16122 +16123 +16124 +16125 +16126 +16127 +16128 +16129 +16130 +16131 +16132 +16133 +16134 +16135 +16136 +16137 +16138 +16139 +16140 +16141 +16142 +16143 +16144 +16145 +16146 +16147 +16148 +16149 +16150 +16151 +16152 +16153 +16154 +16155 +16156 +16157 +16158 +16159 +16160 +16161 +16162 +16163 +16164 +16165 +16166 +16167 +16168 +16169 +16170 +16171 +16172 +16173 +16174 +16175 +16176 +16177 +16178 +16179 +16180 +16181 +16182 +16183 +16184 +16185 +16186 +16187 +16188 +16189 +16190 +16191 +16192 +16193 +16194 +16195 +16196 +16197 +16198 +16199 +16200 +16201 +16202 +16203 +16204 +16205 +16206 +16207 +16208 +16209 +16210 +16211 +16212 +16213 +16214 +16215 +16216 +16217 +16218 +16219 +16220 +16221 +16222 +16223 +16224 +16225 +16226 +16227 +16228 +16229 +16230 +16231 +16232 +16233 +16234 +16235 +16236 +16237 +16238 +16239 +16240 +16241 +16242 +16243 +16244 +16245 +16246 +16247 +16248 +16249 +16250 +16251 +16252 +16253 +16254 +16255 +16256 +16257 +16258 +16259 +16260 +16261 +16262 +16263 +16264 +16265 +16266 +16267 +16268 +16269 +16270 +16271 +16272 +16273 +16274 +16275 +16276 +16277 +16278 +16279 +16280 +16281 +16282 +16283 +16284 +16285 +16286 +16287 +16288 +16289 +16290 +16291 +16292 +16293 +16294 +16295 +16296 +16297 +16298 +16299 +16300 +16301 +16302 +16303 +16304 +16305 +16306 +16307 +16308 +16309 +16310 +16311 +16312 +16313 +16314 +16315 +16316 +16317 +16318 +16319 +16320 +16321 +16322 +16323 +16324 +16325 +16326 +16327 +16328 +16329 +16330 +16331 +16332 +16333 +16334 +16335 +16336 +16337 +16338 +16339 +16340 +16341 +16342 +16343 +16344 +16345 +16346 +16347 +16348 +16349 +16350 +16351 +16352 +16353 +16354 +16355 +16356 +16357 +16358 +16359 +16360 +16361 +16362 +16363 +16364 +16365 +16366 +16367 +16368 +16369 +16370 +16371 +16372 +16373 +16374 +16375 +16376 +16377 +16378 +16379 +16380 +16381 +16382 +16383 +16384 +16385 +16386 +16387 +16388 +16389 +16390 +16391 +16392 +16393 +16394 +16395 +16396 +16397 +16398 +16399 +16400 +16401 +16402 +16403 +16404 +16405 +16406 +16407 +16408 +16409 +16410 +16411 +16412 +16413 +16414 +16415 +16416 +16417 +16418 +16419 +16420 +16421 +16422 +16423 +16424 +16425 +16426 +16427 +16428 +16429 +16430 +16431 +16432 +16433 +16434 +16435 +16436 +16437 +16438 +16439 +16440 +16441 +16442 +16443 +16444 +16445 +16446 +16447 +16448 +16449 +16450 +16451 +16452 +16453 +16454 +16455 +16456 +16457 +16458 +16459 +16460 +16461 +16462 +16463 +16464 +16465 +16466 +16467 +16468 +16469 +16470 +16471 +16472 +16473 +16474 +16475 +16476 +16477 +16478 +16479 +16480 +16481 +16482 +16483 +16484 +16485 +16486 +16487 +16488 +16489 +16490 +16491 +16492 +16493 +16494 +16495 +16496 +16497 +16498 +16499 +16500 +16501 +16502 +16503 +16504 +16505 +16506 +16507 +16508 +16509 +16510 +16511 +16512 +16513 +16514 +16515 +16516 +16517 +16518 +16519 +16520 +16521 +16522 +16523 +16524 +16525 +16526 +16527 +16528 +16529 +16530 +16531 +16532 +16533 +16534 +16535 +16536 +16537 +16538 +16539 +16540 +16541 +16542 +16543 +16544 +16545 +16546 +16547 +16548 +16549 +16550 +16551 +16552 +16553 +16554 +16555 +16556 +16557 +16558 +16559 +16560 +16561 +16562 +16563 +16564 +16565 +16566 +16567 +16568 +16569 +16570 +16571 +16572 +16573 +16574 +16575 +16576 +16577 +16578 +16579 +16580 +16581 +16582 +16583 +16584 +16585 +16586 +16587 +16588 +16589 +16590 +16591 +16592 +16593 +16594 +16595 +16596 +16597 +16598 +16599 +16600 +16601 +16602 +16603 +16604 +16605 +16606 +16607 +16608 +16609 +16610 +16611 +16612 +16613 +16614 +16615 +16616 +16617 +16618 +16619 +16620 +16621 +16622 +16623 +16624 +16625 +16626 +16627 +16628 +16629 +16630 +16631 +16632 +16633 +16634 +16635 +16636 +16637 +16638 +16639 +16640 +16641 +16642 +16643 +16644 +16645 +16646 +16647 +16648 +16649 +16650 +16651 +16652 +16653 +16654 +16655 +16656 +16657 +16658 +16659 +16660 +16661 +16662 +16663 +16664 +16665 +16666 +16667 +16668 +16669 +16670 +16671 +16672 +16673 +16674 +16675 +16676 +16677 +16678 +16679 +16680 +16681 +16682 +16683 +16684 +16685 +16686 +16687 +16688 +16689 +16690 +16691 +16692 +16693 +16694 +16695 +16696 +16697 +16698 +16699 +16700 +16701 +16702 +16703 +16704 +16705 +16706 +16707 +16708 +16709 +16710 +16711 +16712 +16713 +16714 +16715 +16716 +16717 +16718 +16719 +16720 +16721 +16722 +16723 +16724 +16725 +16726 +16727 +16728 +16729 +16730 +16731 +16732 +16733 +16734 +16735 +16736 +16737 +16738 +16739 +16740 +16741 +16742 +16743 +16744 +16745 +16746 +16747 +16748 +16749 +16750 +16751 +16752 +16753 +16754 +16755 +16756 +16757 +16758 +16759 +16760 +16761 +16762 +16763 +16764 +16765 +16766 +16767 +16768 +16769 +16770 +16771 +16772 +16773 +16774 +16775 +16776 +16777 +16778 +16779 +16780 +16781 +16782 +16783 +16784 +16785 +16786 +16787 +16788 +16789 +16790 +16791 +16792 +16793 +16794 +16795 +16796 +16797 +16798 +16799 +16800 +16801 +16802 +16803 +16804 +16805 +16806 +16807 +16808 +16809 +16810 +16811 +16812 +16813 +16814 +16815 +16816 +16817 +16818 +16819 +16820 +16821 +16822 +16823 +16824 +16825 +16826 +16827 +16828 +16829 +16830 +16831 +16832 +16833 +16834 +16835 +16836 +16837 +16838 +16839 +16840 +16841 +16842 +16843 +16844 +16845 +16846 +16847 +16848 +16849 +16850 +16851 +16852 +16853 +16854 +16855 +16856 +16857 +16858 +16859 +16860 +16861 +16862 +16863 +16864 +16865 +16866 +16867 +16868 +16869 +16870 +16871 +16872 +16873 +16874 +16875 +16876 +16877 +16878 +16879 +16880 +16881 +16882 +16883 +16884 +16885 +16886 +16887 +16888 +16889 +16890 +16891 +16892 +16893 +16894 +16895 +16896 +16897 +16898 +16899 +16900 +16901 +16902 +16903 +16904 +16905 +16906 +16907 +16908 +16909 +16910 +16911 +16912 +16913 +16914 +16915 +16916 +16917 +16918 +16919 +16920 +16921 +16922 +16923 +16924 +16925 +16926 +16927 +16928 +16929 +16930 +16931 +16932 +16933 +16934 +16935 +16936 +16937 +16938 +16939 +16940 +16941 +16942 +16943 +16944 +16945 +16946 +16947 +16948 +16949 +16950 +16951 +16952 +16953 +16954 +16955 +16956 +16957 +16958 +16959 +16960 +16961 +16962 +16963 +16964 +16965 +16966 +16967 +16968 +16969 +16970 +16971 +16972 +16973 +16974 +16975 +16976 +16977 +16978 +16979 +16980 +16981 +16982 +16983 +16984 +16985 +16986 +16987 +16988 +16989 +16990 +16991 +16992 +16993 +16994 +16995 +16996 +16997 +16998 +16999 +17000 +17001 +17002 +17003 +17004 +17005 +17006 +17007 +17008 +17009 +17010 +17011 +17012 +17013 +17014 +17015 +17016 +17017 +17018 +17019 +17020 +17021 +17022 +17023 +17024 +17025 +17026 +17027 +17028 +17029 +17030 +17031 +17032 +17033 +17034 +17035 +17036 +17037 +17038 +17039 +17040 +17041 +17042 +17043 +17044 +17045 +17046 +17047 +17048 +17049 +17050 +17051 +17052 +17053 +17054 +17055 +17056 +17057 +17058 +17059 +17060 +17061 +17062 +17063 +17064 +17065 +17066 +17067 +17068 +17069 +17070 +17071 +17072 +17073 +17074 +17075 +17076 +17077 +17078 +17079 +17080 +17081 +17082 +17083 +17084 +17085 +17086 +17087 +17088 +17089 +17090 +17091 +17092 +17093 +17094 +17095 +17096 +17097 +17098 +17099 +17100 +17101 +17102 +17103 +17104 +17105 +17106 +17107 +17108 +17109 +17110 +17111 +17112 +17113 +17114 +17115 +17116 +17117 +17118 +17119 +17120 +17121 +17122 +17123 +17124 +17125 +17126 +17127 +17128 +17129 +17130 +17131 +17132 +17133 +17134 +17135 +17136 +17137 +17138 +17139 +17140 +17141 +17142 +17143 +17144 +17145 +17146 +17147 +17148 +17149 +17150 +17151 +17152 +17153 +17154 +17155 +17156 +17157 +17158 +17159 +17160 +17161 +17162 +17163 +17164 +17165 +17166 +17167 +17168 +17169 +17170 +17171 +17172 +17173 +17174 +17175 +17176 +17177 +17178 +17179 +17180 +17181 +17182 +17183 +17184 +17185 +17186 +17187 +17188 +17189 +17190 +17191 +17192 +17193 +17194 +17195 +17196 +17197 +17198 +17199 +17200 +17201 +17202 +17203 +17204 +17205 +17206 +17207 +17208 +17209 +17210 +17211 +17212 +17213 +17214 +17215 +17216 +17217 +17218 +17219 +17220 +17221 +17222 +17223 +17224 +17225 +17226 +17227 +17228 +17229 +17230 +17231 +17232 +17233 +17234 +17235 +17236 +17237 +17238 +17239 +17240 +17241 +17242 +17243 +17244 +17245 +17246 +17247 +17248 +17249 +17250 +17251 +17252 +17253 +17254 +17255 +17256 +17257 +17258 +17259 +17260 +17261 +17262 +17263 +17264 +17265 +17266 +17267 +17268 +17269 +17270 +17271 +17272 +17273 +17274 +17275 +17276 +17277 +17278 +17279 +17280 +17281 +17282 +17283 +17284 +17285 +17286 +17287 +17288 +17289 +17290 +17291 +17292 +17293 +17294 +17295 +17296 +17297 +17298 +17299 +17300 +17301 +17302 +17303 +17304 +17305 +17306 +17307 +17308 +17309 +17310 +17311 +17312 +17313 +17314 +17315 +17316 +17317 +17318 +17319 +17320 +17321 +17322 +17323 +17324 +17325 +17326 +17327 +17328 +17329 +17330 +17331 +17332 +17333 +17334 +17335 +17336 +17337 +17338 +17339 +17340 +17341 +17342 +17343 +17344 +17345 +17346 +17347 +17348 +17349 +17350 +17351 +17352 +17353 +17354 +17355 +17356 +17357 +17358 +17359 +17360 +17361 +17362 +17363 +17364 +17365 +17366 +17367 +17368 +17369 +17370 +17371 +17372 +17373 +17374 +17375 +17376 +17377 +17378 +17379 +17380 +17381 +17382 +17383 +17384 +17385 +17386 +17387 +17388 +17389 +17390 +17391 +17392 +17393 +17394 +17395 +17396 +17397 +17398 +17399 +17400 +17401 +17402 +17403 +17404 +17405 +17406 +17407 +17408 +17409 +17410 +17411 +17412 +17413 +17414 +17415 +17416 +17417 +17418 +17419 +17420 +17421 +17422 +17423 +17424 +17425 +17426 +17427 +17428 +17429 +17430 +17431 +17432 +17433 +17434 +17435 +17436 +17437 +17438 +17439 +17440 +17441 +17442 +17443 +17444 +17445 +17446 +17447 +17448 +17449 +17450 +17451 +17452 +17453 +17454 +17455 +17456 +17457 +17458 +17459 +17460 +17461 +17462 +17463 +17464 +17465 +17466 +17467 +17468 +17469 +17470 +17471 +17472 +17473 +17474 +17475 +17476 +17477 +17478 +17479 +17480 +17481 +17482 +17483 +17484 +17485 +17486 +17487 +17488 +17489 +17490 +17491 +17492 +17493 +17494 +17495 +17496 +17497 +17498 +17499 +17500 +17501 +17502 +17503 +17504 +17505 +17506 +17507 +17508 +17509 +17510 +17511 +17512 +17513 +17514 +17515 +17516 +17517 +17518 +17519 +17520 +17521 +17522 +17523 +17524 +17525 +17526 +17527 +17528 +17529 +17530 +17531 +17532 +17533 +17534 +17535 +17536 +17537 +17538 +17539 +17540 +17541 +17542 +17543 +17544 +17545 +17546 +17547 +17548 +17549 +17550 +17551 +17552 +17553 +17554 +17555 +17556 +17557 +17558 +17559 +17560 +17561 +17562 +17563 +17564 +17565 +17566 +17567 +17568 +17569 +17570 +17571 +17572 +17573 +17574 +17575 +17576 +17577 +17578 +17579 +17580 +17581 +17582 +17583 +17584 +17585 +17586 +17587 +17588 +17589 +17590 +17591 +17592 +17593 +17594 +17595 +17596 +17597 +17598 +17599 +17600 +17601 +17602 +17603 +17604 +17605 +17606 +17607 +17608 +17609 +17610 +17611 +17612 +17613 +17614 +17615 +17616 +17617 +17618 +17619 +17620 +17621 +17622 +17623 +17624 +17625 +17626 +17627 +17628 +17629 +17630 +17631 +17632 +17633 +17634 +17635 +17636 +17637 +17638 +17639 +17640 +17641 +17642 +17643 +17644 +17645 +17646 +17647 +17648 +17649 +17650 +17651 +17652 +17653 +17654 +17655 +17656 +17657 +17658 +17659 +17660 +17661 +17662 +17663 +17664 +17665 +17666 +17667 +17668 +17669 +17670 +17671 +17672 +17673 +17674 +17675 +17676 +17677 +17678 +17679 +17680 +17681 +17682 +17683 +17684 +17685 +17686 +17687 +17688 +17689 +17690 +17691 +17692 +17693 +17694 +17695 +17696 +17697 +17698 +17699 +17700 +17701 +17702 +17703 +17704 +17705 +17706 +17707 +17708 +17709 +17710 +17711 +17712 +17713 +17714 +17715 +17716 +17717 +17718 +17719 +17720 +17721 +17722 +17723 +17724 +17725 +17726 +17727 +17728 +17729 +17730 +17731 +17732 +17733 +17734 +17735 +17736 +17737 +17738 +17739 +17740 +17741 +17742 +17743 +17744 +17745 +17746 +17747 +17748 +17749 +17750 +17751 +17752 +17753 +17754 +17755 +17756 +17757 +17758 +17759 +17760 +17761 +17762 +17763 +17764 +17765 +17766 +17767 +17768 +17769 +17770 +17771 +17772 +17773 +17774 +17775 +17776 +17777 +17778 +17779 +17780 +17781 +17782 +17783 +17784 +17785 +17786 +17787 +17788 +17789 +17790 +17791 +17792 +17793 +17794 +17795 +17796 +17797 +17798 +17799 +17800 +17801 +17802 +17803 +17804 +17805 +17806 +17807 +17808 +17809 +17810 +17811 +17812 +17813 +17814 +17815 +17816 +17817 +17818 +17819 +17820 +17821 +17822 +17823 +17824 +17825 +17826 +17827 +17828 +17829 +17830 +17831 +17832 +17833 +17834 +17835 +17836 +17837 +17838 +17839 +17840 +17841 +17842 +17843 +17844 +17845 +17846 +17847 +17848 +17849 +17850 +17851 +17852 +17853 +17854 +17855 +17856 +17857 +17858 +17859 +17860 +17861 +17862 +17863 +17864 +17865 +17866 +17867 +17868 +17869 +17870 +17871 +17872 +17873 +17874 +17875 +17876 +17877 +17878 +17879 +17880 +17881 +17882 +17883 +17884 +17885 +17886 +17887 +17888 +17889 +17890 +17891 +17892 +17893 +17894 +17895 +17896 +17897 +17898 +17899 +17900 +17901 +17902 +17903 +17904 +17905 +17906 +17907 +17908 +17909 +17910 +17911 +17912 +17913 +17914 +17915 +17916 +17917 +17918 +17919 +17920 +17921 +17922 +17923 +17924 +17925 +17926 +17927 +17928 +17929 +17930 +17931 +17932 +17933 +17934 +17935 +17936 +17937 +17938 +17939 +17940 +17941 +17942 +17943 +17944 +17945 +17946 +17947 +17948 +17949 +17950 +17951 +17952 +17953 +17954 +17955 +17956 +17957 +17958 +17959 +17960 +17961 +17962 +17963 +17964 +17965 +17966 +17967 +17968 +17969 +17970 +17971 +17972 +17973 +17974 +17975 +17976 +17977 +17978 +17979 +17980 +17981 +17982 +17983 +17984 +17985 +17986 +17987 +17988 +17989 +17990 +17991 +17992 +17993 +17994 +17995 +17996 +17997 +17998 +17999 +18000 +18001 +18002 +18003 +18004 +18005 +18006 +18007 +18008 +18009 +18010 +18011 +18012 +18013 +18014 +18015 +18016 +18017 +18018 +18019 +18020 +18021 +18022 +18023 +18024 +18025 +18026 +18027 +18028 +18029 +18030 +18031 +18032 +18033 +18034 +18035 +18036 +18037 +18038 +18039 +18040 +18041 +18042 +18043 +18044 +18045 +18046 +18047 +18048 +18049 +18050 +18051 +18052 +18053 +18054 +18055 +18056 +18057 +18058 +18059 +18060 +18061 +18062 +18063 +18064 +18065 +18066 +18067 +18068 +18069 +18070 +18071 +18072 +18073 +18074 +18075 +18076 +18077 +18078 +18079 +18080 +18081 +18082 +18083 +18084 +18085 +18086 +18087 +18088 +18089 +18090 +18091 +18092 +18093 +18094 +18095 +18096 +18097 +18098 +18099 +18100 +18101 +18102 +18103 +18104 +18105 +18106 +18107 +18108 +18109 +18110 +18111 +18112 +18113 +18114 +18115 +18116 +18117 +18118 +18119 +18120 +18121 +18122 +18123 +18124 +18125 +18126 +18127 +18128 +18129 +18130 +18131 +18132 +18133 +18134 +18135 +18136 +18137 +18138 +18139 +18140 +18141 +18142 +18143 +18144 +18145 +18146 +18147 +18148 +18149 +18150 +18151 +18152 +18153 +18154 +18155 +18156 +18157 +18158 +18159 +18160 +18161 +18162 +18163 +18164 +18165 +18166 +18167 +18168 +18169 +18170 +18171 +18172 +18173 +18174 +18175 +18176 +18177 +18178 +18179 +18180 +18181 +18182 +18183 +18184 +18185 +18186 +18187 +18188 +18189 +18190 +18191 +18192 +18193 +18194 +18195 +18196 +18197 +18198 +18199 +18200 +18201 +18202 +18203 +18204 +18205 +18206 +18207 +18208 +18209 +18210 +18211 +18212 +18213 +18214 +18215 +18216 +18217 +18218 +18219 +18220 +18221 +18222 +18223 +18224 +18225 +18226 +18227 +18228 +18229 +18230 +18231 +18232 +18233 +18234 +18235 +18236 +18237 +18238 +18239 +18240 +18241 +18242 +18243 +18244 +18245 +18246 +18247 +18248 +18249 +18250 +18251 +18252 +18253 +18254 +18255 +18256 +18257 +18258 +18259 +18260 +18261 +18262 +18263 +18264 +18265 +18266 +18267 +18268 +18269 +18270 +18271 +18272 +18273 +18274 +18275 +18276 +18277 +18278 +18279 +18280 +18281 +18282 +18283 +18284 +18285 +18286 +18287 +18288 +18289 +18290 +18291 +18292 +18293 +18294 +18295 +18296 +18297 +18298 +18299 +18300 +18301 +18302 +18303 +18304 +18305 +18306 +18307 +18308 +18309 +18310 +18311 +18312 +18313 +18314 +18315 +18316 +18317 +18318 +18319 +18320 +18321 +18322 +18323 +18324 +18325 +18326 +18327 +18328 +18329 +18330 +18331 +18332 +18333 +18334 +18335 +18336 +18337 +18338 +18339 +18340 +18341 +18342 +18343 +18344 +18345 +18346 +18347 +18348 +18349 +18350 +18351 +18352 +18353 +18354 +18355 +18356 +18357 +18358 +18359 +18360 +18361 +18362 +18363 +18364 +18365 +18366 +18367 +18368 +18369 +18370 +18371 +18372 +18373 +18374 +18375 +18376 +18377 +18378 +18379 +18380 +18381 +18382 +18383 +18384 +18385 +18386 +18387 +18388 +18389 +18390 +18391 +18392 +18393 +18394 +18395 +18396 +18397 +18398 +18399 +18400 +18401 +18402 +18403 +18404 +18405 +18406 +18407 +18408 +18409 +18410 +18411 +18412 +18413 +18414 +18415 +18416 +18417 +18418 +18419 +18420 +18421 +18422 +18423 +18424 +18425 +18426 +18427 +18428 +18429 +18430 +18431 +18432 +18433 +18434 +18435 +18436 +18437 +18438 +18439 +18440 +18441 +18442 +18443 +18444 +18445 +18446 +18447 +18448 +18449 +18450 +18451 +18452 +18453 +18454 +18455 +18456 +18457 +18458 +18459 +18460 +18461 +18462 +18463 +18464 +18465 +18466 +18467 +18468 +18469 +18470 +18471 +18472 +18473 +18474 +18475 +18476 +18477 +18478 +18479 +18480 +18481 +18482 +18483 +18484 +18485 +18486 +18487 +18488 +18489 +18490 +18491 +18492 +18493 +18494 +18495 +18496 +18497 +18498 +18499 +18500 +18501 +18502 +18503 +18504 +18505 +18506 +18507 +18508 +18509 +18510 +18511 +18512 +18513 +18514 +18515 +18516 +18517 +18518 +18519 +18520 +18521 +18522 +18523 +18524 +18525 +18526 +18527 +18528 +18529 +18530 +18531 +18532 +18533 +18534 +18535 +18536 +18537 +18538 +18539 +18540 +18541 +18542 +18543 +18544 +18545 +18546 +18547 +18548 +18549 +18550 +18551 +18552 +18553 +18554 +18555 +18556 +18557 +18558 +18559 +18560 +18561 +18562 +18563 +18564 +18565 +18566 +18567 +18568 +18569 +18570 +18571 +18572 +18573 +18574 +18575 +18576 +18577 +18578 +18579 +18580 +18581 +18582 +18583 +18584 +18585 +18586 +18587 +18588 +18589 +18590 +18591 +18592 +18593 +18594 +18595 +18596 +18597 +18598 +18599 +18600 +18601 +18602 +18603 +18604 +18605 +18606 +18607 +18608 +18609 +18610 +18611 +18612 +18613 +18614 +18615 +18616 +18617 +18618 +18619 +18620 +18621 +18622 +18623 +18624 +18625 +18626 +18627 +18628 +18629 +18630 +18631 +18632 +18633 +18634 +18635 +18636 +18637 +18638 +18639 +18640 +18641 +18642 +18643 +18644 +18645 +18646 +18647 +18648 +18649 +18650 +18651 +18652 +18653 +18654 +18655 +18656 +18657 +18658 +18659 +18660 +18661 +18662 +18663 +18664 +18665 +18666 +18667 +18668 +18669 +18670 +18671 +18672 +18673 +18674 +18675 +18676 +18677 +18678 +18679 +18680 +18681 +18682 +18683 +18684 +18685 +18686 +18687 +18688 +18689 +18690 +18691 +18692 +18693 +18694 +18695 +18696 +18697 +18698 +18699 +18700 +18701 +18702 +18703 +18704 +18705 +18706 +18707 +18708 +18709 +18710 +18711 +18712 +18713 +18714 +18715 +18716 +18717 +18718 +18719 +18720 +18721 +18722 +18723 +18724 +18725 +18726 +18727 +18728 +18729 +18730 +18731 +18732 +18733 +18734 +18735 +18736 +18737 +18738 +18739 +18740 +18741 +18742 +18743 +18744 +18745 +18746 +18747 +18748 +18749 +18750 +18751 +18752 +18753 +18754 +18755 +18756 +18757 +18758 +18759 +18760 +18761 +18762 +18763 +18764 +18765 +18766 +18767 +18768 +18769 +18770 +18771 +18772 +18773 +18774 +18775 +18776 +18777 +18778 +18779 +18780 +18781 +18782 +18783 +18784 +18785 +18786 +18787 +18788 +18789 +18790 +18791 +18792 +18793 +18794 +18795 +18796 +18797 +18798 +18799 +18800 +18801 +18802 +18803 +18804 +18805 +18806 +18807 +18808 +18809 +18810 +18811 +18812 +18813 +18814 +18815 +18816 +18817 +18818 +18819 +18820 +18821 +18822 +18823 +18824 +18825 +18826 +18827 +18828 +18829 +18830 +18831 +18832 +18833 +18834 +18835 +18836 +18837 +18838 +18839 +18840 +18841 +18842 +18843 +18844 +18845 +18846 +18847 +18848 +18849 +18850 +18851 +18852 +18853 +18854 +18855 +18856 +18857 +18858 +18859 +18860 +18861 +18862 +18863 +18864 +18865 +18866 +18867 +18868 +18869 +18870 +18871 +18872 +18873 +18874 +18875 +18876 +18877 +18878 +18879 +18880 +18881 +18882 +18883 +18884 +18885 +18886 +18887 +18888 +18889 +18890 +18891 +18892 +18893 +18894 +18895 +18896 +18897 +18898 +18899 +18900 +18901 +18902 +18903 +18904 +18905 +18906 +18907 +18908 +18909 +18910 +18911 +18912 +18913 +18914 +18915 +18916 +18917 +18918 +18919 +18920 +18921 +18922 +18923 +18924 +18925 +18926 +18927 +18928 +18929 +18930 +18931 +18932 +18933 +18934 +18935 +18936 +18937 +18938 +18939 +18940 +18941 +18942 +18943 +18944 +18945 +18946 +18947 +18948 +18949 +18950 +18951 +18952 +18953 +18954 +18955 +18956 +18957 +18958 +18959 +18960 +18961 +18962 +18963 +18964 +18965 +18966 +18967 +18968 +18969 +18970 +18971 +18972 +18973 +18974 +18975 +18976 +18977 +18978 +18979 +18980 +18981 +18982 +18983 +18984 +18985 +18986 +18987 +18988 +18989 +18990 +18991 +18992 +18993 +18994 +18995 +18996 +18997 +18998 +18999 +19000 +19001 +19002 +19003 +19004 +19005 +19006 +19007 +19008 +19009 +19010 +19011 +19012 +19013 +19014 +19015 +19016 +19017 +19018 +19019 +19020 +19021 +19022 +19023 +19024 +19025 +19026 +19027 +19028 +19029 +19030 +19031 +19032 +19033 +19034 +19035 +19036 +19037 +19038 +19039 +19040 +19041 +19042 +19043 +19044 +19045 +19046 +19047 +19048 +19049 +19050 +19051 +19052 +19053 +19054 +19055 +19056 +19057 +19058 +19059 +19060 +19061 +19062 +19063 +19064 +19065 +19066 +19067 +19068 +19069 +19070 +19071 +19072 +19073 +19074 +19075 +19076 +19077 +19078 +19079 +19080 +19081 +19082 +19083 +19084 +19085 +19086 +19087 +19088 +19089 +19090 +19091 +19092 +19093 +19094 +19095 +19096 +19097 +19098 +19099 +19100 +19101 +19102 +19103 +19104 +19105 +19106 +19107 +19108 +19109 +19110 +19111 +19112 +19113 +19114 +19115 +19116 +19117 +19118 +19119 +19120 +19121 +19122 +19123 +19124 +19125 +19126 +19127 +19128 +19129 +19130 +19131 +19132 +19133 +19134 +19135 +19136 +19137 +19138 +19139 +19140 +19141 +19142 +19143 +19144 +19145 +19146 +19147 +19148 +19149 +19150 +19151 +19152 +19153 +19154 +19155 +19156 +19157 +19158 +19159 +19160 +19161 +19162 +19163 +19164 +19165 +19166 +19167 +19168 +19169 +19170 +19171 +19172 +19173 +19174 +19175 +19176 +19177 +19178 +19179 +19180 +19181 +19182 +19183 +19184 +19185 +19186 +19187 +19188 +19189 +19190 +19191 +19192 +19193 +19194 +19195 +19196 +19197 +19198 +19199 +19200 +19201 +19202 +19203 +19204 +19205 +19206 +19207 +19208 +19209 +19210 +19211 +19212 +19213 +19214 +19215 +19216 +19217 +19218 +19219 +19220 +19221 +19222 +19223 +19224 +19225 +19226 +19227 +19228 +19229 +19230 +19231 +19232 +19233 +19234 +19235 +19236 +19237 +19238 +19239 +19240 +19241 +19242 +19243 +19244 +19245 +19246 +19247 +19248 +19249 +19250 +19251 +19252 +19253 +19254 +19255 +19256 +19257 +19258 +19259 +19260 +19261 +19262 +19263 +19264 +19265 +19266 +19267 +19268 +19269 +19270 +19271 +19272 +19273 +19274 +19275 +19276 +19277 +19278 +19279 +19280 +19281 +19282 +19283 +19284 +19285 +19286 +19287 +19288 +19289 +19290 +19291 +19292 +19293 +19294 +19295 +19296 +19297 +19298 +19299 +19300 +19301 +19302 +19303 +19304 +19305 +19306 +19307 +19308 +19309 +19310 +19311 +19312 +19313 +19314 +19315 +19316 +19317 +19318 +19319 +19320 +19321 +19322 +19323 +19324 +19325 +19326 +19327 +19328 +19329 +19330 +19331 +19332 +19333 +19334 +19335 +19336 +19337 +19338 +19339 +19340 +19341 +19342 +19343 +19344 +19345 +19346 +19347 +19348 +19349 +19350 +19351 +19352 +19353 +19354 +19355 +19356 +19357 +19358 +19359 +19360 +19361 +19362 +19363 +19364 +19365 +19366 +19367 +19368 +19369 +19370 +19371 +19372 +19373 +19374 +19375 +19376 +19377 +19378 +19379 +19380 +19381 +19382 +19383 +19384 +19385 +19386 +19387 +19388 +19389 +19390 +19391 +19392 +19393 +19394 +19395 +19396 +19397 +19398 +19399 +19400 +19401 +19402 +19403 +19404 +19405 +19406 +19407 +19408 +19409 +19410 +19411 +19412 +19413 +19414 +19415 +19416 +19417 +19418 +19419 +19420 +19421 +19422 +19423 +19424 +19425 +19426 +19427 +19428 +19429 +19430 +19431 +19432 +19433 +19434 +19435 +19436 +19437 +19438 +19439 +19440 +19441 +19442 +19443 +19444 +19445 +19446 +19447 +19448 +19449 +19450 +19451 +19452 +19453 +19454 +19455 +19456 +19457 +19458 +19459 +19460 +19461 +19462 +19463 +19464 +19465 +19466 +19467 +19468 +19469 +19470 +19471 +19472 +19473 +19474 +19475 +19476 +19477 +19478 +19479 +19480 +19481 +19482 +19483 +19484 +19485 +19486 +19487 +19488 +19489 +19490 +19491 +19492 +19493 +19494 +19495 +19496 +19497 +19498 +19499 +19500 +19501 +19502 +19503 +19504 +19505 +19506 +19507 +19508 +19509 +19510 +19511 +19512 +19513 +19514 +19515 +19516 +19517 +19518 +19519 +19520 +19521 +19522 +19523 +19524 +19525 +19526 +19527 +19528 +19529 +19530 +19531 +19532 +19533 +19534 +19535 +19536 +19537 +19538 +19539 +19540 +19541 +19542 +19543 +19544 +19545 +19546 +19547 +19548 +19549 +19550 +19551 +19552 +19553 +19554 +19555 +19556 +19557 +19558 +19559 +19560 +19561 +19562 +19563 +19564 +19565 +19566 +19567 +19568 +19569 +19570 +19571 +19572 +19573 +19574 +19575 +19576 +19577 +19578 +19579 +19580 +19581 +19582 +19583 +19584 +19585 +19586 +19587 +19588 +19589 +19590 +19591 +19592 +19593 +19594 +19595 +19596 +19597 +19598 +19599 +19600 +19601 +19602 +19603 +19604 +19605 +19606 +19607 +19608 +19609 +19610 +19611 +19612 +19613 +19614 +19615 +19616 +19617 +19618 +19619 +19620 +19621 +19622 +19623 +19624 +19625 +19626 +19627 +19628 +19629 +19630 +19631 +19632 +19633 +19634 +19635 +19636 +19637 +19638 +19639 +19640 +19641 +19642 +19643 +19644 +19645 +19646 +19647 +19648 +19649 +19650 +19651 +19652 +19653 +19654 +19655 +19656 +19657 +19658 +19659 +19660 +19661 +19662 +19663 +19664 +19665 +19666 +19667 +19668 +19669 +19670 +19671 +19672 +19673 +19674 +19675 +19676 +19677 +19678 +19679 +19680 +19681 +19682 +19683 +19684 +19685 +19686 +19687 +19688 +19689 +19690 +19691 +19692 +19693 +19694 +19695 +19696 +19697 +19698 +19699 +19700 +19701 +19702 +19703 +19704 +19705 +19706 +19707 +19708 +19709 +19710 +19711 +19712 +19713 +19714 +19715 +19716 +19717 +19718 +19719 +19720 +19721 +19722 +19723 +19724 +19725 +19726 +19727 +19728 +19729 +19730 +19731 +19732 +19733 +19734 +19735 +19736 +19737 +19738 +19739 +19740 +19741 +19742 +19743 +19744 +19745 +19746 +19747 +19748 +19749 +19750 +19751 +19752 +19753 +19754 +19755 +19756 +19757 +19758 +19759 +19760 +19761 +19762 +19763 +19764 +19765 +19766 +19767 +19768 +19769 +19770 +19771 +19772 +19773 +19774 +19775 +19776 +19777 +19778 +19779 +19780 +19781 +19782 +19783 +19784 +19785 +19786 +19787 +19788 +19789 +19790 +19791 +19792 +19793 +19794 +19795 +19796 +19797 +19798 +19799 +19800 +19801 +19802 +19803 +19804 +19805 +19806 +19807 +19808 +19809 +19810 +19811 +19812 +19813 +19814 +19815 +19816 +19817 +19818 +19819 +19820 +19821 +19822 +19823 +19824 +19825 +19826 +19827 +19828 +19829 +19830 +19831 +19832 +19833 +19834 +19835 +19836 +19837 +19838 +19839 +19840 +19841 +19842 +19843 +19844 +19845 +19846 +19847 +19848 +19849 +19850 +19851 +19852 +19853 +19854 +19855 +19856 +19857 +19858 +19859 +19860 +19861 +19862 +19863 +19864 +19865 +19866 +19867 +19868 +19869 +19870 +19871 +19872 +19873 +19874 +19875 +19876 +19877 +19878 +19879 +19880 +19881 +19882 +19883 +19884 +19885 +19886 +19887 +19888 +19889 +19890 +19891 +19892 +19893 +19894 +19895 +19896 +19897 +19898 +19899 +19900 +19901 +19902 +19903 +19904 +19905 +19906 +19907 +19908 +19909 +19910 +19911 +19912 +19913 +19914 +19915 +19916 +19917 +19918 +19919 +19920 +19921 +19922 +19923 +19924 +19925 +19926 +19927 +19928 +19929 +19930 +19931 +19932 +19933 +19934 +19935 +19936 +19937 +19938 +19939 +19940 +19941 +19942 +19943 +19944 +19945 +19946 +19947 +19948 +19949 +19950 +19951 +19952 +19953 +19954 +19955 +19956 +19957 +19958 +19959 +19960 +19961 +19962 +19963 +19964 +19965 +19966 +19967 +19968 +19969 +19970 +19971 +19972 +19973 +19974 +19975 +19976 +19977 +19978 +19979 +19980 +19981 +19982 +19983 +19984 +19985 +19986 +19987 +19988 +19989 +19990 +19991 +19992 +19993 +19994 +19995 +19996 +19997 +19998 +19999 +20000 +20001 +20002 +20003 +20004 +20005 +20006 +20007 +20008 +20009 +20010 +20011 +20012 +20013 +20014 +20015 +20016 +20017 +20018 +20019 +20020 +20021 +20022 +20023 +20024 +20025 +20026 +20027 +20028 +20029 +20030 +20031 +20032 +20033 +20034 +20035 +20036 +20037 +20038 +20039 +20040 +20041 +20042 +20043 +20044 +20045 +20046 +20047 +20048 +20049 +20050 +20051 +20052 +20053 +20054 +20055 +20056 +20057 +20058 +20059 +20060 +20061 +20062 +20063 +20064 +20065 +20066 +20067 +20068 +20069 +20070 +20071 +20072 +20073 +20074 +20075 +20076 +20077 +20078 +20079 +20080 +20081 +20082 +20083 +20084 +20085 +20086 +20087 +20088 +20089 +20090 +20091 +20092 +20093 +20094 +20095 +20096 +20097 +20098 +20099 +20100 +20101 +20102 +20103 +20104 +20105 +20106 +20107 +20108 +20109 +20110 +20111 +20112 +20113 +20114 +20115 +20116 +20117 +20118 +20119 +20120 +20121 +20122 +20123 +20124 +20125 +20126 +20127 +20128 +20129 +20130 +20131 +20132 +20133 +20134 +20135 +20136 +20137 +20138 +20139 +20140 +20141 +20142 +20143 +20144 +20145 +20146 +20147 +20148 +20149 +20150 +20151 +20152 +20153 +20154 +20155 +20156 +20157 +20158 +20159 +20160 +20161 +20162 +20163 +20164 +20165 +20166 +20167 +20168 +20169 +20170 +20171 +20172 +20173 +20174 +20175 +20176 +20177 +20178 +20179 +20180 +20181 +20182 +20183 +20184 +20185 +20186 +20187 +20188 +20189 +20190 +20191 +20192 +20193 +20194 +20195 +20196 +20197 +20198 +20199 +20200 +20201 +20202 +20203 +20204 +20205 +20206 +20207 +20208 +20209 +20210 +20211 +20212 +20213 +20214 +20215 +20216 +20217 +20218 +20219 +20220 +20221 +20222 +20223 +20224 +20225 +20226 +20227 +20228 +20229 +20230 +20231 +20232 +20233 +20234 +20235 +20236 +20237 +20238 +20239 +20240 +20241 +20242 +20243 +20244 +20245 +20246 +20247 +20248 +20249 +20250 +20251 +20252 +20253 +20254 +20255 +20256 +20257 +20258 +20259 +20260 +20261 +20262 +20263 +20264 +20265 +20266 +20267 +20268 +20269 +20270 +20271 +20272 +20273 +20274 +20275 +20276 +20277 +20278 +20279 +20280 +20281 +20282 +20283 +20284 +20285 +20286 +20287 +20288 +20289 +20290 +20291 +20292 +20293 +20294 +20295 +20296 +20297 +20298 +20299 +20300 +20301 +20302 +20303 +20304 +20305 +20306 +20307 +20308 +20309 +20310 +20311 +20312 +20313 +20314 +20315 +20316 +20317 +20318 +20319 +20320 +20321 +20322 +20323 +20324 +20325 +20326 +20327 +20328 +20329 +20330 +20331 +20332 +20333 +20334 +20335 +20336 +20337 +20338 +20339 +20340 +20341 +20342 +20343 +20344 +20345 +20346 +20347 +20348 +20349 +20350 +20351 +20352 +20353 +20354 +20355 +20356 +20357 +20358 +20359 +20360 +20361 +20362 +20363 +20364 +20365 +20366 +20367 +20368 +20369 +20370 +20371 +20372 +20373 +20374 +20375 +20376 +20377 +20378 +20379 +20380 +20381 +20382 +20383 +20384 +20385 +20386 +20387 +20388 +20389 +20390 +20391 +20392 +20393 +20394 +20395 +20396 +20397 +20398 +20399 +20400 +20401 +20402 +20403 +20404 +20405 +20406 +20407 +20408 +20409 +20410 +20411 +20412 +20413 +20414 +20415 +20416 +20417 +20418 +20419 +20420 +20421 +20422 +20423 +20424 +20425 +20426 +20427 +20428 +20429 +20430 +20431 +20432 +20433 +20434 +20435 +20436 +20437 +20438 +20439 +20440 +20441 +20442 +20443 +20444 +20445 +20446 +20447 +20448 +20449 +20450 +20451 +20452 +20453 +20454 +20455 +20456 +20457 +20458 +20459 +20460 +20461 +20462 +20463 +20464 +20465 +20466 +20467 +20468 +20469 +20470 +20471 +20472 +20473 +20474 +20475 +20476 +20477 +20478 +20479 +20480 +20481 +20482 +20483 +20484 +20485 +20486 +20487 +20488 +20489 +20490 +20491 +20492 +20493 +20494 +20495 +20496 +20497 +20498 +20499 +20500 +20501 +20502 +20503 +20504 +20505 +20506 +20507 +20508 +20509 +20510 +20511 +20512 +20513 +20514 +20515 +20516 +20517 +20518 +20519 +20520 +20521 +20522 +20523 +20524 +20525 +20526 +20527 +20528 +20529 +20530 +20531 +20532 +20533 +20534 +20535 +20536 +20537 +20538 +20539 +20540 +20541 +20542 +20543 +20544 +20545 +20546 +20547 +20548 +20549 +20550 +20551 +20552 +20553 +20554 +20555 +20556 +20557 +20558 +20559 +20560 +20561 +20562 +20563 +20564 +20565 +20566 +20567 +20568 +20569 +20570 +20571 +20572 +20573 +20574 +20575 +20576 +20577 +20578 +20579 +20580 +20581 +20582 +20583 +20584 +20585 +20586 +20587 +20588 +20589 +20590 +20591 +20592 +20593 +20594 +20595 +20596 +20597 +20598 +20599 +20600 +20601 +20602 +) + +// ************************************************************************* // diff --git a/tutorials/interFoam/nozzleFlow2D/constant/transportProperties b/tutorials/interFoam/nozzleFlow2D/constant/transportProperties new file mode 100644 index 00000000000..ef321fd883b --- /dev/null +++ b/tutorials/interFoam/nozzleFlow2D/constant/transportProperties @@ -0,0 +1,68 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object transportProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +twoPhase +{ + transportModel twoPhase; + phase1 phase1; + phase2 phase2; +} + +phase1 +{ + transportModel Newtonian; + nu nu [0 2 -1 0 0 0 0] 5.952e-06; + rho rho [1 -3 0 0 0 0 0] 840; + CrossPowerLawCoeffs + { + nu0 nu0 [0 2 -1 0 0 0 0] 1e-06; + nuInf nuInf [0 2 -1 0 0 0 0] 1e-06; + m m [0 0 1 0 0 0 0] 1; + n n [0 0 0 0 0 0 0] 0; + } + BirdCarreauCoeffs + { + nu0 nu0 [0 2 -1 0 0 0 0] 0.0142515; + nuInf nuInf [0 2 -1 0 0 0 0] 1e-06; + k k [0 0 1 0 0 0 0] 99.6; + n n [0 0 0 0 0 0 0] 0.1003; + } +} + +phase2 +{ + transportModel Newtonian; + nu nu [0 2 -1 0 0 0 0] 8.5e-07; + rho rho [1 -3 0 0 0 0 0] 20; + CrossPowerLawCoeffs + { + nu0 nu0 [0 2 -1 0 0 0 0] 1e-06; + nuInf nuInf [0 2 -1 0 0 0 0] 1e-06; + m m [0 0 1 0 0 0 0] 1; + n n [0 0 0 0 0 0 0] 0; + } + BirdCarreauCoeffs + { + nu0 nu0 [0 2 -1 0 0 0 0] 0.0142515; + nuInf nuInf [0 2 -1 0 0 0 0] 1e-06; + k k [0 0 1 0 0 0 0] 99.6; + n n [0 0 0 0 0 0 0] 0.1003; + } +} + +sigma sigma [1 0 -2 0 0 0 0] 0.0261; + +// ************************************************************************* // diff --git a/tutorials/interFoam/nozzleFlow2D/constant/turbulenceProperties b/tutorials/interFoam/nozzleFlow2D/constant/turbulenceProperties new file mode 100644 index 00000000000..e53dd92be33 --- /dev/null +++ b/tutorials/interFoam/nozzleFlow2D/constant/turbulenceProperties @@ -0,0 +1,19 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType LESModel; + +// ************************************************************************* // diff --git a/tutorials/interFoam/nozzleFlow2D/system/cellSetDict b/tutorials/interFoam/nozzleFlow2D/system/cellSetDict new file mode 100644 index 00000000000..d56de07c7ff --- /dev/null +++ b/tutorials/interFoam/nozzleFlow2D/system/cellSetDict @@ -0,0 +1,29 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object cellSetDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +name c0; + +action new; + +topoSetSources +( + boxToCell + { + box (0 0 -20e-06) (3600e-6 300e-06 20e-06); + } +); + +// ************************************************************************* // diff --git a/tutorials/interFoam/nozzleFlow2D/system/cellSetDict.1 b/tutorials/interFoam/nozzleFlow2D/system/cellSetDict.1 new file mode 100644 index 00000000000..ae151cca9d7 --- /dev/null +++ b/tutorials/interFoam/nozzleFlow2D/system/cellSetDict.1 @@ -0,0 +1,29 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object cellSetDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +name c0; + +action new; + +topoSetSources +( + boxToCell + { + box (0 0 -20e-06) (3600e-6 800e-06 40e-06); + } +); + +// ************************************************************************* // diff --git a/tutorials/interFoam/nozzleFlow2D/system/cellSetDict.2 b/tutorials/interFoam/nozzleFlow2D/system/cellSetDict.2 new file mode 100644 index 00000000000..d56de07c7ff --- /dev/null +++ b/tutorials/interFoam/nozzleFlow2D/system/cellSetDict.2 @@ -0,0 +1,29 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object cellSetDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +name c0; + +action new; + +topoSetSources +( + boxToCell + { + box (0 0 -20e-06) (3600e-6 300e-06 20e-06); + } +); + +// ************************************************************************* // diff --git a/tutorials/interFoam/nozzleFlow2D/system/controlDict b/tutorials/interFoam/nozzleFlow2D/system/controlDict new file mode 100644 index 00000000000..06a945316da --- /dev/null +++ b/tutorials/interFoam/nozzleFlow2D/system/controlDict @@ -0,0 +1,53 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application lesInterFoam; + +startFrom latestTime; + +startTime 0; + +stopAt endTime; + +endTime 4e-05; + +deltaT 1e-08; + +writeControl adjustableRunTime; + +writeInterval 1e-06; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 8; + +writeCompression uncompressed; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + +adjustTimeStep yes; + +maxCo 0.5; + +maxDeltaT 1e-08; + +// ************************************************************************* // diff --git a/tutorials/interFoam/nozzleFlow2D/system/fvSchemes b/tutorials/interFoam/nozzleFlow2D/system/fvSchemes new file mode 100644 index 00000000000..2d28e02de03 --- /dev/null +++ b/tutorials/interFoam/nozzleFlow2D/system/fvSchemes @@ -0,0 +1,63 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default Gauss linear; +} + +divSchemes +{ + div(rho*phi,U) Gauss linear; + div(phi,alpha) Gauss vanLeer; + div(phirb,alpha) Gauss interfaceCompression; + div(phi,k) Gauss limitedLinear 1; + div(phi,B) Gauss limitedLinear 1; + div(B) Gauss linear; + div(phi,nuTilda) Gauss limitedLinear 1; + div((nuEff*dev(grad(U).T()))) Gauss linear; +} + +laplacianSchemes +{ + default Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; + interpolate(HbyA) linear; +} + +snGradSchemes +{ + default corrected; +} + +fluxRequired +{ + default no; + pd; + pcorr; + alpha1; +} + +// ************************************************************************* // diff --git a/tutorials/interFoam/nozzleFlow2D/system/fvSolution b/tutorials/interFoam/nozzleFlow2D/system/fvSolution new file mode 100644 index 00000000000..8d5181515e9 --- /dev/null +++ b/tutorials/interFoam/nozzleFlow2D/system/fvSolution @@ -0,0 +1,121 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + pcorr PCG + { + preconditioner GAMG + { + tolerance 1e-5; + relTol 0; + + smoother DICGaussSeidel; + nPreSweeps 0; + nPostSweeps 2; + nBottomSweeps 2; + + cacheAgglomeration false; + nCellsInCoarsestLevel 10; + agglomerator faceAreaPair; + mergeLevels 1; + }; + + tolerance 1e-5; + relTol 0; + maxIter 100; + }; + + pd GAMG + { + tolerance 1e-7; + relTol 0.01; + + smoother DIC; //GaussSeidel; + nPreSweeps 0; + nPostSweeps 2; + nFinestSweeps 2; + + cacheAgglomeration true; + nCellsInCoarsestLevel 10; + agglomerator faceAreaPair; + mergeLevels 1; + }; + + pdFinal PCG + { + preconditioner GAMG + { + tolerance 1e-7; + relTol 0; + + nVcycles 2; + + smoother DICGaussSeidel; + nPreSweeps 2; + nPostSweeps 2; + nFinestSweeps 2; + + cacheAgglomeration true; + nCellsInCoarsestLevel 10; + agglomerator faceAreaPair; + mergeLevels 1; + }; + + tolerance 1e-7; + relTol 0; + maxIter 20; + }; + + U smoothSolver + { + smoother GaussSeidel; + tolerance 1e-6; + relTol 0; + nSweeps 1; + }; + + k PBiCG + { + preconditioner DILU; + tolerance 1e-08; + relTol 0; + }; + B PBiCG + { + preconditioner DILU; + tolerance 1e-08; + relTol 0; + }; + nuTilda PBiCG + { + preconditioner DILU; + tolerance 1e-08; + relTol 0; + }; +} + +PISO +{ + momentumPredictor no; + nCorrectors 2; + nNonOrthogonalCorrectors 1; + nAlphaCorr 1; + nAlphaSubCycles 4; + cAlpha 2; +} + +// ************************************************************************* // diff --git a/tutorials/interFoam/nozzleFlow2D/system/refineMeshDict b/tutorials/interFoam/nozzleFlow2D/system/refineMeshDict new file mode 100644 index 00000000000..170cf1ffab6 --- /dev/null +++ b/tutorials/interFoam/nozzleFlow2D/system/refineMeshDict @@ -0,0 +1,44 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object refineMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +set c0; + +coordinateSystem global; + +globalCoeffs +{ + tan1 (1 0 0); + tan2 (0 1 0); +} + +patchLocalCoeffs +{ + patch outside; + tan1 (1 0 0); +} + +directions +( + tan1 +); + +useHexTopology no; + +geometricCut yes; + +writeMesh no; + +// ************************************************************************* // -- GitLab