From 6bd200d0b56d89858f3769362961367bbb65b44a Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Wed, 12 Jan 2022 16:46:18 +0000 Subject: [PATCH] multiphaseEulerFoam: New phaseInterface system to replace phasePair A new class, phaseInterface, has been added to represent interfacial configurations between pairs of phases. This class and its derivations explicitly represent different configurations (e.g., dispersal, segregation, displacement) by type and provide a run-time selection mechanism so that these configurations can be uniquely named and intuitively selected for sub-models to apply to. For example, drag models can be selected for an air-water system with full phase inversion with the following syntax in constant/phaseProperties: drag { air_dispersedIn_water { type IshiiZuber; } air_segregatedWith_water { type segregated; m 0.5; n 8; } steam_dispersedIn_water { type SchillerNaumann; residualRe 1e-3; } } As well as the entries now being underscore separated, note also that the sub model sections are now dictionaries ("{ ... }"), rather than lists ("( ... );"). If a list is provided instead, then the input will be considered to be in the old syntax, and will be read in a backwards compatibility mode. The new dictionary syntax permits substitution and therefore reuse of settings, reducing the workload associated with setting up a large case with many model combinations. In future it may be possible to introduce wildcards to further reduce the verbosity of the input. The new phase-interface classes and keywords and the phase-pairs and keywords that they replace are listed below: Default/General: phaseInterface "_" replaces phasePair "( and )" Dispersed: dispersedPhaseInterface "_dispersedIn_" replaces orderedPhasePair "( in )" Segregated: segregatedPhaseInterface "_segregatedWith_" replaces phasePair "( and )" Sided: sidedPhaseInterface "__inThe_" replaces orderedPhasePair "( in )" Displaced: displacedPhaseInterface "__displacedBy_" is new Interface combinations are also possible. There can be, for example, an interface which is both dispersed and sided. This class is the dispersedSidedPhaseInterface and can be selected with the keyword "_dispersedIn__inThe_". This is needed, for example, in two-resistance heat transfer modelling, where a different model can be selected to represent heat transfer within the fluids on either side of an interface. A full list of all available phase interface relationships can be generated by specifying an incorrect name, and viewing the output of the error message that results. The "displaced" interface is not currently used, but will shortly be utilised to allowing the user to control how models between phases change as the fraction of a third phase becomes significant and displaces the phases associated with the interface in question. Notes for developers: There is no centralised storage of phase interface relationships in the phase system any more; the table of phasePairs has been removed, and there is no correcponding table of phaseInterfaces. Models now locally store their own phaseInterface objects, or a derivation thereof, rather than a reference to a centrally stored object. These phaseInterface classes hold only references so there is no cost associated with their duplication in multiple sub models. If a model requires an interface of a specific type, it has to down-cast the interface provided to it. There is a `phaseSystem::modelCast` method for this purpose which also provides meaningful error messages in the event that an inappropriate interface was specified and the cast fails. Model generation is now hierarchical. Wrapper models (blended and sided) are constructed with the same interface as non-wrapper models (drag, virtual mass, etc...). The wrapper model constructors call the constructors of their sub-models directly, rather than requiring model pointers to be passed in. Sub-model lookup has been significantly generalised and simplified. There is now just one `phaseSystem::lookupInterfacialModel` method which takes a phaseInterface as its argument. Looking up a model for a specific configuration just requires providing the appropriate phaseInterface. E.g., this call will return the virtual mass model for gas bubbles in liquid: lookupSubModel(dispersedPhaseInterface(gas, liquid)) Whilst this call will return the drag model for the segregated regime: lookupSubModel(segregatedPhaseInterface(phase1, phase2)) And this call will return the complete blended heat transfer model: lookupSubModel(phaseInterface(phase1, phase2)) --- .../functionObjects/phaseForces/phaseForces.C | 302 ++++----- .../functionObjects/phaseForces/phaseForces.H | 12 +- .../Frossling/Frossling.C | 22 +- .../Frossling/Frossling.H | 11 +- .../diffusiveMassTransferModel.C | 24 +- .../diffusiveMassTransferModel.H | 91 ++- .../diffusiveMassTransferModelNew.C | 42 +- .../sphericalDiffusiveMassTransfer.C | 17 +- .../sphericalDiffusiveMassTransfer.H | 12 +- .../interfaceCompositionModels/Henry/Henry.C | 19 +- .../interfaceCompositionModels/Henry/Henry.H | 10 +- .../Raoult/Raoult.C | 25 +- .../Raoult/Raoult.H | 10 +- .../interfaceCompositionModel.C | 44 +- .../interfaceCompositionModel.H | 60 +- .../interfaceCompositionModelI.H | 9 +- .../interfaceCompositionModelNew.C | 33 +- .../nonRandomTwoLiquid/nonRandomTwoLiquid.C | 35 +- .../nonRandomTwoLiquid/nonRandomTwoLiquid.H | 10 +- .../saturated/saturated.C | 10 +- .../saturated/saturated.H | 10 +- .../saturationModels/Antoine/Antoine.C | 6 +- .../saturationModels/Antoine/Antoine.H | 11 +- .../AntoineExtended/AntoineExtended.C | 6 +- .../AntoineExtended/AntoineExtended.H | 11 +- .../saturationModels/ArdenBuck/ArdenBuck.C | 8 +- .../saturationModels/ArdenBuck/ArdenBuck.H | 11 +- .../constantSaturationConditions.C | 6 +- .../constantSaturationConditions.H | 7 +- .../saturationModels/function1/function1.C | 11 +- .../saturationModels/function1/function1.H | 11 +- .../saturationModels/polynomial/polynomial.C | 6 +- .../saturationModels/polynomial/polynomial.H | 11 +- .../saturationModel/saturationModel.C | 33 +- .../saturationModel/saturationModel.H | 45 +- .../saturationModel/saturationModelNew.C | 17 +- .../constantSurfaceTensionCoefficient.C | 23 +- .../constantSurfaceTensionCoefficient.H | 9 +- .../surfaceTensionModel/surfaceTensionModel.C | 28 +- .../surfaceTensionModel/surfaceTensionModel.H | 29 +- .../surfaceTensionModelNew.C | 18 +- .../interfacialModels/Make/files | 5 + .../TomiyamaAspectRatio/TomiyamaAspectRatio.C | 11 +- .../TomiyamaAspectRatio/TomiyamaAspectRatio.H | 6 +- .../VakhrushevEfremov/VakhrushevEfremov.C | 9 +- .../VakhrushevEfremov/VakhrushevEfremov.H | 6 +- .../aspectRatioModels/Wellek/Wellek.C | 9 +- .../aspectRatioModels/Wellek/Wellek.H | 6 +- .../aspectRatioModel/aspectRatioModel.C | 7 +- .../aspectRatioModel/aspectRatioModel.H | 22 +- .../aspectRatioModel/aspectRatioModelNew.C | 12 +- .../constantAspectRatio/constantAspectRatio.C | 11 +- .../constantAspectRatio/constantAspectRatio.H | 6 +- .../AttouFerschneider/AttouFerschneider.C | 53 +- .../AttouFerschneider/AttouFerschneider.H | 15 +- .../dragModels/Beetstra/Beetstra.C | 13 +- .../dragModels/Beetstra/Beetstra.H | 10 +- .../dragModels/Ergun/Ergun.C | 16 +- .../dragModels/Ergun/Ergun.H | 10 +- .../dragModels/Gibilaro/Gibilaro.C | 13 +- .../dragModels/Gibilaro/Gibilaro.H | 10 +- .../GidaspowErgunWenYu/GidaspowErgunWenYu.C | 31 +- .../GidaspowErgunWenYu/GidaspowErgunWenYu.H | 21 +- .../GidaspowSchillerNaumann.C | 13 +- .../GidaspowSchillerNaumann.H | 10 +- .../dragModels/IshiiZuber/IshiiZuber.C | 21 +- .../dragModels/IshiiZuber/IshiiZuber.H | 10 +- .../interfacialModels/dragModels/Lain/Lain.C | 9 +- .../interfacialModels/dragModels/Lain/Lain.H | 10 +- .../SchillerNaumann/SchillerNaumann.C | 9 +- .../SchillerNaumann/SchillerNaumann.H | 10 +- .../dragModels/SyamlalOBrien/SyamlalOBrien.C | 13 +- .../dragModels/SyamlalOBrien/SyamlalOBrien.H | 10 +- .../dragModels/Tenneti/Tenneti.C | 13 +- .../dragModels/Tenneti/Tenneti.H | 10 +- .../TomiyamaAnalytic/TomiyamaAnalytic.C | 13 +- .../TomiyamaAnalytic/TomiyamaAnalytic.H | 10 +- .../TomiyamaCorrelated/TomiyamaCorrelated.C | 11 +- .../TomiyamaCorrelated/TomiyamaCorrelated.H | 10 +- .../TomiyamaKataokaZunSakaguchi.C | 13 +- .../TomiyamaKataokaZunSakaguchi.H | 10 +- .../dragModels/WenYu/WenYu.C | 13 +- .../dragModels/WenYu/WenYu.H | 10 +- .../dragModels/aerosolDrag/aerosolDrag.C | 13 +- .../dragModels/aerosolDrag/aerosolDrag.H | 10 +- .../dispersedDragModel/dispersedDragModel.C | 93 +++ .../dispersedDragModel/dispersedDragModel.H | 118 ++++ .../dragModels/dragModel/dragModel.C | 67 +- .../dragModels/dragModel/dragModel.H | 79 ++- .../dragModels/dragModel/dragModelNew.C | 27 +- .../dragModels/segregated/segregated.C | 42 +- .../dragModels/segregated/segregated.H | 13 +- .../timeScaleFilteredDrag.C | 29 +- .../timeScaleFilteredDrag.H | 10 +- .../heatTransferModels/Gunn/Gunn.C | 23 +- .../heatTransferModels/Gunn/Gunn.H | 12 +- .../RanzMarshall/RanzMarshall.C | 19 +- .../RanzMarshall/RanzMarshall.H | 12 +- .../constantNu/constantNuHeatTransfer.C | 17 +- .../constantNu/constantNuHeatTransfer.H | 10 +- .../heatTransferModel/heatTransferModel.C | 35 +- .../heatTransferModel/heatTransferModel.H | 89 ++- .../heatTransferModel/heatTransferModelNew.C | 44 +- .../sphericalHeatTransfer.C | 17 +- .../sphericalHeatTransfer.H | 12 +- .../timeScaleFilteredHeatTransfer.C | 24 +- .../timeScaleFilteredHeatTransfer.H | 9 +- .../LegendreMagnaudet/LegendreMagnaudet.C | 21 +- .../LegendreMagnaudet/LegendreMagnaudet.H | 13 +- .../liftModels/Moraga/Moraga.C | 15 +- .../liftModels/Moraga/Moraga.H | 13 +- .../liftModels/TomiyamaLift/TomiyamaLift.C | 13 +- .../liftModels/TomiyamaLift/TomiyamaLift.H | 11 +- .../constantLiftCoefficient.C | 11 +- .../constantLiftCoefficient.H | 13 +- .../dispersedLiftModel/dispersedLiftModel.C | 76 +++ .../dispersedLiftModel/dispersedLiftModel.H | 107 +++ .../liftModels/liftModel/liftModel.C | 30 +- .../liftModels/liftModel/liftModel.H | 74 +- .../liftModels/liftModel/liftModelNew.C | 26 +- .../liftModels/noLift/noLift.C | 33 +- .../liftModels/noLift/noLift.H | 24 +- .../wallDampedLift/wallDampedLift.C | 29 +- .../wallDampedLift/wallDampedLift.H | 15 +- .../deposition/deposition.C | 18 +- .../deposition/deposition.H | 12 +- .../phaseTransferModel/phaseTransferModel.C | 55 +- .../phaseTransferModel/phaseTransferModel.H | 69 +- .../phaseTransferModelNew.C | 28 +- .../reactionDriven/reactionDriven.C | 22 +- .../reactionDriven/reactionDriven.H | 13 +- .../TomiyamaSwarm/TomiyamaSwarm.C | 11 +- .../TomiyamaSwarm/TomiyamaSwarm.H | 7 +- .../swarmCorrections/noSwarm/noSwarm.C | 12 +- .../swarmCorrections/noSwarm/noSwarm.H | 10 +- .../swarmCorrection/swarmCorrection.C | 8 +- .../swarmCorrection/swarmCorrection.H | 22 +- .../swarmCorrection/swarmCorrectionNew.C | 12 +- .../turbulentDispersionModels/Burns/Burns.C | 37 +- .../turbulentDispersionModels/Burns/Burns.H | 13 +- .../turbulentDispersionModels/Gosman/Gosman.C | 21 +- .../turbulentDispersionModels/Gosman/Gosman.H | 13 +- .../LopezDeBertodano/LopezDeBertodano.C | 9 +- .../LopezDeBertodano/LopezDeBertodano.H | 13 +- .../constantTurbulentDispersionCoefficient.C | 11 +- .../constantTurbulentDispersionCoefficient.H | 13 +- .../dispersedTurbulentDispersionModel.C | 73 ++ .../dispersedTurbulentDispersionModel.H | 99 +++ .../noTurbulentDispersion.C | 12 +- .../noTurbulentDispersion.H | 15 +- .../turbulentDispersionModel.C | 23 +- .../turbulentDispersionModel.H | 70 +- .../turbulentDispersionModelNew.C | 34 +- .../virtualMassModels/Lamb/Lamb.C | 9 +- .../virtualMassModels/Lamb/Lamb.H | 11 +- .../constantVirtualMassCoefficient.C | 11 +- .../constantVirtualMassCoefficient.H | 13 +- .../dispersedVirtualMassModel.C | 72 ++ .../dispersedVirtualMassModel.H | 115 ++++ .../noVirtualMass/noVirtualMass.C | 29 +- .../noVirtualMass/noVirtualMass.H | 27 +- .../virtualMassModel/virtualMassModel.C | 47 +- .../virtualMassModel/virtualMassModel.H | 79 ++- .../virtualMassModel/virtualMassModelNew.C | 30 +- .../cosine/cosineWallDamping.C | 9 +- .../cosine/cosineWallDamping.H | 9 +- .../linear/linearWallDamping.C | 9 +- .../linear/linearWallDamping.H | 9 +- .../wallDampingModels/sine/sineWallDamping.C | 9 +- .../wallDampingModels/sine/sineWallDamping.H | 9 +- .../wallDampingModel/wallDampingModel.C | 14 +- .../wallDampingModel/wallDampingModel.H | 25 +- .../wallDampingModel/wallDampingModelNew.C | 11 +- .../wallLubricationModels/Antal/Antal.C | 20 +- .../wallLubricationModels/Antal/Antal.H | 13 +- .../wallLubricationModels/Frank/Frank.C | 15 +- .../wallLubricationModels/Frank/Frank.H | 13 +- .../TomiyamaWallLubrication.C | 15 +- .../TomiyamaWallLubrication.H | 15 +- .../dispersedWallLubricationModel.C} | 55 +- .../dispersedWallLubricationModel.H | 103 +++ .../noWallLubrication/noWallLubrication.C | 30 +- .../noWallLubrication/noWallLubrication.H | 25 +- .../wallLubricationModel.C | 34 +- .../wallLubricationModel.H | 70 +- .../wallLubricationModelNew.C | 33 +- ...haseChangeWallFunctionFvPatchScalarField.C | 21 +- ...haseChangeWallFunctionFvPatchScalarField.H | 14 +- ...allBoilingWallFunctionFvPatchScalarField.C | 21 +- ...ocamustafaogullariIshiiDepartureDiameter.C | 4 +- ...camustafaogullariIshiiDepartureFrequency.C | 4 +- .../KocamustafaogullariIshiiNucleationSite.C | 4 +- .../kineticTheoryModel/kineticTheoryModel.C | 7 +- .../multiphaseSystems/multiphaseSystems.C | 5 +- .../BlendedInterfacialModel.C | 483 ++++++++----- .../BlendedInterfacialModel.H | 118 ++-- .../blendingMethod/blendingMethod.H | 7 +- .../blendingMethods/linear/linear.H | 4 +- .../blendingMethods/noBlending/noBlending.H | 4 +- .../phaseSystems/Make/files | 16 +- .../HeatTransferPhaseSystem.C | 104 ++- .../HeatTransferPhaseSystem.H | 18 +- .../heatTransferPhaseSystem.H | 20 +- ...terfaceCompositionPhaseChangePhaseSystem.C | 372 +++++----- ...terfaceCompositionPhaseChangePhaseSystem.H | 20 +- .../MomentumTransferPhaseSystem.C | 335 ++++----- .../MomentumTransferPhaseSystem.H | 70 +- .../OneResistanceHeatTransferPhaseSystem.C | 16 +- .../OneResistanceHeatTransferPhaseSystem.H | 12 +- .../PhaseTransferPhaseSystem.C | 81 +-- .../PhaseTransferPhaseSystem.H | 14 +- .../PopulationBalancePhaseSystem.C | 92 ++- .../PopulationBalancePhaseSystem.H | 4 +- .../ThermalPhaseChangePhaseSystem.C | 190 +++--- .../ThermalPhaseChangePhaseSystem.H | 10 +- .../TwoResistanceHeatTransferPhaseSystem.C | 85 +-- .../TwoResistanceHeatTransferPhaseSystem.H | 14 +- .../SidedInterfacialModel.C | 161 +++++ .../SidedInterfacialModel.H | 145 ++++ .../alphaContactAngleFvPatchScalarField.C | 217 ++++-- .../alphaContactAngleFvPatchScalarField.H | 130 ++-- .../IATE/IATEsources/IATEsource/IATEsource.H | 7 +- .../IATEsources/phaseChange/IATEphaseChange.C | 19 +- .../IATEsources/wallBoiling/IATEwallBoiling.C | 7 +- .../linearTsubDiameter/linearTsubDiameter.C | 18 +- .../KochFriedlander/KochFriedlander.H | 4 +- .../sinteringModels/noSintering/noSintering.H | 4 +- .../sinteringModel/sinteringModel.H | 4 +- .../dispersedDisplacedPhaseInterface.C | 100 +++ .../dispersedDisplacedPhaseInterface.H | 100 +++ .../dispersedDisplacedSidedPhaseInterface.C | 112 ++++ .../dispersedDisplacedSidedPhaseInterface.H | 103 +++ .../dispersedPhaseInterface.C} | 125 ++-- .../dispersedPhaseInterface.H | 146 ++++ .../dispersedSidedPhaseInterface.C | 98 +++ .../dispersedSidedPhaseInterface.H} | 54 +- .../displacedPhaseInterface.C | 97 +++ .../displacedPhaseInterface.H | 120 ++++ .../displacedSidedPhaseInterface.C | 98 +++ .../displacedSidedPhaseInterface.H | 100 +++ .../phaseInterface/phaseInterface.C | 521 ++++++++++++++ .../phaseInterface/phaseInterface.H | 405 +++++++++++ .../phaseInterface/phaseInterfaceI.H} | 76 ++- .../phaseInterfaceKey/phaseInterfaceKey.C | 119 ++++ .../phaseInterfaceKey/phaseInterfaceKey.H} | 87 ++- .../segregatedDisplacedPhaseInterface.C | 97 +++ .../segregatedDisplacedPhaseInterface.H | 100 +++ .../segregatedDisplacedSidedPhaseInterface.C | 111 +++ .../segregatedDisplacedSidedPhaseInterface.H | 102 +++ .../segregatedPhaseInterface.C | 92 +++ .../segregatedPhaseInterface.H | 106 +++ .../segregatedSidedPhaseInterface.C | 97 +++ .../segregatedSidedPhaseInterface.H | 98 +++ .../sidedPhaseInterface/sidedPhaseInterface.C | 97 +++ .../sidedPhaseInterface/sidedPhaseInterface.H | 121 ++++ .../phasePair/phasePair/phasePair.H | 229 ------- .../phasePair/phasePairKey/phasePairKey.C | 166 ----- .../phaseSystems/phaseSystem/phaseSystem.C | 233 +++---- .../phaseSystems/phaseSystem/phaseSystem.H | 253 +++---- .../phaseSystems/phaseSystem/phaseSystemI.H | 9 +- .../phaseSystem/phaseSystemSolve.C | 12 +- .../phaseSystem/phaseSystemTemplates.C | 633 +++++++++--------- .../coalescenceModels/Luo/Luo.C | 16 +- .../driftModels/phaseChange/phaseChange.C | 64 +- .../driftModels/phaseChange/phaseChange.H | 6 +- .../reactionDriven/reactionDriven.C | 24 +- .../reactionDriven/reactionDriven.H | 5 +- .../populationBalanceModel.C | 175 ++--- .../populationBalanceModel.H | 40 +- .../populationBalanceModelI.H | 34 +- .../phaseCompressible/LES/Niceno/NicenoKEqn.C | 6 +- .../RAS/LaheyKEpsilon/LaheyKEpsilon.C | 8 +- .../continuousGasKEpsilon.C | 16 +- .../RAS/mixtureKEpsilon/mixtureKEpsilon.C | 23 +- 274 files changed, 8653 insertions(+), 4402 deletions(-) create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/dispersedDragModel/dispersedDragModel.C create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/dispersedDragModel/dispersedDragModel.H create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/dispersedLiftModel/dispersedLiftModel.C create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/dispersedLiftModel/dispersedLiftModel.H create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/dispersedTurbulentDispersionModel/dispersedTurbulentDispersionModel.C create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/dispersedTurbulentDispersionModel/dispersedTurbulentDispersionModel.H create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/virtualMassModels/dispersedVirtualMassModel/dispersedVirtualMassModel.C create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/virtualMassModels/dispersedVirtualMassModel/dispersedVirtualMassModel.H rename applications/solvers/multiphase/multiphaseEulerFoam/{phaseSystems/phasePair/orderedPhasePair/orderedPhasePair.C => interfacialModels/wallLubricationModels/dispersedWallLubricationModel/dispersedWallLubricationModel.C} (60%) create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallLubricationModels/dispersedWallLubricationModel/dispersedWallLubricationModel.H create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/SidedInterfacialModel/SidedInterfacialModel.C create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/SidedInterfacialModel/SidedInterfacialModel.H create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/phaseInterface/dispersedDisplacedPhaseInterface/dispersedDisplacedPhaseInterface.C create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/phaseInterface/dispersedDisplacedPhaseInterface/dispersedDisplacedPhaseInterface.H create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/phaseInterface/dispersedDisplacedSidedPhaseInterface/dispersedDisplacedSidedPhaseInterface.C create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/phaseInterface/dispersedDisplacedSidedPhaseInterface/dispersedDisplacedSidedPhaseInterface.H rename applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/{phasePair/phasePair/phasePair.C => phaseInterface/dispersedPhaseInterface/dispersedPhaseInterface.C} (51%) create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/phaseInterface/dispersedPhaseInterface/dispersedPhaseInterface.H create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/phaseInterface/dispersedSidedPhaseInterface/dispersedSidedPhaseInterface.C rename applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/{phasePair/orderedPhasePair/orderedPhasePair.H => phaseInterface/dispersedSidedPhaseInterface/dispersedSidedPhaseInterface.H} (64%) create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/phaseInterface/displacedPhaseInterface/displacedPhaseInterface.C create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/phaseInterface/displacedPhaseInterface/displacedPhaseInterface.H create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/phaseInterface/displacedSidedPhaseInterface/displacedSidedPhaseInterface.C create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/phaseInterface/displacedSidedPhaseInterface/displacedSidedPhaseInterface.H create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/phaseInterface/phaseInterface/phaseInterface.C create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/phaseInterface/phaseInterface/phaseInterface.H rename applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/{phasePair/phasePair/phasePairI.H => phaseInterface/phaseInterface/phaseInterfaceI.H} (60%) create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/phaseInterface/phaseInterfaceKey/phaseInterfaceKey.C rename applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/{phasePair/phasePairKey/phasePairKey.H => phaseInterface/phaseInterfaceKey/phaseInterfaceKey.H} (57%) create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/phaseInterface/segregatedDisplacedPhaseInterface/segregatedDisplacedPhaseInterface.C create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/phaseInterface/segregatedDisplacedPhaseInterface/segregatedDisplacedPhaseInterface.H create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/phaseInterface/segregatedDisplacedSidedPhaseInterface/segregatedDisplacedSidedPhaseInterface.C create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/phaseInterface/segregatedDisplacedSidedPhaseInterface/segregatedDisplacedSidedPhaseInterface.H create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/phaseInterface/segregatedPhaseInterface/segregatedPhaseInterface.C create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/phaseInterface/segregatedPhaseInterface/segregatedPhaseInterface.H create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/phaseInterface/segregatedSidedPhaseInterface/segregatedSidedPhaseInterface.C create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/phaseInterface/segregatedSidedPhaseInterface/segregatedSidedPhaseInterface.H create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/phaseInterface/sidedPhaseInterface/sidedPhaseInterface.C create mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/phaseInterface/sidedPhaseInterface/sidedPhaseInterface.H delete mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/phasePair/phasePair/phasePair.H delete mode 100644 applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/phasePair/phasePairKey/phasePairKey.C diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/functionObjects/phaseForces/phaseForces.C b/applications/solvers/multiphase/multiphaseEulerFoam/functionObjects/phaseForces/phaseForces.C index 5aa0571eca..8d31721ea9 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/functionObjects/phaseForces/phaseForces.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/functionObjects/phaseForces/phaseForces.C @@ -25,7 +25,6 @@ License #include "phaseForces.H" #include "addToRunTimeSelectionTable.H" -#include "BlendedInterfacialModel.H" #include "fvcGrad.H" #include "dragModel.H" #include "virtualMassModel.H" @@ -45,26 +44,6 @@ namespace functionObjects } -// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * // - -template -Foam::tmp -Foam::functionObjects::phaseForces::nonDragForce(const phasePair& pair) const -{ - const BlendedInterfacialModel& model = - fluid_.lookupBlendedSubModel(pair); - - if (&pair.phase1() == &phase_) - { - return -model.template F(); - } - else - { - return model.template F(); - } -} - - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::functionObjects::phaseForces::phaseForces @@ -86,123 +65,127 @@ Foam::functionObjects::phaseForces::phaseForces { read(dict); - forAllConstIter - ( - phaseSystem::phasePairTable, - fluid_.phasePairs(), - pairIter - ) + forAll(fluid_.phases(), phasei) { - const phasePair& pair = pairIter(); + const phaseModel& otherPhase = fluid_.phases()[phasei]; - if (pair.contains(phase_) && !pair.ordered()) + if (&otherPhase == &phase_) continue; + + const phaseInterface interface(phase_, otherPhase); + + if (fluid_.foundInterfacialModel(interface)) { - if (fluid_.foundBlendedSubModel(pair)) - { - forceFields_.insert + forceFields_.insert + ( + dragModel::typeName, + new volVectorField ( - dragModel::typeName, - new volVectorField + IOobject ( - IOobject - ( - IOobject::groupName("dragForce", phase_.name()), - mesh_.time().timeName(), - mesh_ - ), - mesh_, - dimensionedVector(dimForce/dimVolume, Zero) - ) - ); - } + IOobject::groupName("dragForce", phase_.name()), + mesh_.time().timeName(), + mesh_ + ), + mesh_, + dimensionedVector(dimForce/dimVolume, Zero) + ) + ); + } - if (fluid_.foundBlendedSubModel(pair)) - { - forceFields_.insert + if (fluid_.foundInterfacialModel(interface)) + { + forceFields_.insert + ( + virtualMassModel::typeName, + new volVectorField ( - virtualMassModel::typeName, - new volVectorField + IOobject ( - IOobject + IOobject::groupName ( - IOobject::groupName - ( - "virtualMassForce", - phase_.name() - ), - mesh_.time().timeName(), - mesh_ + "virtualMassForce", + phase_.name() ), - mesh_, - dimensionedVector(dimForce/dimVolume, Zero) - ) - ); - } + mesh_.time().timeName(), + mesh_ + ), + mesh_, + dimensionedVector(dimForce/dimVolume, Zero) + ) + ); + } - if (fluid_.foundBlendedSubModel(pair)) - { - forceFields_.insert + if (fluid_.foundInterfacialModel(interface)) + { + forceFields_.insert + ( + liftModel::typeName, + new volVectorField ( - liftModel::typeName, - new volVectorField + IOobject ( - IOobject - ( - IOobject::groupName("liftForce", phase_.name()), - mesh_.time().timeName(), - mesh_ - ), - mesh_, - dimensionedVector(dimForce/dimVolume, Zero) - ) - ); - } + IOobject::groupName("liftForce", phase_.name()), + mesh_.time().timeName(), + mesh_ + ), + mesh_, + dimensionedVector(dimForce/dimVolume, Zero) + ) + ); + } - if (fluid_.foundBlendedSubModel(pair)) - { - forceFields_.insert + if + ( + fluid_.foundInterfacialModel + (interface) + ) + { + forceFields_.insert + ( + wallLubricationModel::typeName, + new volVectorField ( - wallLubricationModel::typeName, - new volVectorField + IOobject ( - IOobject + IOobject::groupName ( - IOobject::groupName - ( - "wallLubricationForce", - phase_.name() - ), - mesh_.time().timeName(), - mesh_ + "wallLubricationForce", + phase_.name() ), - mesh_, - dimensionedVector(dimForce/dimVolume, Zero) - ) - ); - } + mesh_.time().timeName(), + mesh_ + ), + mesh_, + dimensionedVector(dimForce/dimVolume, Zero) + ) + ); + } - if (fluid_.foundBlendedSubModel(pair)) - { - forceFields_.insert + if + ( + fluid_.foundInterfacialModel + (interface) + ) + { + forceFields_.insert + ( + turbulentDispersionModel::typeName, + new volVectorField ( - turbulentDispersionModel::typeName, - new volVectorField + IOobject ( - IOobject + IOobject::groupName ( - IOobject::groupName - ( - "turbulentDispersionForce", - phase_.name() - ), - mesh_.time().timeName(), - mesh_ + "turbulentDispersionForce", + phase_.name() ), - mesh_, - dimensionedVector(dimForce/dimVolume, Zero) - ) - ); - } + mesh_.time().timeName(), + mesh_ + ), + mesh_, + dimensionedVector(dimForce/dimVolume, Zero) + ) + ); } } } @@ -238,53 +221,62 @@ bool Foam::functionObjects::phaseForces::execute() } // Add the forces from all the interfaces which contain this phase - forAllConstIter - ( - phaseSystem::phasePairTable, - fluid_.phasePairs(), - pairIter - ) + forAll(fluid_.phases(), phasei) { - const phasePair& pair = pairIter(); + const phaseModel& otherPhase = fluid_.phases()[phasei]; - if (pair.contains(phase_) && !pair.ordered()) + if (&otherPhase == &phase_) continue; + + const phaseInterface interface(phase_, otherPhase); + + if (fluid_.foundInterfacialModel(interface)) { - if (fluid_.foundBlendedSubModel(pair)) - { - *forceFields_[dragModel::typeName] += - fluid_.lookupBlendedSubModel(pair).K() - *(pair.otherPhase(phase_).U() - phase_.U()); - } + *forceFields_[dragModel::typeName] += + fluid_.lookupInterfacialModel(interface).K() + *(otherPhase.U() - phase_.U()); + } - if (fluid_.foundBlendedSubModel(pair)) - { - *forceFields_[virtualMassModel::typeName] += - fluid_.lookupBlendedSubModel(pair).K() - *(pair.otherPhase(phase_).DUDt() - phase_.DUDt()); - } + if (fluid_.foundInterfacialModel(interface)) + { + *forceFields_[virtualMassModel::typeName] += + fluid_.lookupInterfacialModel + (interface).K() + *(otherPhase.DUDt() - phase_.DUDt()); + } - if (fluid_.foundBlendedSubModel(pair)) - { - *forceFields_[liftModel::typeName] += - nonDragForce(pair); - } + if (fluid_.foundInterfacialModel(interface)) + { + *forceFields_[liftModel::typeName] += + (&interface.phase1() == &phase_ ? -1 : +1) + *fluid_.lookupInterfacialModel(interface).F(); + } - if (fluid_.foundBlendedSubModel(pair)) - { - *forceFields_[wallLubricationModel::typeName] += - nonDragForce(pair); - } + if + ( + fluid_.foundInterfacialModel + (interface) + ) + { + *forceFields_[wallLubricationModel::typeName] += + (&interface.phase1() == &phase_ ? -1 : +1) + *fluid_.lookupInterfacialModel + (interface).F(); + } - if (fluid_.foundBlendedSubModel(pair)) - { - *forceFields_[turbulentDispersionModel::typeName] += - fluid_.lookupBlendedSubModel - ( - pair - ).D() - *(&pair.phase1() == &phase_ ? -1 : +1) - *fvc::grad(pair.phase1()/(pair.phase1() + pair.phase2())); - } + if + ( + fluid_.foundInterfacialModel + (interface) + ) + { + *forceFields_[turbulentDispersionModel::typeName] += + fluid_.lookupInterfacialModel + (interface).D() + *fvc::grad + ( + otherPhase + /max(phase_ + otherPhase, otherPhase.residualAlpha()) + ); } } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/functionObjects/phaseForces/phaseForces.H b/applications/solvers/multiphase/multiphaseEulerFoam/functionObjects/phaseForces/phaseForces.H index b16413ff3e..bad37f4a26 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/functionObjects/phaseForces/phaseForces.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/functionObjects/phaseForces/phaseForces.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2018-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2018-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -31,7 +31,7 @@ Description and in combination with the multiphaseEulerFoam solver. For a simulation involving more than two phases, the accumulated force is - calculated by looping over all phasePairs involving that phase. The fields + calculated by looping over all interfaces involving that phase. The fields are stored in the database so that they can be processed further, e.g. with the fieldAveraging functionObject. @@ -89,6 +89,7 @@ protected: // Protected data + //- Force fields HashPtrTable forceFields_; //- Phase for which forces are evaluated @@ -98,13 +99,6 @@ protected: const phaseSystem& fluid_; - // Protected Member Functions - - //- Evaluate and return non-drag force - template - tmp nonDragForce(const phasePair& key) const; - - public: //- Runtime type information diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/diffusiveMassTransferModels/Frossling/Frossling.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/diffusiveMassTransferModels/Frossling/Frossling.C index 066c2948ee..e7fc7954b3 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/diffusiveMassTransferModels/Frossling/Frossling.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/diffusiveMassTransferModels/Frossling/Frossling.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "Frossling.H" -#include "phasePair.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -49,10 +48,18 @@ namespace diffusiveMassTransferModels Foam::diffusiveMassTransferModels::Frossling::Frossling ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) : - diffusiveMassTransferModel(dict, pair), + diffusiveMassTransferModel(dict, interface), + interface_ + ( + interface.modelCast + < + diffusiveMassTransferModel, + dispersedPhaseInterface + >() + ), Le_("Le", dimless, dict) {} @@ -68,9 +75,12 @@ Foam::diffusiveMassTransferModels::Frossling::~Frossling() Foam::tmp Foam::diffusiveMassTransferModels::Frossling::K() const { - volScalarField Sh(2 + 0.552*sqrt(pair_.Re())*cbrt(Le_*pair_.Pr())); + const volScalarField Sh + ( + 2 + 0.552*sqrt(interface_.Re())*cbrt(Le_*interface_.Pr()) + ); - return 6*pair_.dispersed()*Sh/sqr(pair_.dispersed().d()); + return 6*interface_.dispersed()*Sh/sqr(interface_.dispersed().d()); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/diffusiveMassTransferModels/Frossling/Frossling.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/diffusiveMassTransferModels/Frossling/Frossling.H index 63fd8e3ccb..6fb982e21f 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/diffusiveMassTransferModels/Frossling/Frossling.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/diffusiveMassTransferModels/Frossling/Frossling.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,8 +43,6 @@ SourceFiles namespace Foam { -class phasePair; - namespace diffusiveMassTransferModels { @@ -58,6 +56,9 @@ class Frossling { // Private Data + //- Interface + const dispersedPhaseInterface interface_; + //- Lewis number const dimensionedScalar Le_; @@ -70,11 +71,11 @@ public: // Constructors - //- Construct from components + //- Construct from a dictionary and an interface Frossling ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/diffusiveMassTransferModels/diffusiveMassTransferModel/diffusiveMassTransferModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/diffusiveMassTransferModels/diffusiveMassTransferModel/diffusiveMassTransferModel.C index 89dd787f21..714534275c 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/diffusiveMassTransferModels/diffusiveMassTransferModel/diffusiveMassTransferModel.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/diffusiveMassTransferModels/diffusiveMassTransferModel/diffusiveMassTransferModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,8 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "diffusiveMassTransferModel.H" -#include "phasePair.H" -#include "BlendedInterfacialModel.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -37,6 +35,11 @@ namespace Foam diffusiveMassTransferModel, 0 ); + defineSidedInterfacialModelTypeNameAndDebug + ( + blendedDiffusiveMassTransferModel, + 0 + ); defineRunTimeSelectionTable(diffusiveMassTransferModel, dictionary); } @@ -48,10 +51,8 @@ const Foam::dimensionSet Foam::diffusiveMassTransferModel::dimK(0, -2, 0, 0, 0); Foam::diffusiveMassTransferModel::diffusiveMassTransferModel ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) -: - pair_(pair) {} @@ -61,4 +62,15 @@ Foam::diffusiveMassTransferModel::~diffusiveMassTransferModel() {} +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp +Foam::blendedDiffusiveMassTransferModel::K() const +{ + tmp (diffusiveMassTransferModel::*k)() const = + &diffusiveMassTransferModel::K; + return evaluate(k, "K", diffusiveMassTransferModel::dimK, false); +} + + // ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/diffusiveMassTransferModels/diffusiveMassTransferModel/diffusiveMassTransferModel.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/diffusiveMassTransferModels/diffusiveMassTransferModel/diffusiveMassTransferModel.H index 025e493dd2..108156f8c3 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/diffusiveMassTransferModels/diffusiveMassTransferModel/diffusiveMassTransferModel.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/diffusiveMassTransferModels/diffusiveMassTransferModel/diffusiveMassTransferModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,6 +25,7 @@ Class Foam::diffusiveMassTransferModel Description + Model for diffusive mass transfer coefficients between two phases SourceFiles diffusiveMassTransferModel.C @@ -39,11 +40,13 @@ SourceFiles #include "volFields.H" #include "dictionary.H" #include "runTimeSelectionTables.H" +#include "BlendedInterfacialModel.H" +#include "SidedInterfacialModel.H" namespace Foam { -class phasePair; +class phaseSystem; /*---------------------------------------------------------------------------*\ Class diffusiveMassTransferModel Declaration @@ -51,14 +54,6 @@ class phasePair; class diffusiveMassTransferModel { -protected: - - // Protected data - - //- Phase pair - const phasePair& pair_; - - public: //- Runtime type information @@ -74,9 +69,9 @@ public: dictionary, ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ), - (dict, pair) + (dict, interface) ); @@ -85,14 +80,17 @@ public: //- Coefficient dimensions static const dimensionSet dimK; + //- Does this model require correcting on fixed flux boundaries? + static const bool correctFixedFluxBCs = false; + // Constructors - //- Construct from a dictionary and a phase pair + //- Construct from a dictionary and an interface diffusiveMassTransferModel ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ); @@ -105,7 +103,7 @@ public: static autoPtr New ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ); @@ -117,6 +115,69 @@ public: }; +/*---------------------------------------------------------------------------*\ + Class blendedDiffusiveMassTransferModel Declaration +\*---------------------------------------------------------------------------*/ + +class blendedDiffusiveMassTransferModel +: + public BlendedInterfacialModel +{ +public: + + // Constructors + + //- Inherit base class constructors + using + BlendedInterfacialModel:: + BlendedInterfacialModel; + + + // Selectors + + static autoPtr New + ( + const dictionary& dict, + const phaseInterface& interface + ); + + + // Member Functions + + //- Return the heatTransfer coefficient K + tmp K() const; +}; + + + +/*---------------------------------------------------------------------------*\ + Class sidedBlendedDiffusiveMassTransferModel Declaration +\*---------------------------------------------------------------------------*/ + +class sidedBlendedDiffusiveMassTransferModel +: + public SidedInterfacialModel +{ +public: + + // Constructors + + //- Inherit base class constructors + using + SidedInterfacialModel:: + SidedInterfacialModel; + + + // Selectors + + static autoPtr New + ( + const dictionary& dict, + const phaseInterface& interface + ); +}; + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/diffusiveMassTransferModels/diffusiveMassTransferModel/diffusiveMassTransferModelNew.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/diffusiveMassTransferModels/diffusiveMassTransferModel/diffusiveMassTransferModelNew.C index 49f4175e7c..086fc1352c 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/diffusiveMassTransferModels/diffusiveMassTransferModel/diffusiveMassTransferModelNew.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/diffusiveMassTransferModels/diffusiveMassTransferModel/diffusiveMassTransferModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "diffusiveMassTransferModel.H" -#include "phasePair.H" // * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * // @@ -32,13 +31,16 @@ Foam::autoPtr Foam::diffusiveMassTransferModel::New ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) { - word diffusiveMassTransferModelType(dict.lookup("type")); + const dictionary& modelDict = + interface.fluid().modelSubDict(dict); + + const word diffusiveMassTransferModelType(modelDict.lookup("type")); Info<< "Selecting diffusiveMassTransferModel for " - << pair << ": " << diffusiveMassTransferModelType << endl; + << interface.name() << ": " << diffusiveMassTransferModelType << endl; dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(diffusiveMassTransferModelType); @@ -53,7 +55,35 @@ Foam::diffusiveMassTransferModel::New << exit(FatalError); } - return cstrIter()(dict, pair); + return cstrIter()(modelDict, interface); +} + + +Foam::autoPtr +Foam::blendedDiffusiveMassTransferModel::New +( + const dictionary& dict, + const phaseInterface& interface +) +{ + return autoPtr + ( + new blendedDiffusiveMassTransferModel(dict, interface) + ); +} + + +Foam::autoPtr +Foam::sidedBlendedDiffusiveMassTransferModel::New +( + const dictionary& dict, + const phaseInterface& interface +) +{ + return autoPtr + ( + new sidedBlendedDiffusiveMassTransferModel(dict, interface) + ); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/diffusiveMassTransferModels/sphericalDiffusiveMassTransfer/sphericalDiffusiveMassTransfer.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/diffusiveMassTransferModels/sphericalDiffusiveMassTransfer/sphericalDiffusiveMassTransfer.C index 4061aba871..3576ae2f10 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/diffusiveMassTransferModels/sphericalDiffusiveMassTransfer/sphericalDiffusiveMassTransfer.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/diffusiveMassTransferModels/sphericalDiffusiveMassTransfer/sphericalDiffusiveMassTransfer.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "sphericalDiffusiveMassTransfer.H" -#include "phasePair.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -50,10 +49,18 @@ Foam::diffusiveMassTransferModels::sphericalDiffusiveMassTransfer:: sphericalDiffusiveMassTransfer ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) : - diffusiveMassTransferModel(dict, pair), + diffusiveMassTransferModel(dict, interface), + interface_ + ( + interface.modelCast + < + diffusiveMassTransferModel, + dispersedPhaseInterface + >() + ), Le_("Le", dimless, dict) {} @@ -70,7 +77,7 @@ Foam::diffusiveMassTransferModels::sphericalDiffusiveMassTransfer:: Foam::tmp Foam::diffusiveMassTransferModels::sphericalDiffusiveMassTransfer::K() const { - return 60*pair_.dispersed()/sqr(pair_.dispersed().d()); + return 60*interface_.dispersed()/sqr(interface_.dispersed().d()); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/diffusiveMassTransferModels/sphericalDiffusiveMassTransfer/sphericalDiffusiveMassTransfer.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/diffusiveMassTransferModels/sphericalDiffusiveMassTransfer/sphericalDiffusiveMassTransfer.H index 9e43415102..c5ab8f9b84 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/diffusiveMassTransferModels/sphericalDiffusiveMassTransfer/sphericalDiffusiveMassTransfer.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/diffusiveMassTransferModels/sphericalDiffusiveMassTransfer/sphericalDiffusiveMassTransfer.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -42,9 +42,6 @@ SourceFiles namespace Foam { - -class phasePair; - namespace diffusiveMassTransferModels { @@ -58,6 +55,9 @@ class sphericalDiffusiveMassTransfer { // Private Data + //- Interface + const dispersedPhaseInterface interface_; + //- Lewis number const dimensionedScalar Le_; @@ -70,11 +70,11 @@ public: // Constructors - //- Construct from components + //- Construct from a dictionary and an interface sphericalDiffusiveMassTransfer ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Henry/Henry.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Henry/Henry.C index 27330fa66e..7b3ebb3c33 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Henry/Henry.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Henry/Henry.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "Henry.H" -#include "phasePair.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -44,20 +43,20 @@ namespace interfaceCompositionModels Foam::interfaceCompositionModels::Henry::Henry ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) : - interfaceCompositionModel(dict, pair), + interfaceCompositionModel(dict, interface), k_(dict.lookup("k")), YSolvent_ ( IOobject ( - IOobject::groupName("YSolvent", pair.name()), - pair.phase1().mesh().time().timeName(), - pair.phase1().mesh() + IOobject::groupName("YSolvent", this->interface().name()), + interface.mesh().time().timeName(), + interface.mesh() ), - pair.phase1().mesh(), + interface.mesh(), dimensionedScalar(dimless, 1) ) { @@ -120,8 +119,8 @@ Foam::tmp Foam::interfaceCompositionModels::Henry::YfPrime { return volScalarField::New ( - IOobject::groupName("YfPrime", pair().name()), - pair().phase1().mesh(), + IOobject::groupName("YfPrime", interface().name()), + interface().mesh(), dimensionedScalar(dimless/dimTemperature, 0) ); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Henry/Henry.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Henry/Henry.H index 58a1bd7853..d610f2bd86 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Henry/Henry.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Henry/Henry.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -46,9 +46,6 @@ SourceFiles namespace Foam { - -class phasePair; - namespace interfaceCompositionModels { @@ -74,13 +71,14 @@ public: //- Runtime type information TypeName("Henry"); + // Constructors - //- Construct from components + //- Construct from a dictionary and an interface Henry ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Raoult/Raoult.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Raoult/Raoult.C index 15792ee0d8..e5abf194cf 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Raoult/Raoult.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Raoult/Raoult.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "Raoult.H" -#include "phasePair.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -44,30 +43,30 @@ namespace interfaceCompositionModels Foam::interfaceCompositionModels::Raoult::Raoult ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) : - interfaceCompositionModel(dict, pair), + interfaceCompositionModel(dict, interface), YNonVapour_ ( IOobject ( - IOobject::groupName("YNonVapour", pair.name()), - pair.phase1().mesh().time().timeName(), - pair.phase1().mesh() + IOobject::groupName("YNonVapour", this->interface().name()), + interface.mesh().time().timeName(), + interface.mesh() ), - pair.phase1().mesh(), + interface.mesh(), dimensionedScalar(dimless, 1) ), YNonVapourPrime_ ( IOobject ( - IOobject::groupName("YNonVapourPrime", pair.name()), - pair.phase1().mesh().time().timeName(), - pair.phase1().mesh() + IOobject::groupName("YNonVapourPrime", this->interface().name()), + interface.mesh().time().timeName(), + interface.mesh() ), - pair.phase1().mesh(), + interface.mesh(), dimensionedScalar(dimless/dimTemperature, 0) ) { @@ -81,7 +80,7 @@ Foam::interfaceCompositionModels::Raoult::Raoult interfaceCompositionModel::New ( dict.subDict(*iter), - pair + interface ) ) ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Raoult/Raoult.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Raoult/Raoult.H index 5aee4f15ad..d9feb8d5e8 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Raoult/Raoult.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Raoult/Raoult.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,9 +43,6 @@ SourceFiles namespace Foam { - -class phasePair; - namespace interfaceCompositionModels { @@ -74,13 +71,14 @@ public: //- Runtime type information TypeName("Raoult"); + // Constructors - //- Construct from components + //- Construct from a dictionary and an interface Raoult ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/interfaceCompositionModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/interfaceCompositionModel.C index 9927869238..175f4b2154 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/interfaceCompositionModel.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/interfaceCompositionModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,7 +25,6 @@ License #include "interfaceCompositionModel.H" #include "phaseModel.H" -#include "phasePair.H" #include "phaseSystem.H" #include "rhoReactionThermo.H" @@ -34,6 +33,7 @@ License namespace Foam { defineTypeNameAndDebug(interfaceCompositionModel, 0); + defineSidedInterfacialModelTypeNameAndDebug(interfaceCompositionModel, 0); defineRunTimeSelectionTable(interfaceCompositionModel, dictionary); } @@ -43,41 +43,17 @@ namespace Foam Foam::interfaceCompositionModel::interfaceCompositionModel ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) : - pair_(pair), + interface_ + ( + interface.modelCast() + ), species_(dict.lookup("species")), Le_("Le", dimless, dict), - phase_ - ( - // !!! This is a hack, to let the models know which side of the - // interface it applies to. In general, we are going to need improve - // the phase-pair system to take into account model sidedness and other - // types of asymmetry from just dispersed/continuous. - pair.phase1().name() == IOobject::group(dict.dictName()) - ? pair.phase1() - : pair.phase2() - ), - otherPhase_(pair.otherPhase(phase_)), - thermo_ - ( - phase_.mesh().lookupObject - ( - IOobject::groupName(physicalProperties::typeName, phase_.name()) - ) - ), - otherThermo_ - ( - otherPhase_.mesh().lookupObject - ( - IOobject::groupName - ( - physicalProperties::typeName, - otherPhase_.name() - ) - ) - ) + thermo_(refCast(interface_.phase().thermo())), + otherThermo_(interface_.otherPhase().thermo()) {} @@ -122,7 +98,7 @@ Foam::tmp Foam::interfaceCompositionModel::D return volScalarField::New ( - IOobject::groupName("D", pair_.name()), + IOobject::groupName("D" + speciesName, interface_.name()), composition().kappa(speciei, p, T) /composition().Cp(speciei, p, T) /composition().rho(speciei, p, T) diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/interfaceCompositionModel.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/interfaceCompositionModel.H index 071d91ed02..bea7dd412e 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/interfaceCompositionModel.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/interfaceCompositionModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -44,13 +44,12 @@ SourceFiles #include "hashedWordList.H" #include "rhoReactionThermo.H" #include "runTimeSelectionTables.H" +#include "sidedPhaseInterface.H" +#include "SidedInterfacialModel.H" namespace Foam { -class phaseModel; -class phasePair; - /*---------------------------------------------------------------------------*\ Class interfaceCompositionModel Declaration \*---------------------------------------------------------------------------*/ @@ -59,8 +58,8 @@ class interfaceCompositionModel { // Private data - //- Phase pair - const phasePair& pair_; + //- Interface + const sidedPhaseInterface interface_; //- Names of the transferring species const hashedWordList species_; @@ -68,12 +67,6 @@ class interfaceCompositionModel //- Lewis number const dimensionedScalar Le_; - //- Phase - const phaseModel& phase_; - - //- Other phase - const phaseModel& otherPhase_; - //- Multi-component thermo model for this side of the interface const rhoReactionThermo& thermo_; @@ -96,19 +89,19 @@ public: dictionary, ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ), - (dict, pair) + (dict, interface) ); // Constructors - //- Construct from a dictionary and a phase pair + //- Construct from a dictionary and an interface interfaceCompositionModel ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ); @@ -121,7 +114,8 @@ public: static autoPtr New ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface, + const bool outer=true ); @@ -129,8 +123,8 @@ public: // Access - //- Return the phase pair - inline const phasePair& pair() const; + //- Return the interface + inline const sidedPhaseInterface& interface() const; //- Return the transferring species names inline const hashedWordList& species() const; @@ -194,6 +188,34 @@ public: }; +/*---------------------------------------------------------------------------*\ + Class sidedInterfaceCompositionModel Declaration +\*---------------------------------------------------------------------------*/ + +class sidedInterfaceCompositionModel +: + public SidedInterfacialModel +{ +public: + + // Constructors + + //- Inherit base class constructors + using + SidedInterfacialModel:: + SidedInterfacialModel; + + + // Selectors + + static autoPtr New + ( + const dictionary& dict, + const phaseInterface& interface + ); +}; + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/interfaceCompositionModelI.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/interfaceCompositionModelI.H index 40ba27944d..c5a9e7902f 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/interfaceCompositionModelI.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/interfaceCompositionModelI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2019-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,11 +23,14 @@ License \*---------------------------------------------------------------------------*/ +#include "interfaceCompositionModel.H" + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -const Foam::phasePair& Foam::interfaceCompositionModel::pair() const +const Foam::sidedPhaseInterface& +Foam::interfaceCompositionModel::interface() const { - return pair_; + return interface_; } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/interfaceCompositionModelNew.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/interfaceCompositionModelNew.C index 50d79cd82a..9ded750a4e 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/interfaceCompositionModelNew.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/interfaceCompositionModels/interfaceCompositionModel/interfaceCompositionModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,8 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "interfaceCompositionModel.H" -#include "phasePair.H" -#include "rhoThermo.H" +#include "phaseSystem.H" // * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * // @@ -33,13 +32,19 @@ Foam::autoPtr Foam::interfaceCompositionModel::New ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface, + const bool outer ) { - const word interfaceCompositionModelType = word(dict.lookup("type")); + const dictionary& modelDict = + outer + ? interface.fluid().modelSubDict(dict) + : dict; + + const word interfaceCompositionModelType(modelDict.lookup("type")); Info<< "Selecting interfaceCompositionModel for " - << pair << ": " << interfaceCompositionModelType << endl; + << interface.name() << ": " << interfaceCompositionModelType << endl; dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(interfaceCompositionModelType); @@ -54,7 +59,21 @@ Foam::interfaceCompositionModel::New << exit(FatalError); } - return cstrIter()(dict, pair); + return cstrIter()(modelDict, interface); +} + + +Foam::autoPtr +Foam::sidedInterfaceCompositionModel::New +( + const dictionary& dict, + const phaseInterface& interface +) +{ + return autoPtr + ( + new sidedInterfaceCompositionModel(dict, interface) + ); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/interfaceCompositionModels/nonRandomTwoLiquid/nonRandomTwoLiquid.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/interfaceCompositionModels/nonRandomTwoLiquid/nonRandomTwoLiquid.C index 750c6520ed..cfcf4b17e5 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/interfaceCompositionModels/nonRandomTwoLiquid/nonRandomTwoLiquid.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/interfaceCompositionModels/nonRandomTwoLiquid/nonRandomTwoLiquid.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "nonRandomTwoLiquid.H" -#include "phasePair.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -49,30 +48,30 @@ namespace interfaceCompositionModels Foam::interfaceCompositionModels::nonRandomTwoLiquid::nonRandomTwoLiquid ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) : - interfaceCompositionModel(dict, pair), + interfaceCompositionModel(dict, interface), gamma1_ ( IOobject ( - IOobject::groupName("gamma1", pair.name()), - pair.phase1().mesh().time().timeName(), - pair.phase1().mesh() + IOobject::groupName("gamma1", this->interface().name()), + interface.mesh().time().timeName(), + interface.mesh() ), - pair.phase1().mesh(), + interface.mesh(), dimensionedScalar(dimless, 1) ), gamma2_ ( IOobject ( - IOobject::groupName("gamma2", pair.name()), - pair.phase1().mesh().time().timeName(), - pair.phase1().mesh() + IOobject::groupName("gamma2", this->interface().name()), + interface.mesh().time().timeName(), + interface.mesh() ), - pair.phase1().mesh(), + interface.mesh(), dimensionedScalar(dimless, 1) ), beta12_("", dimless/dimTemperature, 0), @@ -122,7 +121,8 @@ Foam::interfaceCompositionModels::nonRandomTwoLiquid::nonRandomTwoLiquid saturationModel::New ( dict.subDict(species1Name_).subDict("interaction"), - pair + interface, + false ).ptr() ); saturationModel21_.reset @@ -130,7 +130,8 @@ Foam::interfaceCompositionModels::nonRandomTwoLiquid::nonRandomTwoLiquid saturationModel::New ( dict.subDict(species2Name_).subDict("interaction"), - pair + interface, + false ).ptr() ); @@ -139,7 +140,8 @@ Foam::interfaceCompositionModels::nonRandomTwoLiquid::nonRandomTwoLiquid interfaceCompositionModel::New ( dict.subDict(species1Name_), - pair + interface, + false ).ptr() ); speciesModel2_.reset @@ -147,7 +149,8 @@ Foam::interfaceCompositionModels::nonRandomTwoLiquid::nonRandomTwoLiquid interfaceCompositionModel::New ( dict.subDict(species2Name_), - pair + interface, + false ).ptr() ); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/interfaceCompositionModels/nonRandomTwoLiquid/nonRandomTwoLiquid.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/interfaceCompositionModels/nonRandomTwoLiquid/nonRandomTwoLiquid.H index 13d8b3cf8c..e65dfaa3ea 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/interfaceCompositionModels/nonRandomTwoLiquid/nonRandomTwoLiquid.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/interfaceCompositionModels/nonRandomTwoLiquid/nonRandomTwoLiquid.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -47,9 +47,6 @@ SourceFiles namespace Foam { - -class phasePair; - namespace interfaceCompositionModels { @@ -111,13 +108,14 @@ public: //- Runtime type information TypeName("nonRandomTwoLiquid"); + // Constructors - //- Construct from components + //- Construct from a dictionary and an interface nonRandomTwoLiquid ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/interfaceCompositionModels/saturated/saturated.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/interfaceCompositionModels/saturated/saturated.C index 5a9c37de60..c0423cb0bb 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/interfaceCompositionModels/saturated/saturated.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/interfaceCompositionModels/saturated/saturated.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "saturated.H" -#include "phasePair.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -65,10 +64,10 @@ Foam::interfaceCompositionModels::saturated::wRatioByP() const Foam::interfaceCompositionModels::saturated::saturated ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) : - interfaceCompositionModel(dict, pair), + interfaceCompositionModel(dict, interface), saturatedName_(species()[0]), saturatedIndex_(composition().species()[saturatedName_]), saturationModel_ @@ -76,7 +75,8 @@ Foam::interfaceCompositionModels::saturated::saturated saturationModel::New ( dict.subDict("saturationPressure"), - pair + interface, + false ) ) { diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/interfaceCompositionModels/saturated/saturated.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/interfaceCompositionModels/saturated/saturated.H index 8a4c999d12..431cbee58b 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/interfaceCompositionModels/saturated/saturated.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/interfaceCompositionModels/saturated/saturated.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,9 +43,6 @@ SourceFiles namespace Foam { - -class phasePair; - namespace interfaceCompositionModels { @@ -83,13 +80,14 @@ public: //- Runtime type information TypeName("saturated"); + // Constructors - //- Construct from components + //- Construct from a dictionary and an interface saturated ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/Antoine/Antoine.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/Antoine/Antoine.C index a5a525dcc0..8862c41b62 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/Antoine/Antoine.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/Antoine/Antoine.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,10 +43,10 @@ namespace saturationModels Foam::saturationModels::Antoine::Antoine ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) : - saturationModel(pair), + saturationModel(dict, interface), A_("A", dimless, dict), B_("B", dimTemperature, dict), C_("C", dimTemperature, dict) diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/Antoine/Antoine.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/Antoine/Antoine.H index c25fdf165f..89e33c7953 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/Antoine/Antoine.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/Antoine/Antoine.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -78,10 +78,15 @@ public: //- Runtime type information TypeName("Antoine"); + // Constructors - //- Construct from a dictionary - Antoine(const dictionary& dict, const phasePair& pair); + //- Construct from a dictionary and an interface + Antoine + ( + const dictionary& dict, + const phaseInterface& interface + ); //- Destructor diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/AntoineExtended/AntoineExtended.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/AntoineExtended/AntoineExtended.C index aa82d2a46c..aeef821600 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/AntoineExtended/AntoineExtended.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/AntoineExtended/AntoineExtended.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -48,10 +48,10 @@ namespace saturationModels Foam::saturationModels::AntoineExtended::AntoineExtended ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) : - Antoine(dict, pair), + Antoine(dict, interface), D_("D", dimless, dict), F_("F", dimless, dict), E_("E", dimless/pow(dimTemperature, F_), dict) diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/AntoineExtended/AntoineExtended.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/AntoineExtended/AntoineExtended.H index d1e9f4e007..f5f3eb1616 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/AntoineExtended/AntoineExtended.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/AntoineExtended/AntoineExtended.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -78,10 +78,15 @@ public: //- Runtime type information TypeName("AntoineExtended"); + // Constructors - //- Construct from a dictionary - AntoineExtended(const dictionary& dict, const phasePair& pair); + //- Construct from a dictionary and an interface + AntoineExtended + ( + const dictionary& dict, + const phaseInterface& interface + ); //- Destructor diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/ArdenBuck/ArdenBuck.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/ArdenBuck/ArdenBuck.C index cffdb693c3..c7a8f9a10e 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/ArdenBuck/ArdenBuck.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/ArdenBuck/ArdenBuck.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -37,12 +37,14 @@ namespace saturationModels } } + static const Foam::dimensionedScalar zeroC("", Foam::dimTemperature, 273.15); static const Foam::dimensionedScalar A("", Foam::dimPressure, 611.21); static const Foam::dimensionedScalar B("", Foam::dimless, 18.678); static const Foam::dimensionedScalar C("", Foam::dimTemperature, 234.5); static const Foam::dimensionedScalar D("", Foam::dimTemperature, 257.14); + // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // Foam::tmp @@ -60,10 +62,10 @@ Foam::saturationModels::ArdenBuck::xByTC Foam::saturationModels::ArdenBuck::ArdenBuck ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) : - saturationModel(pair) + saturationModel(dict, interface) {} diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/ArdenBuck/ArdenBuck.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/ArdenBuck/ArdenBuck.H index 9c164dbc0b..4b8b374263 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/ArdenBuck/ArdenBuck.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/ArdenBuck/ArdenBuck.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -63,10 +63,15 @@ public: //- Runtime type information TypeName("ArdenBuck"); + // Constructors - //- Construct from a dictionary - ArdenBuck(const dictionary& dict, const phasePair& pair); + //- Construct from a dictionary and an interface + ArdenBuck + ( + const dictionary& dict, + const phaseInterface& interface + ); //- Destructor diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/constantSaturationConditions/constantSaturationConditions.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/constantSaturationConditions/constantSaturationConditions.C index db14f52e93..3d8f4467a8 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/constantSaturationConditions/constantSaturationConditions.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/constantSaturationConditions/constantSaturationConditions.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -49,10 +49,10 @@ Foam::saturationModels::constantSaturationConditions:: constantSaturationConditions ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) : - saturationModel(pair), + saturationModel(dict, interface), pSat_("pSat", dimPressure, dict), Tsat_("Tsat", dimTemperature, dict) {} diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/constantSaturationConditions/constantSaturationConditions.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/constantSaturationConditions/constantSaturationConditions.H index 6000c12694..1f761e4307 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/constantSaturationConditions/constantSaturationConditions.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/constantSaturationConditions/constantSaturationConditions.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -68,13 +68,14 @@ public: //- Runtime type information TypeName("constant"); + // Constructors - //- Construct from a dictionary + //- Construct from a dictionary and an interface constantSaturationConditions ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/function1/function1.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/function1/function1.C index c03b57c9f2..6f54b40006 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/function1/function1.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/function1/function1.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2017-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2017-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,14 +43,11 @@ namespace saturationModels Foam::saturationModels::function1::function1 ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) : - saturationModel(pair), - function_ - ( - Function1::New("function", dict) - ) + saturationModel(dict, interface), + function_(Function1::New("function", dict)) {} diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/function1/function1.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/function1/function1.H index 0fa2e73657..11a51dd5fd 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/function1/function1.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/function1/function1.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2017-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2017-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -104,10 +104,15 @@ public: //- Runtime type information TypeName("function1"); + // Constructors - //- Construct from a dictionary - function1(const dictionary& dict, const phasePair& pair); + //- Construct from a dictionary and an interface + function1 + ( + const dictionary& dict, + const phaseInterface& interface + ); //- Destructor diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/polynomial/polynomial.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/polynomial/polynomial.C index 718812b596..e735e7f12f 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/polynomial/polynomial.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/polynomial/polynomial.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,10 +43,10 @@ namespace saturationModels Foam::saturationModels::polynomial::polynomial ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) : - saturationModel(pair), + saturationModel(dict, interface), C_(dict.lookup("C<8>")) {} diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/polynomial/polynomial.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/polynomial/polynomial.H index c2c01bf9f5..d7204109a3 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/polynomial/polynomial.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/polynomial/polynomial.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -74,10 +74,15 @@ public: //- Runtime type information TypeName("polynomial"); + // Constructors - //- Construct from a dictionary - polynomial(const dictionary& dict, const phasePair& pair); + //- Construct from a dictionary and an interface + polynomial + ( + const dictionary& dict, + const phaseInterface& interface + ); //- Destructor diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/saturationModel/saturationModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/saturationModel/saturationModel.C index 2d729a1f79..d0d8a80761 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/saturationModel/saturationModel.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/saturationModel/saturationModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -36,17 +36,22 @@ namespace Foam // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::saturationModel::saturationModel(const phasePair& pair) +Foam::saturationModel::saturationModel +( + const dictionary& dict, + const phaseInterface& interface +) : - IOdictionary + regIOobject ( IOobject ( - IOobject::groupName("saturationModel", pair.name()), - pair.phase1().time().constant(), - pair.phase1().mesh() + IOobject::groupName("saturationModel", interface.name()), + interface.mesh().time().constant(), + interface.mesh() ) - ) + ), + interface_(interface) {} @@ -56,4 +61,18 @@ Foam::saturationModel::~saturationModel() {} +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +const Foam::phaseInterface& Foam::saturationModel::interface() const +{ + return interface_; +} + + +bool Foam::saturationModel::writeData(Ostream& os) const +{ + return os.good(); +} + + // ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/saturationModel/saturationModel.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/saturationModel/saturationModel.H index 039ab85f86..ed98fe0f2f 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/saturationModel/saturationModel.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/saturationModel/saturationModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,6 +25,8 @@ Class Foam::saturationModel Description + Model to describe the dependence of saturation pressure on temperature, and + vice versa SourceFiles saturationModel.C @@ -35,11 +37,10 @@ SourceFiles #ifndef saturationModel_H #define saturationModel_H -#include "IOdictionary.H" #include "volFields.H" #include "dictionary.H" +#include "phaseInterface.H" #include "runTimeSelectionTables.H" -#include "phasePair.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -52,8 +53,14 @@ namespace Foam class saturationModel : - public IOdictionary + public regIOobject { + // Private Data + + //- The interface + const phaseInterface interface_; + + public: //- Runtime type information @@ -67,28 +74,30 @@ public: saturationModel, dictionary, ( - const dictionary& dict, const phasePair& pair + const dictionary& dict, + const phaseInterface& interface ), - (dict, pair) + (dict, interface) ); // Constructors - //- Construct null - saturationModel(const phasePair& pair); - - //- Disallow default bitwise copy construction - saturationModel(const saturationModel&) = delete; + //- Construct from a dictionary and an interface + saturationModel + ( + const dictionary& dict, + const phaseInterface& interface + ); // Selectors - //- Select null constructed static autoPtr New ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface, + const bool outer=true ); @@ -98,6 +107,9 @@ public: // Member Functions + //- Access the interface + const phaseInterface& interface() const; + //- Saturation pressure virtual tmp pSat ( @@ -122,11 +134,8 @@ public: const volScalarField& p ) const = 0; - - // Member Operators - - //- Disallow default bitwise assignment - void operator=(const saturationModel&) = delete; + //- Dummy write for regIOobject + bool writeData(Ostream& os) const; }; diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/saturationModel/saturationModelNew.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/saturationModel/saturationModelNew.C index dee20ebf27..4b2bcfbc4a 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/saturationModel/saturationModelNew.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/saturationModel/saturationModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,19 +24,24 @@ License \*---------------------------------------------------------------------------*/ #include "saturationModel.H" +#include "phaseSystem.H" // * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * // Foam::autoPtr Foam::saturationModel::New ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface, + const bool outer ) { - word saturationModelType(dict.lookup("type")); + const dictionary& modelDict = + outer ? interface.fluid().modelSubDict(dict) : dict; - Info<< "Selecting saturationModel: " - << saturationModelType << endl; + const word saturationModelType(modelDict.lookup("type")); + + Info<< "Selecting saturationModel for " + << interface.name() << ": " << saturationModelType << endl; dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(saturationModelType); @@ -51,7 +56,7 @@ Foam::autoPtr Foam::saturationModel::New << exit(FatalError); } - return cstrIter()(dict, pair); + return cstrIter()(modelDict, interface); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/surfaceTensionModels/constantSurfaceTensionCoefficient/constantSurfaceTensionCoefficient.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/surfaceTensionModels/constantSurfaceTensionCoefficient/constantSurfaceTensionCoefficient.C index e3c1cadc22..709e8d10ba 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/surfaceTensionModels/constantSurfaceTensionCoefficient/constantSurfaceTensionCoefficient.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/surfaceTensionModels/constantSurfaceTensionCoefficient/constantSurfaceTensionCoefficient.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "constantSurfaceTensionCoefficient.H" -#include "phasePair.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -50,11 +49,10 @@ Foam::surfaceTensionModels::constantSurfaceTensionCoefficient:: constantSurfaceTensionCoefficient ( const dictionary& dict, - const phasePair& pair, - const bool registerObject + const phaseInterface& interface ) : - surfaceTensionModel(dict, pair, registerObject), + surfaceTensionModel(dict, interface), sigma_("sigma", dimSigma, dict) {} @@ -71,27 +69,28 @@ Foam::surfaceTensionModels::constantSurfaceTensionCoefficient:: Foam::tmp Foam::surfaceTensionModels::constantSurfaceTensionCoefficient::sigma() const { - const fvMesh& mesh(this->pair_.phase1().mesh()); - return volScalarField::New ( "sigma", - mesh, + interface_.mesh(), sigma_ ); } + Foam::tmp Foam::surfaceTensionModels::constantSurfaceTensionCoefficient::sigma ( - label patchi + const label patchi ) const { - const fvMesh& mesh(this->pair_.phase1().mesh()); - return tmp ( - new scalarField(mesh.boundary()[patchi].size(), sigma_.value()) + new scalarField + ( + interface_.mesh().boundary()[patchi].size(), + sigma_.value() + ) ); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/surfaceTensionModels/constantSurfaceTensionCoefficient/constantSurfaceTensionCoefficient.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/surfaceTensionModels/constantSurfaceTensionCoefficient/constantSurfaceTensionCoefficient.H index 04757ba0a8..bedb817e40 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/surfaceTensionModels/constantSurfaceTensionCoefficient/constantSurfaceTensionCoefficient.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/surfaceTensionModels/constantSurfaceTensionCoefficient/constantSurfaceTensionCoefficient.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -66,12 +66,11 @@ public: // Constructors - //- Construct from a dictionary and a phase pair + //- Construct from a dictionary and an interface constantSurfaceTensionCoefficient ( const dictionary& dict, - const phasePair& pair, - const bool registerObject + const phaseInterface& interface ); @@ -85,7 +84,7 @@ public: virtual tmp sigma() const; //- Surface tension for a patch - virtual tmp sigma(label patchi) const; + virtual tmp sigma(const label patchi) const; }; diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/surfaceTensionModels/surfaceTensionModel/surfaceTensionModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/surfaceTensionModels/surfaceTensionModel/surfaceTensionModel.C index 494b0582c3..9329b1e26a 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/surfaceTensionModels/surfaceTensionModel/surfaceTensionModel.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/surfaceTensionModels/surfaceTensionModel/surfaceTensionModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "surfaceTensionModel.H" -#include "phasePair.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -42,23 +41,10 @@ const Foam::dimensionSet Foam::surfaceTensionModel::dimSigma(1, 0, -2, 0, 0); Foam::surfaceTensionModel::surfaceTensionModel ( const dictionary& dict, - const phasePair& pair, - const bool registerObject + const phaseInterface& interface ) : - regIOobject - ( - IOobject - ( - IOobject::groupName(typeName, pair.name()), - pair.phase1().mesh().time().timeName(), - pair.phase1().mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE, - registerObject - ) - ), - pair_(pair) + interface_(interface) {} @@ -68,12 +54,4 @@ Foam::surfaceTensionModel::~surfaceTensionModel() {} -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -bool Foam::surfaceTensionModel::writeData(Ostream& os) const -{ - return os.good(); -} - - // ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/surfaceTensionModels/surfaceTensionModel/surfaceTensionModel.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/surfaceTensionModels/surfaceTensionModel/surfaceTensionModel.H index 5b28dc3904..f207625e4a 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/surfaceTensionModels/surfaceTensionModel/surfaceTensionModel.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/surfaceTensionModels/surfaceTensionModel/surfaceTensionModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -40,26 +40,23 @@ SourceFiles #include "volFields.H" #include "dictionary.H" #include "runTimeSelectionTables.H" +#include "phaseInterface.H" namespace Foam { -class phasePair; - /*---------------------------------------------------------------------------*\ Class surfaceTensionModel Declaration \*---------------------------------------------------------------------------*/ class surfaceTensionModel -: - public regIOobject { protected: // Protected data - //- Phase pair - const phasePair& pair_; + //- Interface + const phaseInterface interface_; public: @@ -76,10 +73,9 @@ public: dictionary, ( const dictionary& dict, - const phasePair& pair, - const bool registerObject + const phaseInterface& interface ), - (dict, pair, registerObject) + (dict, interface) ); @@ -91,12 +87,11 @@ public: // Constructors - //- Construct from a dictionary and a phase pair + //- Construct from a dictionary and an interface surfaceTensionModel ( const dictionary& dict, - const phasePair& pair, - const bool registerObject + const phaseInterface& interface ); @@ -109,7 +104,8 @@ public: static autoPtr New ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface, + const bool outer=true ); @@ -119,10 +115,7 @@ public: virtual tmp sigma() const = 0; //- Surface tension for a patch - virtual tmp sigma(label patchi) const = 0; - - //- Dummy write for regIOobject - bool writeData(Ostream& os) const; + virtual tmp sigma(const label patchi) const = 0; }; diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/surfaceTensionModels/surfaceTensionModel/surfaceTensionModelNew.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/surfaceTensionModels/surfaceTensionModel/surfaceTensionModelNew.C index bc33a3fe72..f4a1067d8f 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/surfaceTensionModels/surfaceTensionModel/surfaceTensionModelNew.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/surfaceTensionModels/surfaceTensionModel/surfaceTensionModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "surfaceTensionModel.H" -#include "phasePair.H" +#include "phaseSystem.H" // * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * // @@ -32,13 +32,19 @@ Foam::autoPtr Foam::surfaceTensionModel::New ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface, + const bool outer ) { - word surfaceTensionModelType(dict.lookup("type")); + const dictionary& modelDict = + outer + ? interface.fluid().modelSubDict(dict) + : dict; + + const word surfaceTensionModelType(modelDict.lookup("type")); Info<< "Selecting surfaceTensionModel for " - << pair << ": " << surfaceTensionModelType << endl; + << interface.name() << ": " << surfaceTensionModelType << endl; dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(surfaceTensionModelType); @@ -53,7 +59,7 @@ Foam::surfaceTensionModel::New << exit(FatalError); } - return cstrIter()(dict, pair, true); + return cstrIter()(modelDict, interface); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/Make/files b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/Make/files index 0f4a8754dd..2e50a8ecba 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/Make/files +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/Make/files @@ -1,5 +1,6 @@ dragModels/dragModel/dragModel.C dragModels/dragModel/dragModelNew.C +dragModels/dispersedDragModel/dispersedDragModel.C dragModels/Beetstra/Beetstra.C dragModels/segregated/segregated.C dragModels/Ergun/Ergun.C @@ -26,6 +27,7 @@ swarmCorrections/TomiyamaSwarm/TomiyamaSwarm.C liftModels/liftModel/liftModel.C liftModels/liftModel/liftModelNew.C +liftModels/dispersedLiftModel/dispersedLiftModel.C liftModels/noLift/noLift.C liftModels/constantLiftCoefficient/constantLiftCoefficient.C liftModels/Moraga/Moraga.C @@ -43,12 +45,14 @@ heatTransferModels/timeScaleFilteredHeatTransfer/timeScaleFilteredHeatTransfer.C virtualMassModels/virtualMassModel/virtualMassModel.C virtualMassModels/virtualMassModel/virtualMassModelNew.C +virtualMassModels/dispersedVirtualMassModel/dispersedVirtualMassModel.C virtualMassModels/noVirtualMass/noVirtualMass.C virtualMassModels/constantVirtualMassCoefficient/constantVirtualMassCoefficient.C virtualMassModels/Lamb/Lamb.C wallLubricationModels/wallLubricationModel/wallLubricationModel.C wallLubricationModels/wallLubricationModel/wallLubricationModelNew.C +wallLubricationModels/dispersedWallLubricationModel/dispersedWallLubricationModel.C wallLubricationModels/noWallLubrication/noWallLubrication.C wallLubricationModels/Antal/Antal.C wallLubricationModels/Frank/Frank.C @@ -56,6 +60,7 @@ wallLubricationModels/TomiyamaWallLubrication/TomiyamaWallLubrication.C turbulentDispersionModels/turbulentDispersionModel/turbulentDispersionModel.C turbulentDispersionModels/turbulentDispersionModel/turbulentDispersionModelNew.C +turbulentDispersionModels/dispersedTurbulentDispersionModel/dispersedTurbulentDispersionModel.C turbulentDispersionModels/noTurbulentDispersion/noTurbulentDispersion.C turbulentDispersionModels/constantTurbulentDispersionCoefficient/constantTurbulentDispersionCoefficient.C turbulentDispersionModels/Burns/Burns.C diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/aspectRatioModels/TomiyamaAspectRatio/TomiyamaAspectRatio.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/aspectRatioModels/TomiyamaAspectRatio/TomiyamaAspectRatio.C index 1937b4e81d..ee5aad4c0c 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/aspectRatioModels/TomiyamaAspectRatio/TomiyamaAspectRatio.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/aspectRatioModels/TomiyamaAspectRatio/TomiyamaAspectRatio.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "TomiyamaAspectRatio.H" -#include "phasePair.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -49,11 +48,11 @@ namespace aspectRatioModels Foam::aspectRatioModels::TomiyamaAspectRatio::TomiyamaAspectRatio ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) : - VakhrushevEfremov(dict, pair), - wallDependentModel(pair.phase1().mesh()) + VakhrushevEfremov(dict, interface), + wallDependentModel(interface_.mesh()) {} @@ -70,7 +69,7 @@ Foam::aspectRatioModels::TomiyamaAspectRatio::E() const { return VakhrushevEfremov::E() - *max(1 - 0.35*yWall()/pair_.dispersed().d(), scalar(0.65)); + *max(1 - 0.35*yWall()/interface_.dispersed().d(), scalar(0.65)); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/aspectRatioModels/TomiyamaAspectRatio/TomiyamaAspectRatio.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/aspectRatioModels/TomiyamaAspectRatio/TomiyamaAspectRatio.H index 27c29e0741..d2c53eb758 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/aspectRatioModels/TomiyamaAspectRatio/TomiyamaAspectRatio.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/aspectRatioModels/TomiyamaAspectRatio/TomiyamaAspectRatio.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -70,11 +70,11 @@ public: // Constructors - //- Construct from a dictionary and an ordered phase pair + //- Construct from a dictionary and an interface TomiyamaAspectRatio ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/aspectRatioModels/VakhrushevEfremov/VakhrushevEfremov.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/aspectRatioModels/VakhrushevEfremov/VakhrushevEfremov.C index 64e3d5469b..94e9f1f009 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/aspectRatioModels/VakhrushevEfremov/VakhrushevEfremov.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/aspectRatioModels/VakhrushevEfremov/VakhrushevEfremov.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "VakhrushevEfremov.H" -#include "phasePair.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -49,10 +48,10 @@ namespace aspectRatioModels Foam::aspectRatioModels::VakhrushevEfremov::VakhrushevEfremov ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) : - aspectRatioModel(dict, pair) + aspectRatioModel(dict, interface) {} @@ -67,7 +66,7 @@ Foam::aspectRatioModels::VakhrushevEfremov::~VakhrushevEfremov() Foam::tmp Foam::aspectRatioModels::VakhrushevEfremov::E() const { - const volScalarField Ta(pair_.Ta()); + const volScalarField Ta(interface_.Ta()); return neg(Ta - 1) diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/aspectRatioModels/VakhrushevEfremov/VakhrushevEfremov.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/aspectRatioModels/VakhrushevEfremov/VakhrushevEfremov.H index 80378c8a2b..6303d18c93 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/aspectRatioModels/VakhrushevEfremov/VakhrushevEfremov.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/aspectRatioModels/VakhrushevEfremov/VakhrushevEfremov.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -68,11 +68,11 @@ public: // Constructors - //- Construct from a dictionary and an ordered phase pair + //- Construct from a dictionary and an interface VakhrushevEfremov ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/aspectRatioModels/Wellek/Wellek.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/aspectRatioModels/Wellek/Wellek.C index bc9d9d8dce..45e6c5aa64 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/aspectRatioModels/Wellek/Wellek.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/aspectRatioModels/Wellek/Wellek.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "Wellek.H" -#include "phasePair.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -49,10 +48,10 @@ namespace aspectRatioModels Foam::aspectRatioModels::Wellek::Wellek ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) : - aspectRatioModel(dict, pair) + aspectRatioModel(dict, interface) {} @@ -67,7 +66,7 @@ Foam::aspectRatioModels::Wellek::~Wellek() Foam::tmp Foam::aspectRatioModels::Wellek::E() const { - return scalar(1)/(1 + 0.163*pow(pair_.Eo(), 0.757)); + return scalar(1)/(1 + 0.163*pow(interface_.Eo(), 0.757)); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/aspectRatioModels/Wellek/Wellek.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/aspectRatioModels/Wellek/Wellek.H index cf6c0fc641..5cbe7991f4 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/aspectRatioModels/Wellek/Wellek.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/aspectRatioModels/Wellek/Wellek.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -74,11 +74,11 @@ public: // Constructors - //- Construct from a dictionary and an ordered phase pair + //- Construct from a dictionary and an interface Wellek ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/aspectRatioModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/aspectRatioModel.C index 7c14b838d5..5c26399e0f 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/aspectRatioModel.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/aspectRatioModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "aspectRatioModel.H" -#include "phasePair.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -40,10 +39,10 @@ namespace Foam Foam::aspectRatioModel::aspectRatioModel ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) : - pair_(pair) + interface_(interface.modelCast()) {} diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/aspectRatioModel.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/aspectRatioModel.H index 765eb56b59..1bca597fd9 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/aspectRatioModel.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/aspectRatioModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,6 +25,9 @@ Class Foam::aspectRatioModel Description + Model for deviations in the shape of the dispersed phase from spherical. + Just a sub-model modifier, typically for the drag model. Not a proper part + of the diameter/shape modelling in the phase models. SourceFiles aspectRatioModel.C @@ -40,12 +43,11 @@ SourceFiles #include "volFields.H" #include "dictionary.H" #include "runTimeSelectionTables.H" +#include "dispersedPhaseInterface.H" namespace Foam { -class phasePair; - /*---------------------------------------------------------------------------*\ Class aspectRatioModel Declaration \*---------------------------------------------------------------------------*/ @@ -56,8 +58,8 @@ protected: // Protected data - //- Phase pair - const phasePair& pair_; + //- Interface + const dispersedPhaseInterface interface_; public: @@ -74,19 +76,19 @@ public: dictionary, ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ), - (dict, pair) + (dict, interface) ); // Constructors - //- Construct from a dictionary and an ordered phase pair + //- Construct from a dictionary and an interface aspectRatioModel ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ); @@ -99,7 +101,7 @@ public: static autoPtr New ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/aspectRatioModelNew.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/aspectRatioModelNew.C index 19239d8b0b..b807727abc 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/aspectRatioModelNew.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/aspectRatioModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "aspectRatioModel.H" -#include "phasePair.H" +#include "phaseSystem.H" // * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * // @@ -32,13 +32,13 @@ Foam::autoPtr Foam::aspectRatioModel::New ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) { - word aspectRatioModelType(dict.lookup("type")); + const word aspectRatioModelType(dict.lookup("type")); Info<< "Selecting aspectRatioModel for " - << pair << ": " << aspectRatioModelType << endl; + << interface.name() << ": " << aspectRatioModelType << endl; dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(aspectRatioModelType); @@ -53,7 +53,7 @@ Foam::aspectRatioModel::New << exit(FatalError); } - return cstrIter()(dict, pair); + return cstrIter()(dict, interface); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/aspectRatioModels/constantAspectRatio/constantAspectRatio.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/aspectRatioModels/constantAspectRatio/constantAspectRatio.C index 307bb45463..67ec10cf91 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/aspectRatioModels/constantAspectRatio/constantAspectRatio.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/aspectRatioModels/constantAspectRatio/constantAspectRatio.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "constantAspectRatio.H" -#include "phasePair.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -49,10 +48,10 @@ namespace aspectRatioModels Foam::aspectRatioModels::constantAspectRatio::constantAspectRatio ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) : - aspectRatioModel(dict, pair), + aspectRatioModel(dict, interface), E0_("E0", dimless, dict) {} @@ -68,12 +67,10 @@ Foam::aspectRatioModels::constantAspectRatio::~constantAspectRatio() Foam::tmp Foam::aspectRatioModels::constantAspectRatio::E() const { - const fvMesh& mesh(this->pair_.phase1().mesh()); - return volScalarField::New ( aspectRatioModel::typeName + ":E", - mesh, + interface_.mesh(), E0_ ); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/aspectRatioModels/constantAspectRatio/constantAspectRatio.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/aspectRatioModels/constantAspectRatio/constantAspectRatio.H index b3629f30ce..86131e1c2a 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/aspectRatioModels/constantAspectRatio/constantAspectRatio.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/aspectRatioModels/constantAspectRatio/constantAspectRatio.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -66,11 +66,11 @@ public: // Constructors - //- Construct from a dictionary and an ordered phase pair + //- Construct from a dictionary and an interface constantAspectRatio ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/AttouFerschneider/AttouFerschneider.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/AttouFerschneider/AttouFerschneider.C index baba4c9043..9b0d013e0b 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/AttouFerschneider/AttouFerschneider.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/AttouFerschneider/AttouFerschneider.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2018-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2018-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "AttouFerschneider.H" -#include "phasePair.H" #include "phaseSystem.H" #include "addToRunTimeSelectionTable.H" @@ -107,11 +106,12 @@ Foam::dragModels::AttouFerschneider::KLiquidSolid Foam::dragModels::AttouFerschneider::AttouFerschneider ( const dictionary& dict, - const phasePair& pair, + const phaseInterface& interface, const bool registerObject ) : - dragModel(dict, pair, registerObject), + dragModel(dict, interface, registerObject), + interface_(interface), gasName_(dict.lookup("gas")), liquidName_(dict.lookup("liquid")), solidName_(dict.lookup("solid")), @@ -128,48 +128,29 @@ Foam::dragModels::AttouFerschneider::~AttouFerschneider() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -Foam::tmp -Foam::dragModels::AttouFerschneider::CdRe() const -{ - FatalErrorInFunction - << "Not implemented." - << "Drag coefficient is not defined for the AttouFerschneider model." - << exit(FatalError); - - return tmp(nullptr); -} - - Foam::tmp Foam::dragModels::AttouFerschneider::K() const { - switch (Pair::compare(pair_, phasePairKey(gasName_, liquidName_))) - { - case 1: - return KGasLiquid(pair_.phase1(), pair_.phase2()); - case -1: - return KGasLiquid(pair_.phase2(), pair_.phase1()); - } + const phaseModel& gas = interface_.fluid().phases()[gasName_]; + const phaseModel& liquid = interface_.fluid().phases()[liquidName_]; + const phaseModel& solid = interface_.fluid().phases()[solidName_]; - switch (Pair::compare(pair_, phasePairKey(gasName_, solidName_))) + if (interface_.contains(gas) && interface_.contains(liquid)) { - case 1: - return KGasSolid(pair_.phase1(), pair_.phase2()); - case -1: - return KGasSolid(pair_.phase2(), pair_.phase1()); + return KGasLiquid(gas, liquid); } - - switch (Pair::compare(pair_, phasePairKey(liquidName_, solidName_))) + if (interface_.contains(gas) && interface_.contains(solid)) { - case 1: - return KLiquidSolid(pair_.phase1(), pair_.phase2()); - case -1: - return KLiquidSolid(pair_.phase2(), pair_.phase1()); + return KGasSolid(gas, solid); + } + if (interface_.contains(liquid) && interface_.contains(solid)) + { + return KLiquidSolid(liquid, solid); } FatalErrorInFunction - << "The pair does not contain two of out of the gas, liquid and solid " - << "phase models." + << "The interface " << interface_.name() << " does not contain two " + << "out of the gas, liquid and solid phase models." << exit(FatalError); return tmp(nullptr); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/AttouFerschneider/AttouFerschneider.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/AttouFerschneider/AttouFerschneider.H index d66d817f9d..d94af2396a 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/AttouFerschneider/AttouFerschneider.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/AttouFerschneider/AttouFerschneider.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2018-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2018-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -51,9 +51,6 @@ SourceFiles namespace Foam { - -class phaseModel; - namespace dragModels { @@ -67,6 +64,9 @@ class AttouFerschneider { // Private Data + //- Interface + const phaseInterface interface_; + //- Name of the gaseous phase const word gasName_; @@ -115,11 +115,11 @@ public: // Constructors - //- Construct from a dictionary and a phase pair + //- Construct from a dictionary and an interface AttouFerschneider ( const dictionary& dict, - const phasePair& pair, + const phaseInterface& interface, const bool registerObject ); @@ -130,9 +130,6 @@ public: // Member Functions - //- Drag coefficient - virtual tmp CdRe() const; - //- The drag coefficient used in the momentum equation virtual tmp K() const; diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/Beetstra/Beetstra.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/Beetstra/Beetstra.C index 2f3dea9894..d458db7d63 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/Beetstra/Beetstra.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/Beetstra/Beetstra.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2016-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2016-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "Beetstra.H" -#include "phasePair.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -44,11 +43,11 @@ namespace dragModels Foam::dragModels::Beetstra::Beetstra ( const dictionary& dict, - const phasePair& pair, + const phaseInterface& interface, const bool registerObject ) : - dragModel(dict, pair, registerObject), + dispersedDragModel(dict, interface, registerObject), residualRe_("residualRe", dimless, dict.lookup("residualRe")) {} @@ -65,15 +64,15 @@ Foam::tmp Foam::dragModels::Beetstra::CdRe() const { const volScalarField alpha1 ( - max(pair_.dispersed(), pair_.continuous().residualAlpha()) + max(interface_.dispersed(), interface_.continuous().residualAlpha()) ); const volScalarField alpha2 ( - max(1 - pair_.dispersed(), pair_.continuous().residualAlpha()) + max(1 - interface_.dispersed(), interface_.continuous().residualAlpha()) ); - const volScalarField Res(alpha2*pair_.Re()); + const volScalarField Res(alpha2*interface_.Re()); const volScalarField ResLim ( diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/Beetstra/Beetstra.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/Beetstra/Beetstra.H index c98a967885..94e281fee8 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/Beetstra/Beetstra.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/Beetstra/Beetstra.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2016-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2016-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -45,7 +45,7 @@ SourceFiles #ifndef Beetstra_H #define Beetstra_H -#include "dragModel.H" +#include "dispersedDragModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -60,7 +60,7 @@ namespace dragModels class Beetstra : - public dragModel + public dispersedDragModel { // Private Data @@ -76,11 +76,11 @@ public: // Constructors - //- Construct from a dictionary and a phase pair + //- Construct from a dictionary and an interface Beetstra ( const dictionary& dict, - const phasePair& pair, + const phaseInterface& interface, const bool registerObject ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/Ergun/Ergun.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/Ergun/Ergun.C index f67435f03c..175a9f17e0 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/Ergun/Ergun.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/Ergun/Ergun.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "Ergun.H" -#include "phasePair.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -44,11 +43,11 @@ namespace dragModels Foam::dragModels::Ergun::Ergun ( const dictionary& dict, - const phasePair& pair, + const phaseInterface& interface, const bool registerObject ) : - dragModel(dict, pair, registerObject) + dispersedDragModel(dict, interface, registerObject) {} @@ -62,14 +61,17 @@ Foam::dragModels::Ergun::~Ergun() Foam::tmp Foam::dragModels::Ergun::CdRe() const { + const phaseModel& dispersed = interface_.dispersed(); + const phaseModel& continuous = interface_.continuous(); + return (4.0/3.0) *( 150 - *max(1 - pair_.continuous(), pair_.dispersed().residualAlpha()) - /max(pair_.continuous(), pair_.continuous().residualAlpha()) + *max(1 - continuous, dispersed.residualAlpha()) + /max(continuous, continuous.residualAlpha()) + 1.75 - *pair_.Re() + *interface_.Re() ); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/Ergun/Ergun.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/Ergun/Ergun.H index 51f5af3301..1197260928 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/Ergun/Ergun.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/Ergun/Ergun.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -41,7 +41,7 @@ SourceFiles #ifndef Ergun_H #define Ergun_H -#include "dragModel.H" +#include "dispersedDragModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -56,7 +56,7 @@ namespace dragModels class Ergun : - public dragModel + public dispersedDragModel { public: @@ -66,11 +66,11 @@ public: // Constructors - //- Construct from a dictionary and a phase pair + //- Construct from a dictionary and an interface Ergun ( const dictionary& dict, - const phasePair& pair, + const phaseInterface& interface, const bool registerObject ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.C index 262f4da74c..238be2d4d2 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "Gibilaro.H" -#include "phasePair.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -44,11 +43,11 @@ namespace dragModels Foam::dragModels::Gibilaro::Gibilaro ( const dictionary& dict, - const phasePair& pair, + const phaseInterface& interface, const bool registerObject ) : - dragModel(dict, pair, registerObject) + dispersedDragModel(dict, interface, registerObject) {} @@ -64,13 +63,13 @@ Foam::tmp Foam::dragModels::Gibilaro::CdRe() const { const volScalarField alpha2 ( - max(1 - pair_.dispersed(), pair_.continuous().residualAlpha()) + max(1 - interface_.dispersed(), interface_.continuous().residualAlpha()) ); return (4.0/3.0) - *(17.3/alpha2 + 0.336*pair_.Re()) - *max(pair_.continuous(), pair_.continuous().residualAlpha()) + *(17.3/alpha2 + 0.336*interface_.Re()) + *max(interface_.continuous(), interface_.continuous().residualAlpha()) *pow(alpha2, -2.8); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.H index 8d3742985a..9de4e2a30b 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -42,7 +42,7 @@ SourceFiles #ifndef Gibilaro_H #define Gibilaro_H -#include "dragModel.H" +#include "dispersedDragModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -57,7 +57,7 @@ namespace dragModels class Gibilaro : - public dragModel + public dispersedDragModel { public: @@ -67,11 +67,11 @@ public: // Constructors - //- Construct from a dictionary and a phase pair + //- Construct from a dictionary and an interface Gibilaro ( const dictionary& dict, - const phasePair& pair, + const phaseInterface& interface, const bool registerObject ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.C index 55d8fe883a..27ebb53f82 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "GidaspowErgunWenYu.H" -#include "phasePair.H" #include "Ergun.H" #include "WenYu.H" #include "addToRunTimeSelectionTable.H" @@ -46,29 +45,13 @@ namespace dragModels Foam::dragModels::GidaspowErgunWenYu::GidaspowErgunWenYu ( const dictionary& dict, - const phasePair& pair, + const phaseInterface& interface, const bool registerObject ) : - dragModel(dict, pair, registerObject), - Ergun_ - ( - new Ergun - ( - dict, - pair, - false - ) - ), - WenYu_ - ( - new WenYu - ( - dict, - pair, - false - ) - ) + dispersedDragModel(dict, interface, registerObject), + Ergun_(dict, interface, false), + WenYu_(dict, interface, false) {} @@ -84,8 +67,8 @@ Foam::tmp Foam::dragModels::GidaspowErgunWenYu::CdRe() const { return - pos0(pair_.continuous() - 0.8)*WenYu_->CdRe() - + neg(pair_.continuous() - 0.8)*Ergun_->CdRe(); + pos0(interface_.continuous() - 0.8)*WenYu_.CdRe() + + neg(interface_.continuous() - 0.8)*Ergun_.CdRe(); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.H index 46d085caa8..131500df01 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,7 +43,9 @@ SourceFiles #ifndef GidaspowErgunWenYu_H #define GidaspowErgunWenYu_H -#include "dragModel.H" +#include "dispersedDragModel.H" +#include "Ergun.H" +#include "WenYu.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -52,24 +54,21 @@ namespace Foam namespace dragModels { -class Ergun; -class WenYu; - /*---------------------------------------------------------------------------*\ Class GidaspowErgunWenYu Declaration \*---------------------------------------------------------------------------*/ class GidaspowErgunWenYu : - public dragModel + public dispersedDragModel { // Private Data //- Ergun drag model - autoPtr Ergun_; + Ergun Ergun_; //- Wen Yu drag model - autoPtr WenYu_; + WenYu WenYu_; public: @@ -80,11 +79,11 @@ public: // Constructors - //- Construct from a dictionary and an ordered phase pair + //- Construct from a dictionary and an interface GidaspowErgunWenYu ( - const dictionary& interfaceDict, - const phasePair& pair, + const dictionary& dict, + const phaseInterface& interface, const bool registerObject ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.C index 4cd107c16e..693e2ac641 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "GidaspowSchillerNaumann.H" -#include "phasePair.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -44,11 +43,11 @@ namespace dragModels Foam::dragModels::GidaspowSchillerNaumann::GidaspowSchillerNaumann ( const dictionary& dict, - const phasePair& pair, + const phaseInterface& interface, const bool registerObject ) : - dragModel(dict, pair, registerObject), + dispersedDragModel(dict, interface, registerObject), residualRe_("residualRe", dimless, dict) {} @@ -66,10 +65,10 @@ Foam::dragModels::GidaspowSchillerNaumann::CdRe() const { const volScalarField alpha2 ( - max(1 - pair_.dispersed(), pair_.continuous().residualAlpha()) + max(1 - interface_.dispersed(), interface_.continuous().residualAlpha()) ); - const volScalarField Re(alpha2*pair_.Re()); + const volScalarField Re(alpha2*interface_.Re()); const volScalarField CdsRe ( @@ -80,7 +79,7 @@ Foam::dragModels::GidaspowSchillerNaumann::CdRe() const return CdsRe *pow(alpha2, -2.65) - *max(pair_.continuous(), pair_.continuous().residualAlpha()); + *max(interface_.continuous(), interface_.continuous().residualAlpha()); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.H index 5fd4c9ff12..81c7a91a32 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -48,7 +48,7 @@ SourceFiles #ifndef GidaspowSchillerNaumann_H #define GidaspowSchillerNaumann_H -#include "dragModel.H" +#include "dispersedDragModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -63,7 +63,7 @@ namespace dragModels class GidaspowSchillerNaumann : - public dragModel + public dispersedDragModel { // Private Data @@ -79,11 +79,11 @@ public: // Constructors - //- Construct from a dictionary and a phase pair + //- Construct from a dictionary and an interface GidaspowSchillerNaumann ( const dictionary& dict, - const phasePair& pair, + const phaseInterface& interface, const bool registerObject ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/IshiiZuber/IshiiZuber.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/IshiiZuber/IshiiZuber.C index a99250ffe1..22678e392d 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/IshiiZuber/IshiiZuber.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/IshiiZuber/IshiiZuber.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "IshiiZuber.H" -#include "phasePair.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -44,11 +43,11 @@ namespace dragModels Foam::dragModels::IshiiZuber::IshiiZuber ( const dictionary& dict, - const phasePair& pair, + const phaseInterface& interface, const bool registerObject ) : - dragModel(dict, pair, registerObject) + dispersedDragModel(dict, interface, registerObject) {} @@ -63,17 +62,17 @@ Foam::dragModels::IshiiZuber::~IshiiZuber() Foam::tmp Foam::dragModels::IshiiZuber::CdRe() const { - const volScalarField Re(pair_.Re()); - const volScalarField Eo(pair_.Eo()); + const volScalarField Re(interface_.Re()); + const volScalarField Eo(interface_.Eo()); - const volScalarField mud(pair_.dispersed().thermo().mu()); - const volScalarField muc(pair_.continuous().thermo().mu()); + const volScalarField mud(interface_.dispersed().thermo().mu()); + const volScalarField muc(interface_.continuous().thermo().mu()); const volScalarField muStar((mud + 0.4*muc)/(mud + muc)); const volScalarField muMix ( - muc*pow(max(1 - pair_.dispersed(), scalar(1e-3)), -2.5*muStar) + muc*pow(max(1 - interface_.dispersed(), scalar(1e-3)), -2.5*muStar) ); const volScalarField ReM(Re*muc/muMix); @@ -83,7 +82,7 @@ Foam::dragModels::IshiiZuber::CdRe() const + neg(1000 - ReM)*0.44*ReM ); - volScalarField F((muc/muMix)*sqrt(1 - pair_.dispersed())); + volScalarField F((muc/muMix)*sqrt(1 - interface_.dispersed())); F.max(1e-3); const volScalarField Ealpha((1 + 17.67*pow(F, 0.8571428))/(18.67*F)); @@ -92,7 +91,7 @@ Foam::dragModels::IshiiZuber::CdRe() const return pos0(CdReEllipse - CdRe) - *min(CdReEllipse, Re*sqr(1 - pair_.dispersed())*2.66667) + *min(CdReEllipse, Re*sqr(1 - interface_.dispersed())*2.66667) + neg(CdReEllipse - CdRe)*CdRe; } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/IshiiZuber/IshiiZuber.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/IshiiZuber/IshiiZuber.H index 89d8e78d49..728d0b4fa0 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/IshiiZuber/IshiiZuber.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/IshiiZuber/IshiiZuber.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,7 +43,7 @@ SourceFiles #ifndef IshiiZuber_H #define IshiiZuber_H -#include "dragModel.H" +#include "dispersedDragModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -58,7 +58,7 @@ namespace dragModels class IshiiZuber : - public dragModel + public dispersedDragModel { public: @@ -69,11 +69,11 @@ public: // Constructors - //- Construct from a dictionary and a phase pair + //- Construct from a dictionary and an interface IshiiZuber ( const dictionary& dict, - const phasePair& pair, + const phaseInterface& interface, const bool registerObject ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/Lain/Lain.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/Lain/Lain.C index 4ae8ab10be..50c09ec63c 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/Lain/Lain.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/Lain/Lain.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "Lain.H" -#include "phasePair.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -44,11 +43,11 @@ namespace dragModels Foam::dragModels::Lain::Lain ( const dictionary& dict, - const phasePair& pair, + const phaseInterface& interface, const bool registerObject ) : - dragModel(dict, pair, registerObject) + dispersedDragModel(dict, interface, registerObject) {} @@ -62,7 +61,7 @@ Foam::dragModels::Lain::~Lain() Foam::tmp Foam::dragModels::Lain::CdRe() const { - volScalarField Re(pair_.Re()); + volScalarField Re(interface_.Re()); return neg(Re - 1.5)*16.0 diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/Lain/Lain.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/Lain/Lain.H index 59ca1c8638..5cd48ee980 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/Lain/Lain.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/Lain/Lain.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -50,7 +50,7 @@ SourceFiles #ifndef Lain_H #define Lain_H -#include "dragModel.H" +#include "dispersedDragModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -65,7 +65,7 @@ namespace dragModels class Lain : - public dragModel + public dispersedDragModel { public: @@ -75,11 +75,11 @@ public: // Constructors - //- Construct from a dictionary and a phase pair + //- Construct from a dictionary and an interface Lain ( const dictionary& dict, - const phasePair& pair, + const phaseInterface& interface, const bool registerObject ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/SchillerNaumann/SchillerNaumann.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/SchillerNaumann/SchillerNaumann.C index 57116a8cc7..b64ddfa164 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/SchillerNaumann/SchillerNaumann.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/SchillerNaumann/SchillerNaumann.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "SchillerNaumann.H" -#include "phasePair.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -44,11 +43,11 @@ namespace dragModels Foam::dragModels::SchillerNaumann::SchillerNaumann ( const dictionary& dict, - const phasePair& pair, + const phaseInterface& interface, const bool registerObject ) : - dragModel(dict, pair, registerObject), + dispersedDragModel(dict, interface, registerObject), residualRe_("residualRe", dimless, dict) {} @@ -63,7 +62,7 @@ Foam::dragModels::SchillerNaumann::~SchillerNaumann() Foam::tmp Foam::dragModels::SchillerNaumann::CdRe() const { - volScalarField Re(pair_.Re()); + volScalarField Re(interface_.Re()); return neg(Re - 1000)*24*(1.0 + 0.15*pow(Re, 0.687)) diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/SchillerNaumann/SchillerNaumann.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/SchillerNaumann/SchillerNaumann.H index 58aaa646f7..67828f02ea 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/SchillerNaumann/SchillerNaumann.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/SchillerNaumann/SchillerNaumann.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -35,7 +35,7 @@ SourceFiles #ifndef SchillerNaumann_H #define SchillerNaumann_H -#include "dragModel.H" +#include "dispersedDragModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -50,7 +50,7 @@ namespace dragModels class SchillerNaumann : - public dragModel + public dispersedDragModel { // Private Data @@ -66,11 +66,11 @@ public: // Constructors - //- Construct from a dictionary and a phase pair + //- Construct from a dictionary and an interface SchillerNaumann ( const dictionary& dict, - const phasePair& pair, + const phaseInterface& interface, const bool registerObject ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/SyamlalOBrien/SyamlalOBrien.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/SyamlalOBrien/SyamlalOBrien.C index e0e6b3f822..301c022622 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/SyamlalOBrien/SyamlalOBrien.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/SyamlalOBrien/SyamlalOBrien.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "SyamlalOBrien.H" -#include "phasePair.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -44,11 +43,11 @@ namespace dragModels Foam::dragModels::SyamlalOBrien::SyamlalOBrien ( const dictionary& dict, - const phasePair& pair, + const phaseInterface& interface, const bool registerObject ) : - dragModel(dict, pair, registerObject) + dispersedDragModel(dict, interface, registerObject) {} @@ -64,7 +63,7 @@ Foam::tmp Foam::dragModels::SyamlalOBrien::CdRe() const { const volScalarField alpha2 ( - max(1 - pair_.dispersed(), pair_.continuous().residualAlpha()) + max(1 - interface_.dispersed(), interface_.continuous().residualAlpha()) ); const volScalarField A(pow(alpha2, 4.14)); @@ -73,7 +72,7 @@ Foam::tmp Foam::dragModels::SyamlalOBrien::CdRe() const neg(alpha2 - 0.85)*(0.8*pow(alpha2, 1.28)) + pos0(alpha2 - 0.85)*(pow(alpha2, 2.65)) ); - const volScalarField Re(pair_.Re()); + const volScalarField Re(interface_.Re()); const volScalarField Vr ( 0.5 @@ -85,7 +84,7 @@ Foam::tmp Foam::dragModels::SyamlalOBrien::CdRe() const return CdsRe - *max(pair_.continuous(), pair_.continuous().residualAlpha()) + *max(interface_.continuous(), interface_.continuous().residualAlpha()) /sqr(Vr); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/SyamlalOBrien/SyamlalOBrien.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/SyamlalOBrien/SyamlalOBrien.H index 78a6e42d45..b888dc4f53 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/SyamlalOBrien/SyamlalOBrien.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/SyamlalOBrien/SyamlalOBrien.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -42,7 +42,7 @@ SourceFiles #ifndef SyamlalOBrien_H #define SyamlalOBrien_H -#include "dragModel.H" +#include "dispersedDragModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -57,7 +57,7 @@ namespace dragModels class SyamlalOBrien : - public dragModel + public dispersedDragModel { public: @@ -67,11 +67,11 @@ public: // Constructors - //- Construct from a dictionary and a phase pair + //- Construct from a dictionary and an interface SyamlalOBrien ( const dictionary& dict, - const phasePair& pair, + const phaseInterface& interface, const bool registerObject ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/Tenneti/Tenneti.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/Tenneti/Tenneti.C index ae4e96127f..813689a96f 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/Tenneti/Tenneti.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/Tenneti/Tenneti.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2016-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2016-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "Tenneti.H" -#include "phasePair.H" #include "SchillerNaumann.H" #include "addToRunTimeSelectionTable.H" @@ -45,11 +44,11 @@ namespace dragModels Foam::dragModels::Tenneti::Tenneti ( const dictionary& dict, - const phasePair& pair, + const phaseInterface& interface, const bool registerObject ) : - dragModel(dict, pair, registerObject), + dispersedDragModel(dict, interface, registerObject), residualRe_("residualRe", dimless, dict.lookup("residualRe")) {} @@ -66,15 +65,15 @@ Foam::tmp Foam::dragModels::Tenneti::CdRe() const { const volScalarField alpha1 ( - max(pair_.dispersed(), pair_.continuous().residualAlpha()) + max(interface_.dispersed(), interface_.continuous().residualAlpha()) ); const volScalarField alpha2 ( - max(1 - pair_.dispersed(), pair_.continuous().residualAlpha()) + max(1 - interface_.dispersed(), interface_.continuous().residualAlpha()) ); - const volScalarField Res(alpha2*pair_.Re()); + const volScalarField Res(alpha2*interface_.Re()); const volScalarField CdReIsolated ( diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/Tenneti/Tenneti.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/Tenneti/Tenneti.H index 2cb0aeecfb..2825d14764 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/Tenneti/Tenneti.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/Tenneti/Tenneti.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2016-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2016-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -45,7 +45,7 @@ SourceFiles #ifndef Tenneti_H #define Tenneti_H -#include "dragModel.H" +#include "dispersedDragModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -62,7 +62,7 @@ class SchillerNaumann; class Tenneti : - public dragModel + public dispersedDragModel { // Private Data @@ -78,11 +78,11 @@ public: // Constructors - //- Construct from a dictionary and a phase pair + //- Construct from a dictionary and an interface Tenneti ( const dictionary& dict, - const phasePair& pair, + const phaseInterface& interface, const bool registerObject ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/TomiyamaAnalytic/TomiyamaAnalytic.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/TomiyamaAnalytic/TomiyamaAnalytic.C index 3f22b23db5..fdbc0be7ac 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/TomiyamaAnalytic/TomiyamaAnalytic.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/TomiyamaAnalytic/TomiyamaAnalytic.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "TomiyamaAnalytic.H" -#include "phasePair.H" #include "aspectRatioModel.H" #include "addToRunTimeSelectionTable.H" @@ -45,15 +44,15 @@ namespace dragModels Foam::dragModels::TomiyamaAnalytic::TomiyamaAnalytic ( const dictionary& dict, - const phasePair& pair, + const phaseInterface& interface, const bool registerObject ) : - dragModel(dict, pair, registerObject), + dispersedDragModel(dict, interface, registerObject), residualRe_("residualRe", dimless, dict), residualEo_("residualEo", dimless, dict), residualE_("residualE", dimless, dict), - aspectRatio_(aspectRatioModel::New(dict.subDict("aspectRatio"), pair)) + aspectRatio_(aspectRatioModel::New(dict.subDict("aspectRatio"), interface)) {} @@ -68,7 +67,7 @@ Foam::dragModels::TomiyamaAnalytic::~TomiyamaAnalytic() Foam::tmp Foam::dragModels::TomiyamaAnalytic::CdRe() const { - const volScalarField Eo(max(pair_.Eo(), residualEo_)); + const volScalarField Eo(max(interface_.Eo(), residualEo_)); const volScalarField E(max(aspectRatio_->E(), residualE_)); const volScalarField OmEsq(max(1 - sqr(E), sqr(residualE_))); @@ -84,7 +83,7 @@ Foam::dragModels::TomiyamaAnalytic::CdRe() const + 16*pow(E, 4.0/3.0) ) /sqr(F) - *max(pair_.Re(), residualRe_); + *max(interface_.Re(), residualRe_); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/TomiyamaAnalytic/TomiyamaAnalytic.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/TomiyamaAnalytic/TomiyamaAnalytic.H index 3d9353285c..36654ab1fd 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/TomiyamaAnalytic/TomiyamaAnalytic.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/TomiyamaAnalytic/TomiyamaAnalytic.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,7 +43,7 @@ SourceFiles #ifndef TomiyamaAnalytic_H #define TomiyamaAnalytic_H -#include "dragModel.H" +#include "dispersedDragModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -61,7 +61,7 @@ namespace dragModels class TomiyamaAnalytic : - public dragModel + public dispersedDragModel { // Private Data @@ -86,11 +86,11 @@ public: // Constructors - //- Construct from a dictionary and a phase pair + //- Construct from a dictionary and an interface TomiyamaAnalytic ( const dictionary& dict, - const phasePair& pair, + const phaseInterface& interface, const bool registerObject ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/TomiyamaCorrelated/TomiyamaCorrelated.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/TomiyamaCorrelated/TomiyamaCorrelated.C index e062733ae1..e49f612626 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/TomiyamaCorrelated/TomiyamaCorrelated.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/TomiyamaCorrelated/TomiyamaCorrelated.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "TomiyamaCorrelated.H" -#include "phasePair.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -44,11 +43,11 @@ namespace dragModels Foam::dragModels::TomiyamaCorrelated::TomiyamaCorrelated ( const dictionary& dict, - const phasePair& pair, + const phaseInterface& interface, const bool registerObject ) : - dragModel(dict, pair, registerObject), + dispersedDragModel(dict, interface, registerObject), A_("A", dimless, dict) {} @@ -64,8 +63,8 @@ Foam::dragModels::TomiyamaCorrelated::~TomiyamaCorrelated() Foam::tmp Foam::dragModels::TomiyamaCorrelated::CdRe() const { - const volScalarField Re(pair_.Re()); - const volScalarField Eo(pair_.Eo()); + const volScalarField Re(interface_.Re()); + const volScalarField Eo(interface_.Eo()); return max diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/TomiyamaCorrelated/TomiyamaCorrelated.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/TomiyamaCorrelated/TomiyamaCorrelated.H index 3328f3248b..e16a30efc5 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/TomiyamaCorrelated/TomiyamaCorrelated.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/TomiyamaCorrelated/TomiyamaCorrelated.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,7 +43,7 @@ SourceFiles #ifndef TomiyamaCorrelated_H #define TomiyamaCorrelated_H -#include "dragModel.H" +#include "dispersedDragModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -58,7 +58,7 @@ namespace dragModels class TomiyamaCorrelated : - public dragModel + public dispersedDragModel { // Private Data @@ -74,11 +74,11 @@ public: // Constructors - //- Construct from a dictionary and a phase pair + //- Construct from a dictionary and an interface TomiyamaCorrelated ( const dictionary& dict, - const phasePair& pair, + const phaseInterface& interface, const bool registerObject ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/TomiyamaKataokaZunSakaguchi/TomiyamaKataokaZunSakaguchi.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/TomiyamaKataokaZunSakaguchi/TomiyamaKataokaZunSakaguchi.C index 6acce4ed0f..990153a638 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/TomiyamaKataokaZunSakaguchi/TomiyamaKataokaZunSakaguchi.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/TomiyamaKataokaZunSakaguchi/TomiyamaKataokaZunSakaguchi.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "TomiyamaKataokaZunSakaguchi.H" -#include "phasePair.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -49,11 +48,11 @@ namespace dragModels Foam::dragModels::TomiyamaKataokaZunSakaguchi::TomiyamaKataokaZunSakaguchi ( const dictionary& dict, - const phasePair& pair, + const phaseInterface& interface, const bool registerObject ) : - dragModel(dict, pair, registerObject), + dispersedDragModel(dict, interface, registerObject), residualRe_("residualRe", dimless, dict), residualEo_("residualEo", dimless, dict) {} @@ -70,8 +69,8 @@ Foam::dragModels::TomiyamaKataokaZunSakaguchi::~TomiyamaKataokaZunSakaguchi() Foam::tmp Foam::dragModels::TomiyamaKataokaZunSakaguchi::CdRe() const { - volScalarField Re(pair_.Re()); - volScalarField Eo(max(pair_.Eo(), residualEo_)); + volScalarField Re(interface_.Re()); + volScalarField Eo(max(interface_.Eo(), residualEo_)); return max @@ -79,7 +78,7 @@ Foam::dragModels::TomiyamaKataokaZunSakaguchi::CdRe() const 24*(1 + 0.15*pow(Re, 0.687))/max(Re, residualRe_), 8*Eo/(3*(Eo + 4.0)) ) - *max(pair_.Re(), residualRe_); + *max(interface_.Re(), residualRe_); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/TomiyamaKataokaZunSakaguchi/TomiyamaKataokaZunSakaguchi.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/TomiyamaKataokaZunSakaguchi/TomiyamaKataokaZunSakaguchi.H index 83cc5d2dd5..a82b9cdb15 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/TomiyamaKataokaZunSakaguchi/TomiyamaKataokaZunSakaguchi.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/TomiyamaKataokaZunSakaguchi/TomiyamaKataokaZunSakaguchi.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -44,7 +44,7 @@ SourceFiles #ifndef TomiyamaKataokaZunSakaguchi_H #define TomiyamaKataokaZunSakaguchi_H -#include "dragModel.H" +#include "dispersedDragModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -59,7 +59,7 @@ namespace dragModels class TomiyamaKataokaZunSakaguchi : - public dragModel + public dispersedDragModel { // Private Data @@ -78,11 +78,11 @@ public: // Constructors - //- Construct from a dictionary and a phase pair + //- Construct from a dictionary and an interface TomiyamaKataokaZunSakaguchi ( const dictionary& dict, - const phasePair& pair, + const phaseInterface& interface, const bool registerObject ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/WenYu/WenYu.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/WenYu/WenYu.C index 4fe282f849..9dba43459a 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/WenYu/WenYu.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/WenYu/WenYu.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "WenYu.H" -#include "phasePair.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -44,11 +43,11 @@ namespace dragModels Foam::dragModels::WenYu::WenYu ( const dictionary& dict, - const phasePair& pair, + const phaseInterface& interface, const bool registerObject ) : - dragModel(dict, pair, registerObject), + dispersedDragModel(dict, interface, registerObject), residualRe_("residualRe", dimless, dict) {} @@ -65,10 +64,10 @@ Foam::tmp Foam::dragModels::WenYu::CdRe() const { const volScalarField alpha2 ( - max(1 - pair_.dispersed(), pair_.continuous().residualAlpha()) + max(1 - interface_.dispersed(), interface_.continuous().residualAlpha()) ); - const volScalarField Res(alpha2*pair_.Re()); + const volScalarField Res(alpha2*interface_.Re()); const volScalarField CdsRes ( neg(Res - 1000)*24*(1.0 + 0.15*pow(Res, 0.687)) @@ -78,7 +77,7 @@ Foam::tmp Foam::dragModels::WenYu::CdRe() const return CdsRes *pow(alpha2, -3.65) - *max(pair_.continuous(), pair_.continuous().residualAlpha()); + *max(interface_.continuous(), interface_.continuous().residualAlpha()); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/WenYu/WenYu.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/WenYu/WenYu.H index a974769a44..b2239e2110 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/WenYu/WenYu.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/WenYu/WenYu.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,7 +43,7 @@ SourceFiles #ifndef WenYu_H #define WenYu_H -#include "dragModel.H" +#include "dispersedDragModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -58,7 +58,7 @@ namespace dragModels class WenYu : - public dragModel + public dispersedDragModel { // Private Data @@ -74,11 +74,11 @@ public: // Constructors - //- Construct from a dictionary and a phase pair + //- Construct from a dictionary and an interface WenYu ( const dictionary& dict, - const phasePair& pair, + const phaseInterface& interface, const bool registerObject ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/aerosolDrag/aerosolDrag.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/aerosolDrag/aerosolDrag.C index 285d6166a7..ff19261c39 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/aerosolDrag/aerosolDrag.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/aerosolDrag/aerosolDrag.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2019-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "aerosolDrag.H" -#include "phasePair.H" #include "swarmCorrection.H" #include "addToRunTimeSelectionTable.H" #include "constants.H" @@ -49,11 +48,11 @@ using Foam::constant::mathematical::pi; Foam::dragModels::aerosolDrag::aerosolDrag ( const dictionary& dict, - const phasePair& pair, + const phaseInterface& interface, const bool registerObject ) : - dragModel(dict, pair, registerObject), + dispersedDragModel(dict, interface, registerObject), A1_(dict.lookupOrDefault("A1", 2.514)), A2_(dict.lookupOrDefault("A2", 0.8)), A3_(dict.lookupOrDefault("A3", 0.55)), @@ -71,9 +70,9 @@ Foam::dragModels::aerosolDrag::~aerosolDrag() Foam::tmp Foam::dragModels::aerosolDrag::CdRe() const { - const volScalarField& T = pair_.continuous().thermo().T(); - const volScalarField& p = pair_.continuous().thermo().p(); - tmp td(pair_.dispersed().d()); + const volScalarField& T = interface_.continuous().thermo().T(); + const volScalarField& p = interface_.continuous().thermo().p(); + tmp td(interface_.dispersed().d()); const volScalarField& d = td(); const volScalarField lambda(k*T/(sqrt(2.0)*pi*p*sqr(sigma_))); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/aerosolDrag/aerosolDrag.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/aerosolDrag/aerosolDrag.H index 9df25aeee2..6145f4e3b5 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/aerosolDrag/aerosolDrag.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/aerosolDrag/aerosolDrag.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2019-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -70,7 +70,7 @@ SourceFiles #ifndef aerosolDrag_H #define aerosolDrag_H -#include "dragModel.H" +#include "dispersedDragModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -85,7 +85,7 @@ namespace dragModels class aerosolDrag : - public dragModel + public dispersedDragModel { // Private Data @@ -110,11 +110,11 @@ public: // Constructors - //- Construct from a dictionary and a phase pair + //- Construct from a dictionary and an interface aerosolDrag ( const dictionary& dict, - const phasePair& pair, + const phaseInterface& interface, const bool registerObject ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/dispersedDragModel/dispersedDragModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/dispersedDragModel/dispersedDragModel.C new file mode 100644 index 0000000000..6231ca6e2f --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/dispersedDragModel/dispersedDragModel.C @@ -0,0 +1,93 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "dispersedDragModel.H" +#include "phaseSystem.H" +#include "noSwarm.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::dragModels::dispersedDragModel::dispersedDragModel +( + const dictionary& dict, + const phaseInterface& interface, + const bool registerObject +) +: + dragModel(dict, interface, registerObject), + interface_(interface.modelCast()), + swarmCorrection_ + ( + dict.found("swarmCorrection") + ? swarmCorrection::New(dict.subDict("swarmCorrection"), interface).ptr() + : new swarmCorrections::noSwarm(dict, interface) + ) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::dragModels::dispersedDragModel::~dispersedDragModel() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp Foam::dragModels::dispersedDragModel::Ki() const +{ + return + 0.75 + *CdRe() + *swarmCorrection_->Cs() + *interface_.continuous().rho() + *interface_.continuous().thermo().nu() + /sqr(interface_.dispersed().d()); +} + + +Foam::tmp Foam::dragModels::dispersedDragModel::K() const +{ + return + max + ( + interface_.dispersed(), + interface_.dispersed().residualAlpha() + )*Ki(); +} + + +Foam::tmp +Foam::dragModels::dispersedDragModel::Kf() const +{ + return + max + ( + fvc::interpolate(interface_.dispersed()), + interface_.dispersed().residualAlpha() + )*fvc::interpolate(Ki()); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/dispersedDragModel/dispersedDragModel.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/dispersedDragModel/dispersedDragModel.H new file mode 100644 index 0000000000..b38d4179d3 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/dispersedDragModel/dispersedDragModel.H @@ -0,0 +1,118 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::dispersedDragModel + +Description + Model for drag between two phases where one phase can be considered + dispersed in the other and the drag therefore characterised by a drag + coefficient + +SourceFiles + dispersedDragModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef dispersedDragModel_H +#define dispersedDragModel_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "dragModel.H" +#include "dispersedPhaseInterface.H" + +namespace Foam +{ +namespace dragModels +{ + +/*---------------------------------------------------------------------------*\ + Class dispersedDragModel Declaration +\*---------------------------------------------------------------------------*/ + +class dispersedDragModel +: + public dragModel +{ +protected: + + // Protected data + + //- Interface + const dispersedPhaseInterface interface_; + + //- Swarm correction + autoPtr swarmCorrection_; + + +public: + + // Constructors + + // Construct from a dictionary and an interface + dispersedDragModel + ( + const dictionary& dict, + const phaseInterface& interface, + const bool registerObject + ); + + + //- Destructor + virtual ~dispersedDragModel(); + + + // Member Functions + + //- Drag coefficient + virtual tmp CdRe() const = 0; + + //- Return the phase-intensive drag coefficient Ki + // used in the momentum equations + // ddt(alpha1*rho1*U1) + ... = ... alphad*K*(U1-U2) + // ddt(alpha2*rho2*U2) + ... = ... alphad*K*(U2-U1) + virtual tmp Ki() const; + + //- Return the drag coefficient K + // used in the momentum equations + // ddt(alpha1*rho1*U1) + ... = ... K*(U1-U2) + // ddt(alpha2*rho2*U2) + ... = ... K*(U2-U1) + virtual tmp K() const; + + //- Return the drag coefficient Kf + // used in the face-momentum equations + virtual tmp Kf() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace dragModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/dragModel/dragModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/dragModel/dragModel.C index 2568a7a138..9198050aab 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/dragModel/dragModel.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/dragModel/dragModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,10 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "dragModel.H" -#include "phasePair.H" -#include "noSwarm.H" -#include "surfaceInterpolate.H" -#include "BlendedInterfacialModel.H" +#include "phaseSystem.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -46,7 +43,7 @@ const Foam::dimensionSet Foam::dragModel::dimK(1, -3, -1, 0, 0); Foam::dragModel::dragModel ( const dictionary& dict, - const phasePair& pair, + const phaseInterface& interface, const bool registerObject ) : @@ -54,24 +51,13 @@ Foam::dragModel::dragModel ( IOobject ( - IOobject::groupName(typeName, pair.name()), - pair.phase1().mesh().time().timeName(), - pair.phase1().mesh(), + IOobject::groupName(typeName, interface.name()), + interface.mesh().time().timeName(), + interface.mesh(), IOobject::NO_READ, IOobject::NO_WRITE, registerObject ) - ), - pair_(pair), - swarmCorrection_ - ( - dict.found("swarmCorrection") - ? swarmCorrection::New - ( - dict.subDict("swarmCorrection"), - pair - ) - : autoPtr(new swarmCorrections::noSwarm(dict, pair)) ) {} @@ -84,39 +70,22 @@ Foam::dragModel::~dragModel() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -Foam::tmp Foam::dragModel::Ki() const -{ - return - 0.75 - *CdRe() - *swarmCorrection_->Cs() - *pair_.continuous().rho() - *pair_.continuous().thermo().nu() - /sqr(pair_.dispersed().d()); -} - - -Foam::tmp Foam::dragModel::K() const -{ - return max(pair_.dispersed(), pair_.dispersed().residualAlpha())*Ki(); -} - - -Foam::tmp Foam::dragModel::Kf() const -{ - return - max - ( - fvc::interpolate(pair_.dispersed()), - pair_.dispersed().residualAlpha() - )*fvc::interpolate(Ki()); -} - - bool Foam::dragModel::writeData(Ostream& os) const { return os.good(); } +Foam::tmp Foam::blendedDragModel::K() const +{ + return evaluate(&dragModel::K, "K", dragModel::dimK, false); +} + + +Foam::tmp Foam::blendedDragModel::Kf() const +{ + return evaluate(&dragModel::Kf, "Kf", dragModel::dimK, false); +} + + // ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/dragModel/dragModel.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/dragModel/dragModel.H index c12372127b..737812d064 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/dragModel/dragModel.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/dragModel/dragModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,6 +25,7 @@ Class Foam::dragModel Description + Model for drag between phases SourceFiles dragModel.C @@ -40,11 +41,11 @@ SourceFiles #include "volFields.H" #include "dictionary.H" #include "runTimeSelectionTables.H" +#include "BlendedInterfacialModel.H" namespace Foam { -class phasePair; class swarmCorrection; /*---------------------------------------------------------------------------*\ @@ -55,17 +56,6 @@ class dragModel : public regIOobject { -protected: - - // Protected data - - //- Phase pair - const phasePair& pair_; - - //- Swarm correction - autoPtr swarmCorrection_; - - public: //- Runtime type information @@ -81,10 +71,10 @@ public: dictionary, ( const dictionary& dict, - const phasePair& pair, + const phaseInterface& interface, const bool registerObject ), - (dict, pair, registerObject) + (dict, interface, registerObject) ); @@ -93,14 +83,17 @@ public: //- Coefficient dimensions static const dimensionSet dimK; + //- Does this model require correcting on fixed flux boundaries? + static const bool correctFixedFluxBCs = true; + // Constructors - // Construct with residual constants + // Construct from a dictionary and an interface dragModel ( const dictionary& dict, - const phasePair& pair, + const phaseInterface& interface, const bool registerObject ); @@ -114,36 +107,64 @@ public: static autoPtr New ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface, + const bool outer=true, + const bool registerObject=true ); // Member Functions - //- Drag coefficient - virtual tmp CdRe() const = 0; - - //- Return the phase-intensive drag coefficient Ki - // used in the momentum equations - // ddt(alpha1*rho1*U1) + ... = ... alphad*K*(U1-U2) - // ddt(alpha2*rho2*U2) + ... = ... alphad*K*(U2-U1) - virtual tmp Ki() const; - //- Return the drag coefficient K // used in the momentum equations // ddt(alpha1*rho1*U1) + ... = ... K*(U1-U2) // ddt(alpha2*rho2*U2) + ... = ... K*(U2-U1) - virtual tmp K() const; + virtual tmp K() const = 0; //- Return the drag coefficient Kf // used in the face-momentum equations - virtual tmp Kf() const; + virtual tmp Kf() const = 0; //- Dummy write for regIOobject bool writeData(Ostream& os) const; }; +/*---------------------------------------------------------------------------*\ + Class blendedDragModel Declaration +\*---------------------------------------------------------------------------*/ + +class blendedDragModel +: + public BlendedInterfacialModel +{ +public: + + // Constructors + + //- Inherit base class constructors + using BlendedInterfacialModel::BlendedInterfacialModel; + + + // Selectors + + static autoPtr New + ( + const dictionary& dict, + const phaseInterface& interface + ); + + + // Member Functions + + //- Return the drag coefficient K + tmp K() const; + + //- Return the drag coefficient Kf + tmp Kf() const; +}; + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/dragModel/dragModelNew.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/dragModel/dragModelNew.C index 61498306de..1c74a7d34c 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/dragModel/dragModelNew.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/dragModel/dragModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,20 +24,25 @@ License \*---------------------------------------------------------------------------*/ #include "dragModel.H" -#include "phasePair.H" +#include "phaseSystem.H" // * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * // Foam::autoPtr Foam::dragModel::New ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface, + const bool outer, + const bool registerObject ) { - word dragModelType(dict.lookup("type")); + const dictionary& modelDict = + outer ? interface.fluid().modelSubDict(dict) : dict; + + const word dragModelType(modelDict.lookup("type")); Info<< "Selecting dragModel for " - << pair << ": " << dragModelType << endl; + << interface.name() << ": " << dragModelType << endl; dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(dragModelType); @@ -52,7 +57,17 @@ Foam::autoPtr Foam::dragModel::New << exit(FatalError); } - return cstrIter()(dict, pair, true); + return cstrIter()(modelDict, interface, registerObject); +} + + +Foam::autoPtr Foam::blendedDragModel::New +( + const dictionary& dict, + const phaseInterface& interface +) +{ + return autoPtr(new blendedDragModel(dict, interface)); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/segregated/segregated.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/segregated/segregated.C index 9495175f0b..42f2964b51 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/segregated/segregated.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/segregated/segregated.C @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "segregated.H" -#include "phasePair.H" #include "fvcGrad.H" #include "surfaceInterpolate.H" #include "zeroGradientFvPatchFields.H" @@ -47,11 +46,12 @@ namespace dragModels Foam::dragModels::segregated::segregated ( const dictionary& dict, - const phasePair& pair, + const phaseInterface& interface, const bool registerObject ) : - dragModel(dict, pair, registerObject), + dragModel(dict, interface, registerObject), + interface_(interface.modelCast()), m_("m", dimless, dict), n_("n", dimless, dict) {} @@ -65,29 +65,18 @@ Foam::dragModels::segregated::~segregated() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -Foam::tmp Foam::dragModels::segregated::CdRe() const -{ - FatalErrorInFunction - << "Not implemented." - << "Drag coefficient not defined for the segregated model." - << exit(FatalError); - - return pair_.phase1(); -} - - Foam::tmp Foam::dragModels::segregated::K() const { - const fvMesh& mesh(pair_.phase1().mesh()); + const fvMesh& mesh(interface_.phase1().mesh()); - const volScalarField& alpha1(pair_.phase1()); - const volScalarField& alpha2(pair_.phase2()); + const volScalarField& alpha1(interface_.phase1()); + const volScalarField& alpha2(interface_.phase2()); - const volScalarField& rho1(pair_.phase1().rho()); - const volScalarField& rho2(pair_.phase2().rho()); + const volScalarField& rho1(interface_.phase1().rho()); + const volScalarField& rho2(interface_.phase2().rho()); - tmp tnu1(pair_.phase1().thermo().nu()); - tmp tnu2(pair_.phase2().thermo().nu()); + tmp tnu1(interface_.phase1().thermo().nu()); + tmp tnu2(interface_.phase2().thermo().nu()); const volScalarField& nu1(tnu1()); const volScalarField& nu2(tnu2()); @@ -109,7 +98,10 @@ Foam::tmp Foam::dragModels::segregated::K() const const dimensionedScalar residualAlpha ( - (pair_.phase1().residualAlpha() + pair_.phase2().residualAlpha())/2 + ( + interface_.phase1().residualAlpha() + + interface_.phase2().residualAlpha() + )/2 ); const volScalarField I1(alpha1/max(alpha1 + alpha2, residualAlpha)); @@ -127,12 +119,12 @@ Foam::tmp Foam::dragModels::segregated::K() const const volScalarField limitedAlpha1 ( - max(alpha1, pair_.phase1().residualAlpha()) + max(alpha1, interface_.phase1().residualAlpha()) ); const volScalarField limitedAlpha2 ( - max(alpha2, pair_.phase2().residualAlpha()) + max(alpha2, interface_.phase2().residualAlpha()) ); const volScalarField muAlphaI @@ -143,7 +135,7 @@ Foam::tmp Foam::dragModels::segregated::K() const const volScalarField ReI ( - pair_.rho()*pair_.magUr() + interface_.rho()*interface_.magUr() /(magGradI*limitedAlpha1*limitedAlpha2*muI) ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/segregated/segregated.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/segregated/segregated.H index acd5a1b1ba..f906ed7d06 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/segregated/segregated.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/segregated/segregated.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,6 +43,7 @@ SourceFiles #define segregated_H #include "dragModel.H" +#include "segregatedPhaseInterface.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -61,6 +62,9 @@ class segregated { // Private Data + //- Interface + const segregatedPhaseInterface interface_; + //- M coefficient const dimensionedScalar m_; @@ -76,11 +80,11 @@ public: // Constructors - //- Construct from components + //- Construct from a dictionary and an interface segregated ( const dictionary& dict, - const phasePair& pair, + const phaseInterface& interface, const bool registerObject ); @@ -91,9 +95,6 @@ public: // Member Functions - //- Drag coefficient - virtual tmp CdRe() const; - //- The drag function used in the momentum equation virtual tmp K() const; diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/timeScaleFilteredDrag/timeScaleFilteredDrag.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/timeScaleFilteredDrag/timeScaleFilteredDrag.C index 301ea13df2..562770b9a0 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/timeScaleFilteredDrag/timeScaleFilteredDrag.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/timeScaleFilteredDrag/timeScaleFilteredDrag.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2019-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "timeScaleFilteredDrag.H" -#include "phasePair.H" #include "swarmCorrection.H" #include "addToRunTimeSelectionTable.H" @@ -45,17 +44,25 @@ namespace dragModels Foam::dragModels::timeScaleFilteredDrag::timeScaleFilteredDrag ( const dictionary& dict, - const phasePair& pair, + const phaseInterface& interface, const bool registerObject ) : - dragModel(dict.subDict("dragModel"), pair, registerObject), + dispersedDragModel(dict.subDict("dragModel"), interface, registerObject), dragModel_ ( - dragModel::New(dict.subDict("dragModel"), pair) + dragModel::New(dict.subDict("dragModel"), interface, false, false) ), minRelaxTime_("minRelaxTime", dimTime, dict) -{} +{ + if (!isA(dragModel_())) + { + FatalErrorInFunction + << "The sub-drag-model of a " << type() + << " drag model must be for a dispersed configuration" + << exit(FatalError); + } +} // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // @@ -71,16 +78,16 @@ Foam::dragModels::timeScaleFilteredDrag::CdRe() const { const volScalarField limit ( - sqr(pair_.dispersed().d()) - *pair_.dispersed().rho() + sqr(interface_.dispersed().d()) + *interface_.dispersed().rho() /0.75 /swarmCorrection_->Cs() - /pair_.continuous().rho() - /pair_.continuous().thermo().nu() + /interface_.continuous().rho() + /interface_.continuous().thermo().nu() /minRelaxTime_ ); - return min(dragModel_->CdRe(), limit); + return min(refCast(dragModel_()).CdRe(), limit); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/timeScaleFilteredDrag/timeScaleFilteredDrag.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/timeScaleFilteredDrag/timeScaleFilteredDrag.H index 9ecae9b316..b34bdebf72 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/timeScaleFilteredDrag/timeScaleFilteredDrag.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/timeScaleFilteredDrag/timeScaleFilteredDrag.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2019-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -37,7 +37,7 @@ SourceFiles #ifndef timeScaleFilteredDrag_H #define timeScaleFilteredDrag_H -#include "dragModel.H" +#include "dispersedDragModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -52,7 +52,7 @@ namespace dragModels class timeScaleFilteredDrag : - public dragModel + public dispersedDragModel { // Private Data @@ -71,11 +71,11 @@ public: // Constructors - //- Construct from a dictionary and a phase pair + //- Construct from a dictionary and an interface timeScaleFilteredDrag ( const dictionary& dict, - const phasePair& pair, + const phaseInterface& interface, const bool registerObject ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/Gunn/Gunn.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/Gunn/Gunn.C index 540de90d7e..609df7a317 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/Gunn/Gunn.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/Gunn/Gunn.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2019-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "Gunn.H" -#include "phasePair.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -44,10 +43,14 @@ namespace heatTransferModels Foam::heatTransferModels::Gunn::Gunn ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) : - heatTransferModel(dict, pair) + heatTransferModel(dict, interface), + interface_ + ( + interface.modelCast() + ) {} @@ -64,7 +67,7 @@ Foam::heatTransferModels::Gunn::K(const scalar residualAlpha) const { const volScalarField alpha2 ( - max(1 - pair_.dispersed(), pair_.continuous().residualAlpha()) + max(1 - interface_.dispersed(), interface_.continuous().residualAlpha()) ); const volScalarField sqrAlpha2(sqr(alpha2)); @@ -72,15 +75,15 @@ Foam::heatTransferModels::Gunn::K(const scalar residualAlpha) const const volScalarField Nu ( (7 - 10*alpha2 + 5*sqrAlpha2) - *(1 + 0.7*pow(pair_.Re(), 0.2)*cbrt(pair_.Pr())) + *(1 + 0.7*pow(interface_.Re(), 0.2)*cbrt(interface_.Pr())) + (1.33 - 2.4*alpha2 + 1.2*sqrAlpha2) - *pow(pair_.Re(), 0.7)*cbrt(pair_.Pr()) + *pow(interface_.Re(), 0.7)*cbrt(interface_.Pr()) ); return - 6*max(pair_.dispersed(), residualAlpha) - *pair_.continuous().thermo().kappa() - *Nu/sqr(pair_.dispersed().d()); + 6*max(interface_.dispersed(), residualAlpha) + *interface_.continuous().thermo().kappa() + *Nu/sqr(interface_.dispersed().d()); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/Gunn/Gunn.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/Gunn/Gunn.H index 304f13fabd..6959144056 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/Gunn/Gunn.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/Gunn/Gunn.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2019-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -60,6 +60,12 @@ class Gunn : public heatTransferModel { + // Private Data + + //- Interface + const dispersedPhaseInterface interface_; + + public: //- Runtime type information @@ -68,11 +74,11 @@ public: // Constructors - //- Construct from components + //- Construct from a dictionary and an interface Gunn ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/RanzMarshall/RanzMarshall.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/RanzMarshall/RanzMarshall.C index d95fc90644..e3140250d4 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/RanzMarshall/RanzMarshall.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/RanzMarshall/RanzMarshall.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "RanzMarshall.H" -#include "phasePair.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -44,10 +43,14 @@ namespace heatTransferModels Foam::heatTransferModels::RanzMarshall::RanzMarshall ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) : - heatTransferModel(dict, pair) + heatTransferModel(dict, interface), + interface_ + ( + interface.modelCast() + ) {} @@ -62,14 +65,14 @@ Foam::heatTransferModels::RanzMarshall::~RanzMarshall() Foam::tmp Foam::heatTransferModels::RanzMarshall::K(const scalar residualAlpha) const { - volScalarField Nu(2 + 0.6*sqrt(pair_.Re())*cbrt(pair_.Pr())); + volScalarField Nu(2 + 0.6*sqrt(interface_.Re())*cbrt(interface_.Pr())); return 6 - *max(pair_.dispersed(), residualAlpha) - *pair_.continuous().thermo().kappa() + *max(interface_.dispersed(), residualAlpha) + *interface_.continuous().thermo().kappa() *Nu - /sqr(pair_.dispersed().d()); + /sqr(interface_.dispersed().d()); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/RanzMarshall/RanzMarshall.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/RanzMarshall/RanzMarshall.H index 77e27601ff..13eadde6ec 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/RanzMarshall/RanzMarshall.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/RanzMarshall/RanzMarshall.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -53,6 +53,12 @@ class RanzMarshall : public heatTransferModel { + // Private Data + + //- Interface + const dispersedPhaseInterface interface_; + + public: //- Runtime type information @@ -61,11 +67,11 @@ public: // Constructors - //- Construct from components + //- Construct from a dictionary and an interface RanzMarshall ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/constantNu/constantNuHeatTransfer.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/constantNu/constantNuHeatTransfer.C index 5fdceb826d..e6f15d52df 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/constantNu/constantNuHeatTransfer.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/constantNu/constantNuHeatTransfer.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2019-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "constantNuHeatTransfer.H" -#include "phasePair.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -49,10 +48,14 @@ namespace heatTransferModels Foam::heatTransferModels::constantNuHeatTransfer::constantNuHeatTransfer ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) : - heatTransferModel(dict, pair), + heatTransferModel(dict, interface), + interface_ + ( + interface.modelCast() + ), Nu_("Nu", dimless, dict) {} @@ -73,10 +76,10 @@ Foam::heatTransferModels::constantNuHeatTransfer::K { return 6.0 - *max(pair_.dispersed(), residualAlpha) - *pair_.continuous().thermo().kappa() + *max(interface_.dispersed(), residualAlpha) + *interface_.continuous().thermo().kappa() *Nu_ - /sqr(pair_.dispersed().d()); + /sqr(interface_.dispersed().d()); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/constantNu/constantNuHeatTransfer.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/constantNu/constantNuHeatTransfer.H index 2f43d9114a..206c3f7e56 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/constantNu/constantNuHeatTransfer.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/constantNu/constantNuHeatTransfer.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2019-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -55,9 +55,13 @@ class constantNuHeatTransfer { // Private Data + //- Interface + const dispersedPhaseInterface interface_; + //- Nusselt number dimensionedScalar Nu_; + public: //- Runtime type information @@ -66,11 +70,11 @@ public: // Constructors - //- Construct from components + //- Construct from a dictionary and an interface constantNuHeatTransfer ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.C index 1891cb5dbe..ccbd44fd73 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,8 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "heatTransferModel.H" -#include "phasePair.H" -#include "BlendedInterfacialModel.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -33,6 +31,7 @@ namespace Foam { defineTypeNameAndDebug(heatTransferModel, 0); defineBlendedInterfacialModelTypeNameAndDebug(heatTransferModel, 0); + defineSidedInterfacialModelTypeNameAndDebug(blendedHeatTransferModel, 0); defineRunTimeSelectionTable(heatTransferModel, dictionary); } @@ -44,10 +43,9 @@ const Foam::dimensionSet Foam::heatTransferModel::dimK(1, -1, -3, -1, 0); Foam::heatTransferModel::heatTransferModel ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) : - pair_(pair), residualAlpha_ ( "residualAlpha", @@ -55,9 +53,11 @@ Foam::heatTransferModel::heatTransferModel dict.lookupOrDefault ( "residualAlpha", - pair_.ordered() - ? pair_.dispersed().residualAlpha().value() - : pair_.phase1().residualAlpha().value() + sqrt + ( + interface.phase1().residualAlpha().value() + *interface.phase2().residualAlpha().value() + ) ) ) {} @@ -78,4 +78,23 @@ Foam::heatTransferModel::K() const } +Foam::tmp Foam::blendedHeatTransferModel::K() const +{ + tmp (heatTransferModel::*k)() const = + &heatTransferModel::K; + return evaluate(k, "K", heatTransferModel::dimK, false); +} + + +Foam::tmp Foam::blendedHeatTransferModel::K +( + const scalar residualAlpha +) const +{ + tmp (heatTransferModel::*k)(const scalar) const = + &heatTransferModel::K; + return evaluate(k, "Kf", heatTransferModel::dimK, false, residualAlpha); +} + + // ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.H index 16c4e0f2a8..8b130b390e 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,6 +25,7 @@ Class Foam::heatTransferModel Description + Model for heat transfer between phases SourceFiles heatTransferModel.C @@ -39,12 +40,12 @@ SourceFiles #include "volFields.H" #include "dictionary.H" #include "runTimeSelectionTables.H" +#include "BlendedInterfacialModel.H" +#include "SidedInterfacialModel.H" namespace Foam { -class phasePair; - /*---------------------------------------------------------------------------*\ Class heatTransferModel Declaration \*---------------------------------------------------------------------------*/ @@ -55,9 +56,6 @@ protected: // Protected data - //- Phase pair - const phasePair& pair_; - //- Residual phase fraction const dimensionedScalar residualAlpha_; @@ -77,9 +75,9 @@ public: dictionary, ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ), - (dict, pair) + (dict, interface) ); @@ -88,14 +86,17 @@ public: //- Coefficient dimensions static const dimensionSet dimK; + //- Does this model require correcting on fixed flux boundaries? + static const bool correctFixedFluxBCs = false; + // Constructors - //- Construct froma dictionary and a phase pair + //- Construct from a dictionary and an interface heatTransferModel ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ); @@ -108,7 +109,8 @@ public: static autoPtr New ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface, + const bool outer=true ); @@ -127,6 +129,71 @@ public: }; +/*---------------------------------------------------------------------------*\ + Class blendedHeatTransferModel Declaration +\*---------------------------------------------------------------------------*/ + +class blendedHeatTransferModel +: + public BlendedInterfacialModel +{ +public: + + // Constructors + + //- Inherit base class constructors + using + BlendedInterfacialModel:: + BlendedInterfacialModel; + + + // Selectors + + static autoPtr New + ( + const dictionary& dict, + const phaseInterface& interface + ); + + + // Member Functions + + //- Return the heatTransfer coefficient K + tmp K() const; + + //- Return the heatTransfer coefficient K + tmp K(const scalar residualAlpha) const; +}; + + +/*---------------------------------------------------------------------------*\ + Class sidedBlendedHeatTransferModel Declaration +\*---------------------------------------------------------------------------*/ + +class sidedBlendedHeatTransferModel +: + public SidedInterfacialModel +{ +public: + + // Constructors + + //- Inherit base class constructors + using + SidedInterfacialModel:: + SidedInterfacialModel; + + + // Selectors + + static autoPtr New + ( + const dictionary& dict, + const phaseInterface& interface + ); +}; + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModelNew.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModelNew.C index fcfae2919b..75c8739c79 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModelNew.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,20 +24,24 @@ License \*---------------------------------------------------------------------------*/ #include "heatTransferModel.H" -#include "phasePair.H" +#include "phaseSystem.H" // * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * // Foam::autoPtr Foam::heatTransferModel::New ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface, + const bool outer ) { - word heatTransferModelType(dict.lookup("type")); + const dictionary& modelDict = + outer ? interface.fluid().modelSubDict(dict) : dict; + + const word heatTransferModelType(modelDict.lookup("type")); Info<< "Selecting heatTransferModel for " - << pair << ": " << heatTransferModelType << endl; + << interface.name() << ": " << heatTransferModelType << endl; dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(heatTransferModelType); @@ -52,7 +56,35 @@ Foam::autoPtr Foam::heatTransferModel::New << exit(FatalError); } - return cstrIter()(dict, pair); + return cstrIter()(modelDict, interface); +} + + +Foam::autoPtr +Foam::blendedHeatTransferModel::New +( + const dictionary& dict, + const phaseInterface& interface +) +{ + return autoPtr + ( + new blendedHeatTransferModel(dict, interface) + ); +} + + +Foam::autoPtr +Foam::sidedBlendedHeatTransferModel::New +( + const dictionary& dict, + const phaseInterface& interface +) +{ + return autoPtr + ( + new sidedBlendedHeatTransferModel(dict, interface) + ); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/sphericalHeatTransfer/sphericalHeatTransfer.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/sphericalHeatTransfer/sphericalHeatTransfer.C index 10766dfea8..0d2e2aaa3e 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/sphericalHeatTransfer/sphericalHeatTransfer.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/sphericalHeatTransfer/sphericalHeatTransfer.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "sphericalHeatTransfer.H" -#include "phasePair.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -49,10 +48,14 @@ namespace heatTransferModels Foam::heatTransferModels::sphericalHeatTransfer::sphericalHeatTransfer ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) : - heatTransferModel(dict, pair) + heatTransferModel(dict, interface), + interface_ + ( + interface.modelCast() + ) {} @@ -72,9 +75,9 @@ Foam::heatTransferModels::sphericalHeatTransfer::K { return 60.0 - *max(pair_.dispersed(), residualAlpha) - *pair_.dispersed().thermo().kappa() - /sqr(pair_.dispersed().d()); + *max(interface_.dispersed(), residualAlpha) + *interface_.dispersed().thermo().kappa() + /sqr(interface_.dispersed().d()); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/sphericalHeatTransfer/sphericalHeatTransfer.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/sphericalHeatTransfer/sphericalHeatTransfer.H index 9fbffc6a53..699ed4dfd2 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/sphericalHeatTransfer/sphericalHeatTransfer.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/sphericalHeatTransfer/sphericalHeatTransfer.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -53,6 +53,12 @@ class sphericalHeatTransfer : public heatTransferModel { + // Private Data + + //- Interface + const dispersedPhaseInterface interface_; + + public: //- Runtime type information @@ -61,11 +67,11 @@ public: // Constructors - //- Construct from components + //- Construct from a dictionary and an interface sphericalHeatTransfer ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/timeScaleFilteredHeatTransfer/timeScaleFilteredHeatTransfer.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/timeScaleFilteredHeatTransfer/timeScaleFilteredHeatTransfer.C index c00d5a3bd7..2569ca6d9d 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/timeScaleFilteredHeatTransfer/timeScaleFilteredHeatTransfer.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/timeScaleFilteredHeatTransfer/timeScaleFilteredHeatTransfer.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2019-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "timeScaleFilteredHeatTransfer.H" -#include "phasePair.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -50,13 +49,22 @@ Foam::heatTransferModels::timeScaleFilteredHeatTransfer:: timeScaleFilteredHeatTransfer ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) : - heatTransferModel(dict.subDict("heatTransferModel"), pair), + heatTransferModel(dict.subDict("heatTransferModel"), interface), + interface_ + ( + interface.modelCast() + ), heatTransferModel_ ( - heatTransferModel::New(dict.subDict("heatTransferModel"), pair) + heatTransferModel::New + ( + dict.subDict("heatTransferModel"), + interface, + false + ) ), minRelaxTime_("minRelaxTime", dimTime, dict) {} @@ -79,9 +87,9 @@ Foam::heatTransferModels::timeScaleFilteredHeatTransfer::K { const volScalarField limit ( - max(pair_.dispersed(), residualAlpha) - *pair_.dispersed().thermo().Cp() - *pair_.dispersed().rho() + max(interface_.dispersed(), residualAlpha) + *interface_.dispersed().thermo().Cp() + *interface_.dispersed().rho() /minRelaxTime_ ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/timeScaleFilteredHeatTransfer/timeScaleFilteredHeatTransfer.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/timeScaleFilteredHeatTransfer/timeScaleFilteredHeatTransfer.H index 7e1afb559d..b51dd77338 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/timeScaleFilteredHeatTransfer/timeScaleFilteredHeatTransfer.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/timeScaleFilteredHeatTransfer/timeScaleFilteredHeatTransfer.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2019-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -57,6 +57,9 @@ class timeScaleFilteredHeatTransfer { // Private Data + //- Interface + const dispersedPhaseInterface interface_; + //- Pointer to the underlying heat transfer model autoPtr heatTransferModel_; @@ -72,11 +75,11 @@ public: // Constructors - //- Construct from components + //- Construct from a dictionary and an interface timeScaleFilteredHeatTransfer ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/LegendreMagnaudet/LegendreMagnaudet.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/LegendreMagnaudet/LegendreMagnaudet.C index 9a96cb0d5a..df030f7739 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/LegendreMagnaudet/LegendreMagnaudet.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/LegendreMagnaudet/LegendreMagnaudet.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "LegendreMagnaudet.H" -#include "phasePair.H" #include "fvcGrad.H" #include "addToRunTimeSelectionTable.H" @@ -45,10 +44,10 @@ namespace liftModels Foam::liftModels::LegendreMagnaudet::LegendreMagnaudet ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) : - liftModel(dict, pair), + dispersedLiftModel(dict, interface), residualRe_("residualRe", dimless, dict) {} @@ -63,19 +62,19 @@ Foam::liftModels::LegendreMagnaudet::~LegendreMagnaudet() Foam::tmp Foam::liftModels::LegendreMagnaudet::Cl() const { - volScalarField Re(max(pair_.Re(), residualRe_)); + const volScalarField Re(max(interface_.Re(), residualRe_)); - volScalarField Sr + const volScalarField Sr ( - sqr(pair_.dispersed().d()) + sqr(interface_.dispersed().d()) /( Re - *pair_.continuous().thermo().nu() + *interface_.continuous().thermo().nu() ) - *mag(fvc::grad(pair_.continuous().U())) + *mag(fvc::grad(interface_.continuous().U())) ); - volScalarField ClLowSqr + const volScalarField ClLowSqr ( sqr(6*2.255) *sqr(Sr) @@ -86,7 +85,7 @@ Foam::tmp Foam::liftModels::LegendreMagnaudet::Cl() const ) ); - volScalarField ClHighSqr + const volScalarField ClHighSqr ( sqr(0.5*(Re + 16)/(Re + 29)) ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/LegendreMagnaudet/LegendreMagnaudet.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/LegendreMagnaudet/LegendreMagnaudet.H index fb8ba522fb..b2cfe28e85 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/LegendreMagnaudet/LegendreMagnaudet.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/LegendreMagnaudet/LegendreMagnaudet.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -49,15 +49,12 @@ SourceFiles #ifndef LegendreMagnaudet_H #define LegendreMagnaudet_H -#include "liftModel.H" +#include "dispersedLiftModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - -class phasePair; - namespace liftModels { @@ -67,7 +64,7 @@ namespace liftModels class LegendreMagnaudet : - public liftModel + public dispersedLiftModel { // Private Data @@ -83,11 +80,11 @@ public: // Constructors - //- Construct from a dictionary and a phase pair + //- Construct from a dictionary and an interface LegendreMagnaudet ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/Moraga/Moraga.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/Moraga/Moraga.C index dd7139021c..9073011a96 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/Moraga/Moraga.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/Moraga/Moraga.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "Moraga.H" -#include "phasePair.H" #include "fvcGrad.H" #include "addToRunTimeSelectionTable.H" @@ -45,10 +44,10 @@ namespace liftModels Foam::liftModels::Moraga::Moraga ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) : - liftModel(dict, pair) + dispersedLiftModel(dict, interface) {} @@ -62,13 +61,13 @@ Foam::liftModels::Moraga::~Moraga() Foam::tmp Foam::liftModels::Moraga::Cl() const { - volScalarField Re(pair_.Re()); + volScalarField Re(interface_.Re()); volScalarField sqrSr ( - sqr(pair_.dispersed().d()) - /pair_.continuous().thermo().nu() - *mag(fvc::grad(pair_.continuous().U())) + sqr(interface_.dispersed().d()) + /interface_.continuous().thermo().nu() + *mag(fvc::grad(interface_.continuous().U())) ); if diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/Moraga/Moraga.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/Moraga/Moraga.H index 6e220b9c95..e0dea490d4 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/Moraga/Moraga.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/Moraga/Moraga.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -49,15 +49,12 @@ SourceFiles #ifndef Moraga_H #define Moraga_H -#include "liftModel.H" +#include "dispersedLiftModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - -class phasePair; - namespace liftModels { @@ -67,7 +64,7 @@ namespace liftModels class Moraga : - public liftModel + public dispersedLiftModel { public: @@ -77,11 +74,11 @@ public: // Constructors - //- Construct from a dictionary and a phase pair + //- Construct from a dictionary and an interface Moraga ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/TomiyamaLift/TomiyamaLift.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/TomiyamaLift/TomiyamaLift.C index 0630d23358..f591f33cbd 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/TomiyamaLift/TomiyamaLift.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/TomiyamaLift/TomiyamaLift.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "TomiyamaLift.H" -#include "phasePair.H" #include "aspectRatioModel.H" #include "addToRunTimeSelectionTable.H" @@ -45,11 +44,11 @@ namespace liftModels Foam::liftModels::TomiyamaLift::TomiyamaLift ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) : - liftModel(dict, pair), - aspectRatio_(aspectRatioModel::New(dict.subDict("aspectRatio"), pair)) + dispersedLiftModel(dict, interface), + aspectRatio_(aspectRatioModel::New(dict.subDict("aspectRatio"), interface)) {} @@ -65,7 +64,7 @@ Foam::tmp Foam::liftModels::TomiyamaLift::Cl() const { const volScalarField EoH ( - pair_.Eo(pair_.dispersed().d()/cbrt(aspectRatio_->E())) + interface_.Eo(interface_.dispersed().d()/cbrt(aspectRatio_->E())) ); const volScalarField f @@ -74,7 +73,7 @@ Foam::tmp Foam::liftModels::TomiyamaLift::Cl() const ); return - neg(EoH - 4)*min(0.288*tanh(0.121*pair_.Re()), f) + neg(EoH - 4)*min(0.288*tanh(0.121*interface_.Re()), f) + pos0(EoH - 4)*neg(EoH - 10.7)*f + pos0(EoH - 10.7)*(-0.288); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/TomiyamaLift/TomiyamaLift.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/TomiyamaLift/TomiyamaLift.H index 9d0a71019a..c69385d7f1 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/TomiyamaLift/TomiyamaLift.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/TomiyamaLift/TomiyamaLift.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -46,14 +46,13 @@ SourceFiles #ifndef TomiyamaLift_H #define TomiyamaLift_H -#include "liftModel.H" +#include "dispersedLiftModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { -class phasePair; class aspectRatioModel; namespace liftModels @@ -65,7 +64,7 @@ namespace liftModels class TomiyamaLift : - public liftModel + public dispersedLiftModel { private: @@ -83,11 +82,11 @@ public: // Constructors - //- Construct from a dictionary and a phase pair + //- Construct from a dictionary and an interface TomiyamaLift ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/constantLiftCoefficient/constantLiftCoefficient.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/constantLiftCoefficient/constantLiftCoefficient.C index 4f3612f964..5d7764cfbc 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/constantLiftCoefficient/constantLiftCoefficient.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/constantLiftCoefficient/constantLiftCoefficient.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "constantLiftCoefficient.H" -#include "phasePair.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -44,10 +43,10 @@ namespace liftModels Foam::liftModels::constantLiftCoefficient::constantLiftCoefficient ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) : - liftModel(dict, pair), + dispersedLiftModel(dict, interface), Cl_("Cl", dimless, dict) {} @@ -63,12 +62,10 @@ Foam::liftModels::constantLiftCoefficient::~constantLiftCoefficient() Foam::tmp Foam::liftModels::constantLiftCoefficient::Cl() const { - const fvMesh& mesh(this->pair_.phase1().mesh()); - return volScalarField::New ( "zero", - mesh, + interface_.mesh(), Cl_ ); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/constantLiftCoefficient/constantLiftCoefficient.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/constantLiftCoefficient/constantLiftCoefficient.H index 5d51203566..6541d6ac4c 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/constantLiftCoefficient/constantLiftCoefficient.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/constantLiftCoefficient/constantLiftCoefficient.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -35,15 +35,12 @@ SourceFiles #ifndef constantLiftCoefficient_H #define constantLiftCoefficient_H -#include "liftModel.H" +#include "dispersedLiftModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - -class phasePair; - namespace liftModels { @@ -53,7 +50,7 @@ namespace liftModels class constantLiftCoefficient : - public liftModel + public dispersedLiftModel { // Private Data @@ -69,11 +66,11 @@ public: // Constructors - //- Construct from a dictionary and a phase pair + //- Construct from a dictionary and an interface constantLiftCoefficient ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/dispersedLiftModel/dispersedLiftModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/dispersedLiftModel/dispersedLiftModel.C new file mode 100644 index 0000000000..3e98d9774d --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/dispersedLiftModel/dispersedLiftModel.C @@ -0,0 +1,76 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "dispersedLiftModel.H" +#include "fvcCurl.H" +#include "fvcFlux.H" +#include "surfaceInterpolate.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::liftModels::dispersedLiftModel::dispersedLiftModel +( + const dictionary& dict, + const phaseInterface& interface +) +: + liftModel(dict, interface), + interface_(interface.modelCast()) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::liftModels::dispersedLiftModel::~dispersedLiftModel() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp Foam::liftModels::dispersedLiftModel::Fi() const +{ + return + Cl() + *interface_.continuous().rho() + *( + interface_.Ur() ^ fvc::curl(interface_.continuous().U()) + ); +} + + +Foam::tmp Foam::liftModels::dispersedLiftModel::F() const +{ + return interface_.dispersed()*Fi(); +} + + +Foam::tmp +Foam::liftModels::dispersedLiftModel::Ff() const +{ + return fvc::interpolate(interface_.dispersed())*fvc::flux(Fi()); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/dispersedLiftModel/dispersedLiftModel.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/dispersedLiftModel/dispersedLiftModel.H new file mode 100644 index 0000000000..c47f03f48d --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/dispersedLiftModel/dispersedLiftModel.H @@ -0,0 +1,107 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::dispersedLiftModel + +Description + Model for lift between two phases where one phase can be considered + dispersed in the other and the lift therefore characterised by a lift + coefficient + +SourceFiles + dispersedLiftModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef dispersedLiftModel_H +#define dispersedLiftModel_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "liftModel.H" +#include "dispersedPhaseInterface.H" + +namespace Foam +{ +namespace liftModels +{ + +/*---------------------------------------------------------------------------*\ + Class dispersedLiftModel Declaration +\*---------------------------------------------------------------------------*/ + +class dispersedLiftModel +: + public liftModel +{ +protected: + + // Protected data + + //- Interface + const dispersedPhaseInterface interface_; + + +public: + + // Constructors + + // Construct from a dictionary and an interface + dispersedLiftModel + ( + const dictionary& dict, + const phaseInterface& interface + ); + + + //- Destructor + virtual ~dispersedLiftModel(); + + + // Member Functions + + //- Lift coefficient + virtual tmp Cl() const = 0; + + //- Return phase-intensive lift force + virtual tmp Fi() const; + + //- Return lift force + virtual tmp F() const; + + //- Return face lift force + virtual tmp Ff() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace dragModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/liftModel/liftModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/liftModel/liftModel.C index 1fbfe49e89..4d7a38c648 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/liftModel/liftModel.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/liftModel/liftModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,11 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "liftModel.H" -#include "phasePair.H" -#include "fvcCurl.H" -#include "fvcFlux.H" -#include "surfaceInterpolate.H" -#include "BlendedInterfacialModel.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -47,10 +42,8 @@ const Foam::dimensionSet Foam::liftModel::dimF(1, -2, -2, 0, 0); Foam::liftModel::liftModel ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) -: - pair_(pair) {} @@ -62,26 +55,15 @@ Foam::liftModel::~liftModel() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -Foam::tmp Foam::liftModel::Fi() const +Foam::tmp Foam::blendedLiftModel::F() const { - return - Cl() - *pair_.continuous().rho() - *( - pair_.Ur() ^ fvc::curl(pair_.continuous().U()) - ); + return evaluate(&liftModel::F, "F", liftModel::dimF, true); } -Foam::tmp Foam::liftModel::F() const +Foam::tmp Foam::blendedLiftModel::Ff() const { - return pair_.dispersed()*Fi(); -} - - -Foam::tmp Foam::liftModel::Ff() const -{ - return fvc::interpolate(pair_.dispersed())*fvc::flux(Fi()); + return evaluate(&liftModel::Ff, "Ff", liftModel::dimF*dimArea, true); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/liftModel/liftModel.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/liftModel/liftModel.H index 9da42cb534..1459efef5f 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/liftModel/liftModel.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/liftModel/liftModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,6 +25,7 @@ Class Foam::liftModel Description + Model for the lift force between two phases SourceFiles liftModel.C @@ -40,26 +41,17 @@ SourceFiles #include "volFields.H" #include "dictionary.H" #include "runTimeSelectionTables.H" +#include "BlendedInterfacialModel.H" namespace Foam { -class phasePair; - /*---------------------------------------------------------------------------*\ Class liftModel Declaration \*---------------------------------------------------------------------------*/ class liftModel { -protected: - - // Protected data - - //- Phase pair - const phasePair& pair_; - - public: //- Runtime type information @@ -75,9 +67,9 @@ public: dictionary, ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ), - (dict, pair) + (dict, interface) ); @@ -86,14 +78,17 @@ public: //- Force dimensions static const dimensionSet dimF; + //- Does this model require correcting on fixed flux boundaries? + static const bool correctFixedFluxBCs = true; + // Constructors - //- Construct from a dictionary and a phase pair + //- Construct from a dictionary and an interface liftModel ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ); @@ -106,26 +101,57 @@ public: static autoPtr New ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface, + const bool outer=true ); // Member Functions - //- Return lift coefficient - virtual tmp Cl() const = 0; - - //- Return phase-intensive lift force - virtual tmp Fi() const; - //- Return lift force - virtual tmp F() const; + virtual tmp F() const = 0; //- Return face lift force - virtual tmp Ff() const; + virtual tmp Ff() const = 0; }; +/*---------------------------------------------------------------------------*\ + Class blendedLiftModel Declaration +\*---------------------------------------------------------------------------*/ + +class blendedLiftModel +: + public BlendedInterfacialModel +{ +public: + + // Constructors + + //- Inherit base class constructors + using BlendedInterfacialModel::BlendedInterfacialModel; + + + // Selectors + + static autoPtr New + ( + const dictionary& dict, + const phaseInterface& interface + ); + + + // Member Functions + + //- Return lift force + tmp F() const; + + //- Return face lift force + tmp Ff() const; +}; + + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/liftModel/liftModelNew.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/liftModel/liftModelNew.C index 5f4018bff1..543a7614c8 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/liftModel/liftModelNew.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/liftModel/liftModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,20 +24,24 @@ License \*---------------------------------------------------------------------------*/ #include "liftModel.H" -#include "phasePair.H" +#include "phaseSystem.H" // * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * // Foam::autoPtr Foam::liftModel::New ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface, + const bool outer ) { - word liftModelType(dict.lookup("type")); + const dictionary& modelDict = + outer ? interface.fluid().modelSubDict(dict) : dict; + + const word liftModelType(modelDict.lookup("type")); Info<< "Selecting liftModel for " - << pair << ": " << liftModelType << endl; + << interface.name() << ": " << liftModelType << endl; dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(liftModelType); @@ -52,7 +56,17 @@ Foam::autoPtr Foam::liftModel::New << exit(FatalError); } - return cstrIter()(dict, pair); + return cstrIter()(modelDict, interface); +} + + +Foam::autoPtr Foam::blendedLiftModel::New +( + const dictionary& dict, + const phaseInterface& interface +) +{ + return autoPtr(new blendedLiftModel(dict, interface)); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/noLift/noLift.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/noLift/noLift.C index c23f5207a3..1f99fdc05f 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/noLift/noLift.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/noLift/noLift.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "noLift.H" -#include "phasePair.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -44,10 +43,11 @@ namespace liftModels Foam::liftModels::noLift::noLift ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) : - liftModel(dict, pair) + liftModel(dict, interface), + interface_(interface) {} @@ -59,27 +59,12 @@ Foam::liftModels::noLift::~noLift() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -Foam::tmp Foam::liftModels::noLift::Cl() const -{ - const fvMesh& mesh(this->pair_.phase1().mesh()); - - return volScalarField::New - ( - "Cl", - mesh, - dimensionedScalar(dimless, 0) - ); -} - - Foam::tmp Foam::liftModels::noLift::F() const { - const fvMesh& mesh(this->pair_.phase1().mesh()); - return volVectorField::New ( - "noLift:F", - mesh, + "F", + interface_.mesh(), dimensionedVector(dimF, Zero) ); } @@ -87,12 +72,10 @@ Foam::tmp Foam::liftModels::noLift::F() const Foam::tmp Foam::liftModels::noLift::Ff() const { - const fvMesh& mesh(this->pair_.phase1().mesh()); - return surfaceScalarField::New ( - "noLift:Ff", - mesh, + "Ff", + interface_.mesh(), dimensionedScalar(dimF*dimArea, 0) ); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/noLift/noLift.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/noLift/noLift.H index 00f9722497..89cf703228 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/noLift/noLift.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/noLift/noLift.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -40,9 +40,6 @@ SourceFiles namespace Foam { - -class phasePair; - namespace liftModels { @@ -54,6 +51,14 @@ class noLift : public liftModel { +protected: + + // Protected data + + //- Interface + const phaseInterface interface_; + + public: //- Runtime type information @@ -62,11 +67,11 @@ public: // Constructors - //- Construct from a dictionary and a phase pair + //- Construct from a dictionary and an interface noLift ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ); @@ -76,13 +81,10 @@ public: // Member Functions - //- Lift coefficient - virtual tmp Cl() const; - - //- Lift force + //- Return lift force virtual tmp F() const; - //- Lift force on faces + //- Return face lift force virtual tmp Ff() const; }; diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/wallDampedLift/wallDampedLift.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/wallDampedLift/wallDampedLift.C index 20a53e31cf..46ca6f4d0e 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/wallDampedLift/wallDampedLift.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/wallDampedLift/wallDampedLift.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "wallDampedLift.H" -#include "phasePair.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -44,16 +43,24 @@ namespace liftModels Foam::liftModels::wallDamped::wallDamped ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) : - liftModel(dict, pair), - liftModel_(liftModel::New(dict.subDict("lift"), pair)), + dispersedLiftModel(dict, interface), + liftModel_(liftModel::New(dict.subDict("lift"), interface, false)), wallDampingModel_ ( - wallDampingModel::New(dict.subDict("wallDamping"), pair) + wallDampingModel::New(dict.subDict("wallDamping"), interface) ) -{} +{ + if (!isA(liftModel_())) + { + FatalErrorInFunction + << "The sub-lift-model of a " << type() + << " lift model must be for a dispersed configuration" + << exit(FatalError); + } +} // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // @@ -66,13 +73,17 @@ Foam::liftModels::wallDamped::~wallDamped() Foam::tmp Foam::liftModels::wallDamped::Cl() const { - return wallDampingModel_->damping()*liftModel_->Cl(); + return + wallDampingModel_->damping() + *refCast(liftModel_()).Cl(); } Foam::tmp Foam::liftModels::wallDamped::Fi() const { - return wallDampingModel_->damping()*liftModel_->Fi(); + return + wallDampingModel_->damping() + *refCast(liftModel_()).Fi(); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/wallDampedLift/wallDampedLift.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/wallDampedLift/wallDampedLift.H index 7d5c67b7f4..07a93eb7a1 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/wallDampedLift/wallDampedLift.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/liftModels/wallDampedLift/wallDampedLift.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -34,16 +34,13 @@ SourceFiles #ifndef wallDampedLift_H #define wallDampedLift_H -#include "liftModel.H" +#include "dispersedLiftModel.H" #include "wallDampingModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - -class phasePair; - namespace liftModels { @@ -53,7 +50,7 @@ namespace liftModels class wallDamped : - public liftModel + public dispersedLiftModel { // Private Data @@ -72,11 +69,11 @@ public: // Constructors - //- Construct from a dictionary and a phase pair + //- Construct from a dictionary and an interface wallDamped ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ); @@ -86,7 +83,7 @@ public: // Member Functions - //- Return lift coefficient + //- Lift coefficient virtual tmp Cl() const; //- Return phase-intensive lift force diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/phaseTransferModels/deposition/deposition.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/phaseTransferModels/deposition/deposition.C index 146a57c9d2..52f441b4f0 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/phaseTransferModels/deposition/deposition.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/phaseTransferModels/deposition/deposition.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2018-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2018-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "deposition.H" -#include "phasePair.H" #include "phaseSystem.H" #include "addToRunTimeSelectionTable.H" @@ -45,10 +44,11 @@ namespace phaseTransferModels Foam::phaseTransferModels::deposition::deposition ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) : - phaseTransferModel(dict, pair), + phaseTransferModel(dict, interface), + interface_(interface), dropletName_(dict.lookup("droplet")), surfaceName_(dict.lookup("surface")), efficiency_(dict.lookup("efficiency")) @@ -74,21 +74,21 @@ Foam::phaseTransferModels::deposition::dmdtf() const { const phaseModel* dropletPtr = nullptr; scalar sign = 1; - if (dropletName_ == pair_.first()) + if (dropletName_ == interface_.phase1().name()) { - dropletPtr = &pair_.phase1(); + dropletPtr = &interface_.phase1(); sign = -1; } - else if (dropletName_ == pair_.second()) + else if (dropletName_ == interface_.phase2().name()) { - dropletPtr = &pair_.phase2(); + dropletPtr = &interface_.phase2(); sign = 1; } else { FatalErrorInFunction << "The specified droplet phase, " << dropletName_ << ", is not in " - << "the " << pair_ << " pair" + << "the " << interface_ << " pair" << exit(FatalError); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/phaseTransferModels/deposition/deposition.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/phaseTransferModels/deposition/deposition.H index d0cb2b811d..3cf5d16130 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/phaseTransferModels/deposition/deposition.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/phaseTransferModels/deposition/deposition.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2018-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2018-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -42,9 +42,6 @@ SourceFiles namespace Foam { - -class phasePair; - namespace phaseTransferModels { @@ -60,6 +57,9 @@ private: // Private Data + //- Interface + const phaseInterface interface_; + //- The name of the phase which deposits const word dropletName_; @@ -78,11 +78,11 @@ public: // Constructors - //- Construct from components + //- Construct from a dictionary and an interface deposition ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/phaseTransferModels/phaseTransferModel/phaseTransferModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/phaseTransferModels/phaseTransferModel/phaseTransferModel.C index 7e8e35b0cc..e4de173ee4 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/phaseTransferModels/phaseTransferModel/phaseTransferModel.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/phaseTransferModels/phaseTransferModel/phaseTransferModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2018-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2018-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,8 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "phaseTransferModel.H" -#include "phasePair.H" -#include "BlendedInterfacialModel.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -47,19 +45,18 @@ const Foam::hashedWordList Foam::phaseTransferModel::noSpecies_ = Foam::phaseTransferModel::phaseTransferModel ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) : regIOobject ( IOobject ( - IOobject::groupName(typeName, pair.name()), - pair.phase1().mesh().time().timeName(), - pair.phase1().mesh() + IOobject::groupName(typeName, interface.name()), + interface.mesh().time().timeName(), + interface.mesh() ) - ), - pair_(pair) + ) {} @@ -102,4 +99,44 @@ bool Foam::phaseTransferModel::writeData(Ostream& os) const } +bool Foam::blendedPhaseTransferModel::mixture() const +{ + return evaluate(&phaseTransferModel::mixture); +} + + +Foam::tmp +Foam::blendedPhaseTransferModel::dmdtf() const +{ + return + evaluate + ( + &phaseTransferModel::dmdtf, + "dmdtf", + phaseTransferModel::dimDmdt, + true + ); +} + + +Foam::hashedWordList Foam::blendedPhaseTransferModel::species() const +{ + return evaluate(&phaseTransferModel::species); +} + + +Foam::HashPtrTable +Foam::blendedPhaseTransferModel::dmidtf() const +{ + return + evaluate + ( + &phaseTransferModel::dmidtf, + "dmidtf", + phaseTransferModel::dimDmdt, + true + ); +} + + // ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/phaseTransferModels/phaseTransferModel/phaseTransferModel.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/phaseTransferModels/phaseTransferModel/phaseTransferModel.H index c9cf38f40e..0f428db78c 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/phaseTransferModels/phaseTransferModel/phaseTransferModel.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/phaseTransferModels/phaseTransferModel/phaseTransferModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2018-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2018-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -41,11 +41,12 @@ SourceFiles #include "HashPtrTable.H" #include "hashedWordList.H" #include "runTimeSelectionTables.H" +#include "BlendedInterfacialModel.H" namespace Foam { -class phasePair; +class phaseSystem; /*---------------------------------------------------------------------------*\ Class phaseTransferModel Declaration @@ -55,14 +56,6 @@ class phaseTransferModel : public regIOobject { -protected: - - // Protected data - - //- Phase pair - const phasePair& pair_; - - public: //- Runtime type information @@ -78,9 +71,9 @@ public: dictionary, ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ), - (dict, pair) + (dict, interface) ); @@ -89,17 +82,20 @@ public: //- Mass transfer rate dimensions static const dimensionSet dimDmdt; + //- Does this model require correcting on fixed flux boundaries? + static const bool correctFixedFluxBCs = false; + //- Empty species list static const hashedWordList noSpecies_; // Constructors - //- Construct from a dictionary and a phase pair + //- Construct from a dictionary and an interface phaseTransferModel ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ); @@ -112,7 +108,7 @@ public: static autoPtr New ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ); @@ -135,6 +131,49 @@ public: }; +/*---------------------------------------------------------------------------*\ + Class blendedPhaseTransferModel Declaration +\*---------------------------------------------------------------------------*/ + +class blendedPhaseTransferModel +: + public BlendedInterfacialModel +{ +public: + + // Constructors + + //- Inherit base class constructors + using + BlendedInterfacialModel:: + BlendedInterfacialModel; + + + // Selectors + + static autoPtr New + ( + const dictionary& dict, + const phaseInterface& interface + ); + + + // Member Functions + + //- Whether or not there is a mass transfer rate for the mixture + bool mixture() const; + + //- The mass transfer rate for the mixture + tmp dmdtf() const; + + //- The list of individual species that are transferred + hashedWordList species() const; + + //- The mass transfer rate for individual species + HashPtrTable dmidtf() const; +}; + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/phaseTransferModels/phaseTransferModel/phaseTransferModelNew.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/phaseTransferModels/phaseTransferModel/phaseTransferModelNew.C index 167faff032..99d40b11f3 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/phaseTransferModels/phaseTransferModel/phaseTransferModelNew.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/phaseTransferModels/phaseTransferModel/phaseTransferModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2018-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2018-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,20 +24,22 @@ License \*---------------------------------------------------------------------------*/ #include "phaseTransferModel.H" -#include "phasePair.H" // * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * // Foam::autoPtr Foam::phaseTransferModel::New ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) { - word phaseTransferModelType(dict.lookup("type")); + const dictionary& modelDict = + interface.fluid().modelSubDict(dict); + + const word phaseTransferModelType(modelDict.lookup("type")); Info<< "Selecting phaseTransferModel for " - << pair << ": " << phaseTransferModelType << endl; + << interface.name() << ": " << phaseTransferModelType << endl; dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(phaseTransferModelType); @@ -52,7 +54,21 @@ Foam::autoPtr Foam::phaseTransferModel::New << exit(FatalError); } - return cstrIter()(dict, pair); + return cstrIter()(modelDict, interface); +} + + +Foam::autoPtr +Foam::blendedPhaseTransferModel::New +( + const dictionary& dict, + const phaseInterface& interface +) +{ + return autoPtr + ( + new blendedPhaseTransferModel(dict, interface) + ); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/phaseTransferModels/reactionDriven/reactionDriven.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/phaseTransferModels/reactionDriven/reactionDriven.C index 6258505c8c..6602b31305 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/phaseTransferModels/reactionDriven/reactionDriven.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/phaseTransferModels/reactionDriven/reactionDriven.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2019-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "reactionDriven.H" -#include "phasePair.H" #include "phaseSystem.H" #include "addToRunTimeSelectionTable.H" @@ -45,23 +44,20 @@ namespace phaseTransferModels Foam::phaseTransferModels::reactionDriven::reactionDriven ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) : - phaseTransferModel(dict, pair), + phaseTransferModel(dict, interface), + interface_(interface), reactingName_(dict.lookup("reactingPhase")), reactingPhase_ ( - reactingName_ == pair_.first() ? pair_.phase1() : pair_.phase2() - ), - otherPhase_ - ( - pair.otherPhase(reactingPhase_) - ), - sign_ - ( - reactingName_ == pair_.first() ? -1 : 1 + reactingName_ == interface_.phase1().name() + ? interface_.phase1() + : interface_.phase2() ), + otherPhase_(interface.otherPhase(reactingPhase_)), + sign_(reactingName_ == interface_.phase1().name() ? -1 : 1), species_(dict.lookup("species")) {} diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/phaseTransferModels/reactionDriven/reactionDriven.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/phaseTransferModels/reactionDriven/reactionDriven.H index 6121a51b75..4bbe5e274a 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/phaseTransferModels/reactionDriven/reactionDriven.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/phaseTransferModels/reactionDriven/reactionDriven.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2019-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -42,10 +42,6 @@ SourceFiles namespace Foam { - -class phasePair; -class phaseModel; - namespace phaseTransferModels { @@ -61,6 +57,9 @@ private: // Private Data + //- Interface + const phaseInterface interface_; + //- The name of the phase where the reactions occur const word reactingName_; @@ -85,11 +84,11 @@ public: // Constructors - //- Construct from components + //- Construct from a dictionary and an interface reactionDriven ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/swarmCorrections/TomiyamaSwarm/TomiyamaSwarm.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/swarmCorrections/TomiyamaSwarm/TomiyamaSwarm.C index dd35bb41d5..4b3f82c824 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/swarmCorrections/TomiyamaSwarm/TomiyamaSwarm.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/swarmCorrections/TomiyamaSwarm/TomiyamaSwarm.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "TomiyamaSwarm.H" -#include "phasePair.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -49,10 +48,10 @@ namespace swarmCorrections Foam::swarmCorrections::TomiyamaSwarm::TomiyamaSwarm ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) : - swarmCorrection(dict, pair), + swarmCorrection(dict, interface), residualAlpha_ ( "residualAlpha", @@ -60,7 +59,7 @@ Foam::swarmCorrections::TomiyamaSwarm::TomiyamaSwarm dict.lookupOrDefault ( "residualAlpha", - pair_.dispersed().residualAlpha().value() + interface_.dispersed().residualAlpha().value() ) ), l_("l", dimless, dict) @@ -78,7 +77,7 @@ Foam::swarmCorrections::TomiyamaSwarm::~TomiyamaSwarm() Foam::tmp Foam::swarmCorrections::TomiyamaSwarm::Cs() const { - return pow(max(this->pair_.continuous(), residualAlpha_), 3 - 2*l_); + return pow(max(interface_.continuous(), residualAlpha_), 3 - 2*l_); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/swarmCorrections/TomiyamaSwarm/TomiyamaSwarm.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/swarmCorrections/TomiyamaSwarm/TomiyamaSwarm.H index 6836629dff..f299f5519e 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/swarmCorrections/TomiyamaSwarm/TomiyamaSwarm.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/swarmCorrections/TomiyamaSwarm/TomiyamaSwarm.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -44,6 +44,7 @@ SourceFiles #define TomiyamaSwarm_H #include "swarmCorrection.H" +#include "dispersedPhaseInterface.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -77,11 +78,11 @@ public: // Constructors - //- Construct from a dictionary and a phase pair + //- Construct from a dictionary and an interface TomiyamaSwarm ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/swarmCorrections/noSwarm/noSwarm.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/swarmCorrections/noSwarm/noSwarm.C index 9473173d9f..2082820c25 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/swarmCorrections/noSwarm/noSwarm.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/swarmCorrections/noSwarm/noSwarm.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "noSwarm.H" -#include "phasePair.H" +#include "phaseSystem.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -44,10 +44,10 @@ namespace swarmCorrections Foam::swarmCorrections::noSwarm::noSwarm ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) : - swarmCorrection(dict, pair) + swarmCorrection(dict, interface) {} @@ -61,12 +61,10 @@ Foam::swarmCorrections::noSwarm::~noSwarm() Foam::tmp Foam::swarmCorrections::noSwarm::Cs() const { - const fvMesh& mesh(this->pair_.phase1().mesh()); - return volScalarField::New ( "Cs", - mesh, + interface_.mesh(), dimensionedScalar(dimless, 1) ); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/swarmCorrections/noSwarm/noSwarm.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/swarmCorrections/noSwarm/noSwarm.H index fe5239349f..5bcca21740 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/swarmCorrections/noSwarm/noSwarm.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/swarmCorrections/noSwarm/noSwarm.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,6 +25,7 @@ Class Foam::swarmCorrections::noSwarm Description + No swarm correction SourceFiles noSwarm.C @@ -35,14 +36,13 @@ SourceFiles #define noSwarm_H #include "swarmCorrection.H" +#include "phaseInterface.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { -class phasePair; - namespace swarmCorrections { @@ -62,11 +62,11 @@ public: // Constructors - //- Construct from a dictionary and a phase pair + //- Construct from a dictionary and an interface noSwarm ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/swarmCorrection.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/swarmCorrection.C index 6af08b3130..781ca57274 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/swarmCorrection.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/swarmCorrection.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "swarmCorrection.H" -#include "phasePair.H" +#include "phaseSystem.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -40,10 +40,10 @@ namespace Foam Foam::swarmCorrection::swarmCorrection ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) : - pair_(pair) + interface_(interface.modelCast()) {} diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/swarmCorrection.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/swarmCorrection.H index 0591a1b3ac..b723111d7a 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/swarmCorrection.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/swarmCorrection.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,6 +25,9 @@ Class Foam::swarmCorrection Description + Drag model modifier to take into account large fractions (swarms) of the + dispersed phase. Often not appropriate as these effects are a fundamental + part of the drag model formulation (e.g. Ergun). Use with care. SourceFiles swarmCorrection.C @@ -40,12 +43,11 @@ SourceFiles #include "volFields.H" #include "dictionary.H" #include "runTimeSelectionTables.H" +#include "dispersedPhaseInterface.H" namespace Foam { -class phasePair; - /*---------------------------------------------------------------------------*\ Class swarmCorrection Declaration \*---------------------------------------------------------------------------*/ @@ -56,8 +58,8 @@ protected: // Protected data - //- Phase pair - const phasePair& pair_; + //- Interface + const dispersedPhaseInterface interface_; public: @@ -74,19 +76,19 @@ public: dictionary, ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ), - (dict, pair) + (dict, interface) ); // Constructors - //- Construct from a dictionary and a phase pair + //- Construct from a dictionary and an interface swarmCorrection ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ); @@ -99,7 +101,7 @@ public: static autoPtr New ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/swarmCorrectionNew.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/swarmCorrectionNew.C index 6c2bb91305..316e84a9a7 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/swarmCorrectionNew.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/swarmCorrectionNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "swarmCorrection.H" -#include "phasePair.H" +#include "phaseSystem.H" // * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * // @@ -32,13 +32,13 @@ Foam::autoPtr Foam::swarmCorrection::New ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) { - word swarmCorrectionType(dict.lookup("type")); + const word swarmCorrectionType(dict.lookup("type")); Info<< "Selecting swarmCorrection for " - << pair << ": " << swarmCorrectionType << endl; + << interface.name() << ": " << swarmCorrectionType << endl; dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(swarmCorrectionType); @@ -53,7 +53,7 @@ Foam::swarmCorrection::New << exit(FatalError); } - return cstrIter()(dict, pair); + return cstrIter()(dict, interface); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/Burns/Burns.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/Burns/Burns.C index 1ddd67d10e..2ada6e77b5 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/Burns/Burns.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/Burns/Burns.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,11 +24,9 @@ License \*---------------------------------------------------------------------------*/ #include "Burns.H" -#include "phasePair.H" #include "phaseCompressibleMomentumTransportModel.H" #include "addToRunTimeSelectionTable.H" - -#include "dragModel.H" +#include "dispersedDragModel.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -52,10 +50,10 @@ namespace turbulentDispersionModels Foam::turbulentDispersionModels::Burns::Burns ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) : - turbulentDispersionModel(dict, pair), + dispersedTurbulentDispersionModel(dict, interface), sigma_("sigma", dimless, dict) {} @@ -71,22 +69,33 @@ Foam::turbulentDispersionModels::Burns::~Burns() Foam::tmp Foam::turbulentDispersionModels::Burns::D() const { - const fvMesh& mesh(pair_.phase1().mesh()); - const dragModel& drag = - mesh.lookupObject + const dragModels::dispersedDragModel& drag = + interface_.mesh().lookupObject ( - IOobject::groupName(dragModel::typeName, pair_.name()) + IOobject::groupName + ( + dragModel::typeName, + interface_.name() + ) ); return drag.Ki() *continuousTurbulence().nut() /sigma_ - *pair_.dispersed() - *sqr(pair_.dispersed() + pair_.continuous()) + *interface_.dispersed() + *sqr(interface_.dispersed() + interface_.continuous()) /( - max(pair_.dispersed(), pair_.dispersed().residualAlpha()) - *max(pair_.continuous(), pair_.continuous().residualAlpha()) + max + ( + interface_.dispersed(), + interface_.dispersed().residualAlpha() + ) + *max + ( + interface_.continuous(), + interface_.continuous().residualAlpha() + ) ); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/Burns/Burns.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/Burns/Burns.H index 2e6a4a026f..b30860ebf6 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/Burns/Burns.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/Burns/Burns.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -44,15 +44,12 @@ SourceFiles #ifndef Burns_H #define Burns_H -#include "turbulentDispersionModel.H" +#include "dispersedTurbulentDispersionModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - -class phasePair; - namespace turbulentDispersionModels { @@ -62,7 +59,7 @@ namespace turbulentDispersionModels class Burns : - public turbulentDispersionModel + public dispersedTurbulentDispersionModel { // Private Data @@ -78,11 +75,11 @@ public: // Constructors - //- Construct from a dictionary and a phase pair + //- Construct from a dictionary and an interface Burns ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/Gosman/Gosman.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/Gosman/Gosman.C index 569db6cac8..87b63dc5e7 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/Gosman/Gosman.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/Gosman/Gosman.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,10 +24,9 @@ License \*---------------------------------------------------------------------------*/ #include "Gosman.H" -#include "phasePair.H" #include "phaseCompressibleMomentumTransportModel.H" #include "addToRunTimeSelectionTable.H" -#include "dragModel.H" +#include "dispersedDragModel.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -51,10 +50,10 @@ namespace turbulentDispersionModels Foam::turbulentDispersionModels::Gosman::Gosman ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) : - turbulentDispersionModel(dict, pair), + dispersedTurbulentDispersionModel(dict, interface), sigma_("sigma", dimless, dict) {} @@ -70,13 +69,13 @@ Foam::turbulentDispersionModels::Gosman::~Gosman() Foam::tmp Foam::turbulentDispersionModels::Gosman::D() const { - const fvMesh& mesh(pair_.phase1().mesh()); - const dragModel& - drag + const dragModels::dispersedDragModel& drag = + interface_.mesh().lookupObject ( - mesh.lookupObject + IOobject::groupName ( - IOobject::groupName(dragModel::typeName, pair_.name()) + dragModel::typeName, + interface_.name() ) ); @@ -84,7 +83,7 @@ Foam::turbulentDispersionModels::Gosman::D() const drag.Ki() *continuousTurbulence().nut() /sigma_ - *pair_.dispersed(); + *interface_.dispersed(); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/Gosman/Gosman.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/Gosman/Gosman.H index 1c113eb48a..1a88be8099 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/Gosman/Gosman.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/Gosman/Gosman.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -44,15 +44,12 @@ SourceFiles #ifndef Gosman_H #define Gosman_H -#include "turbulentDispersionModel.H" +#include "dispersedTurbulentDispersionModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - -class phasePair; - namespace turbulentDispersionModels { @@ -62,7 +59,7 @@ namespace turbulentDispersionModels class Gosman : - public turbulentDispersionModel + public dispersedTurbulentDispersionModel { // Private Data @@ -78,11 +75,11 @@ public: // Constructors - //- Construct from a dictionary and a phase pair + //- Construct from a dictionary and an interface Gosman ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/LopezDeBertodano/LopezDeBertodano.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/LopezDeBertodano/LopezDeBertodano.C index eeb17ecada..8f02e0de34 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/LopezDeBertodano/LopezDeBertodano.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/LopezDeBertodano/LopezDeBertodano.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "LopezDeBertodano.H" -#include "phasePair.H" #include "phaseCompressibleMomentumTransportModel.H" #include "addToRunTimeSelectionTable.H" @@ -50,10 +49,10 @@ namespace turbulentDispersionModels Foam::turbulentDispersionModels::LopezDeBertodano::LopezDeBertodano ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) : - turbulentDispersionModel(dict, pair), + dispersedTurbulentDispersionModel(dict, interface), Ctd_("Ctd", dimless, dict) {} @@ -71,7 +70,7 @@ Foam::turbulentDispersionModels::LopezDeBertodano::D() const { return Ctd_ - *pair_.continuous().rho() + *interface_.continuous().rho() *continuousTurbulence().k(); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/LopezDeBertodano/LopezDeBertodano.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/LopezDeBertodano/LopezDeBertodano.H index f71df1012d..9d2e80fe24 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/LopezDeBertodano/LopezDeBertodano.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/LopezDeBertodano/LopezDeBertodano.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -41,15 +41,12 @@ SourceFiles #ifndef LopezDeBertodano_H #define LopezDeBertodano_H -#include "turbulentDispersionModel.H" +#include "dispersedTurbulentDispersionModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - -class phasePair; - namespace turbulentDispersionModels { @@ -59,7 +56,7 @@ namespace turbulentDispersionModels class LopezDeBertodano : - public turbulentDispersionModel + public dispersedTurbulentDispersionModel { // Private Data @@ -75,11 +72,11 @@ public: // Constructors - //- Construct from a dictionary and a phase pair + //- Construct from a dictionary and an interface LopezDeBertodano ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/constantTurbulentDispersionCoefficient/constantTurbulentDispersionCoefficient.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/constantTurbulentDispersionCoefficient/constantTurbulentDispersionCoefficient.C index f96e527b67..09dae1f3d4 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/constantTurbulentDispersionCoefficient/constantTurbulentDispersionCoefficient.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/constantTurbulentDispersionCoefficient/constantTurbulentDispersionCoefficient.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "constantTurbulentDispersionCoefficient.H" -#include "phasePair.H" #include "phaseCompressibleMomentumTransportModel.H" #include "addToRunTimeSelectionTable.H" @@ -51,10 +50,10 @@ Foam::turbulentDispersionModels::constantTurbulentDispersionCoefficient:: constantTurbulentDispersionCoefficient ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) : - turbulentDispersionModel(dict, pair), + dispersedTurbulentDispersionModel(dict, interface), Ctd_("Ctd", dimless, dict) {} @@ -74,8 +73,8 @@ D() const { return Ctd_ - *pair_.dispersed() - *pair_.continuous().rho() + *interface_.dispersed() + *interface_.continuous().rho() *continuousTurbulence().k(); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/constantTurbulentDispersionCoefficient/constantTurbulentDispersionCoefficient.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/constantTurbulentDispersionCoefficient/constantTurbulentDispersionCoefficient.H index 45c9d6d702..7d9704a3bc 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/constantTurbulentDispersionCoefficient/constantTurbulentDispersionCoefficient.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/constantTurbulentDispersionCoefficient/constantTurbulentDispersionCoefficient.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -35,15 +35,12 @@ SourceFiles #ifndef constantTurbulentDispersionCoefficient_H #define constantTurbulentDispersionCoefficient_H -#include "turbulentDispersionModel.H" +#include "dispersedTurbulentDispersionModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - -class phasePair; - namespace turbulentDispersionModels { @@ -53,7 +50,7 @@ namespace turbulentDispersionModels class constantTurbulentDispersionCoefficient : - public turbulentDispersionModel + public dispersedTurbulentDispersionModel { // Private Data @@ -69,11 +66,11 @@ public: // Constructors - //- Construct from a dictionary and a phase pair + //- Construct from a dictionary and an interface constantTurbulentDispersionCoefficient ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/dispersedTurbulentDispersionModel/dispersedTurbulentDispersionModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/dispersedTurbulentDispersionModel/dispersedTurbulentDispersionModel.C new file mode 100644 index 0000000000..7f8ef7ab07 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/dispersedTurbulentDispersionModel/dispersedTurbulentDispersionModel.C @@ -0,0 +1,73 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "dispersedTurbulentDispersionModel.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::turbulentDispersionModels::dispersedTurbulentDispersionModel:: +dispersedTurbulentDispersionModel +( + const dictionary& dict, + const phaseInterface& interface +) +: + turbulentDispersionModel(dict, interface), + interface_ + ( + interface.modelCast() + ) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::turbulentDispersionModels::dispersedTurbulentDispersionModel:: +~dispersedTurbulentDispersionModel() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +const Foam::phaseCompressible::momentumTransportModel& +Foam::turbulentDispersionModels::dispersedTurbulentDispersionModel:: +continuousTurbulence() const +{ + return + interface_.phase1().mesh().lookupObject + < + phaseCompressible::momentumTransportModel + > + ( + IOobject::groupName + ( + momentumTransportModel::typeName, + interface_.continuous().name() + ) + ); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/dispersedTurbulentDispersionModel/dispersedTurbulentDispersionModel.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/dispersedTurbulentDispersionModel/dispersedTurbulentDispersionModel.H new file mode 100644 index 0000000000..9c951c1e1b --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/dispersedTurbulentDispersionModel/dispersedTurbulentDispersionModel.H @@ -0,0 +1,99 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::dispersedTurbulentDispersionModel + +Description + Model for turbulent dispersion between two phases where one phase can be + considered dispersed in the other + +SourceFiles + dispersedTurbulentDispersionModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef dispersedTurbulentDispersionModel_H +#define dispersedTurbulentDispersionModel_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "turbulentDispersionModel.H" +#include "dispersedPhaseInterface.H" +#include "phaseCompressibleMomentumTransportModel.H" + +namespace Foam +{ +namespace turbulentDispersionModels +{ + +/*---------------------------------------------------------------------------*\ + Class dispersedTurbulentDispersionModel Declaration +\*---------------------------------------------------------------------------*/ + +class dispersedTurbulentDispersionModel +: + public turbulentDispersionModel +{ +protected: + + // Protected data + + //- Interface + const dispersedPhaseInterface interface_; + + +public: + + // Constructors + + // Construct from a dictionary and an interface + dispersedTurbulentDispersionModel + ( + const dictionary& dict, + const phaseInterface& interface + ); + + + //- Destructor + virtual ~dispersedTurbulentDispersionModel(); + + + // Member Functions + + //- Return a reference to the turbulence model for the continuous phase + const phaseCompressible::momentumTransportModel& + continuousTurbulence() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace dragModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/noTurbulentDispersion/noTurbulentDispersion.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/noTurbulentDispersion/noTurbulentDispersion.C index 622eda16bf..63914f6218 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/noTurbulentDispersion/noTurbulentDispersion.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/noTurbulentDispersion/noTurbulentDispersion.C @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "noTurbulentDispersion.H" -#include "phasePair.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -49,10 +48,11 @@ namespace turbulentDispersionModels Foam::turbulentDispersionModels::noTurbulentDispersion::noTurbulentDispersion ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) : - turbulentDispersionModel(dict, pair) + turbulentDispersionModel(dict, interface), + interface_(interface) {} @@ -68,12 +68,10 @@ Foam::turbulentDispersionModels::noTurbulentDispersion:: Foam::tmp Foam::turbulentDispersionModels::noTurbulentDispersion::D() const { - const fvMesh& mesh(this->pair_.phase1().mesh()); - return volScalarField::New ( - "zero", - mesh, + "D", + interface_.mesh(), dimensionedScalar(dimD, 0) ); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/noTurbulentDispersion/noTurbulentDispersion.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/noTurbulentDispersion/noTurbulentDispersion.H index e9b7a69052..326e261ab0 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/noTurbulentDispersion/noTurbulentDispersion.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/noTurbulentDispersion/noTurbulentDispersion.H @@ -40,9 +40,6 @@ SourceFiles namespace Foam { - -class phasePair; - namespace turbulentDispersionModels { @@ -54,6 +51,14 @@ class noTurbulentDispersion : public turbulentDispersionModel { +private: + + // Private data + + //- Interface + const phaseInterface interface_; + + public: //- Runtime type information @@ -62,11 +67,11 @@ public: // Constructors - //- Construct from a dictionary and a phase pair + //- Construct from a dictionary and an interface noTurbulentDispersion ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/turbulentDispersionModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/turbulentDispersionModel.C index 26589133e0..6b9a21b395 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/turbulentDispersionModel.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/turbulentDispersionModel.C @@ -24,9 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "turbulentDispersionModel.H" -#include "phasePair.H" #include "phaseCompressibleMomentumTransportModel.H" -#include "BlendedInterfacialModel.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -45,10 +43,8 @@ const Foam::dimensionSet Foam::turbulentDispersionModel::dimD(1, -1, -2, 0, 0); Foam::turbulentDispersionModel::turbulentDispersionModel ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) -: - pair_(pair) {} @@ -60,20 +56,15 @@ Foam::turbulentDispersionModel::~turbulentDispersionModel() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -const Foam::phaseCompressible::momentumTransportModel& -Foam::turbulentDispersionModel::continuousTurbulence() const +Foam::tmp Foam::blendedTurbulentDispersionModel::D() const { return - pair_.phase1().mesh().lookupObject - < - phaseCompressible::momentumTransportModel - > + evaluate ( - IOobject::groupName - ( - momentumTransportModel::typeName, - pair_.continuous().name() - ) + &turbulentDispersionModel::D, + "F", + turbulentDispersionModel::dimD, + true ); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/turbulentDispersionModel.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/turbulentDispersionModel.H index 6f3de5b1d1..3f4b0e4625 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/turbulentDispersionModel.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/turbulentDispersionModel.H @@ -25,6 +25,7 @@ Class Foam::turbulentDispersionModel Description + Model for turbulent dispersion between two phases SourceFiles turbulentDispersionModel.C @@ -38,29 +39,19 @@ SourceFiles #include "volFields.H" #include "dictionary.H" #include "runTimeSelectionTables.H" -#include "phaseCompressibleMomentumTransportModel.H" +#include "BlendedInterfacialModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { -class phasePair; - /*---------------------------------------------------------------------------*\ Class turbulentDispersionModel Declaration \*---------------------------------------------------------------------------*/ class turbulentDispersionModel { -protected: - - // Protected data - - //- Phase pair - const phasePair& pair_; - - public: //- Runtime type information @@ -76,9 +67,9 @@ public: dictionary, ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ), - (dict, pair) + (dict, interface) ); // Static Data Members @@ -86,14 +77,17 @@ public: //- Diffusivity dimensions static const dimensionSet dimD; + //- Does this model require correcting on fixed flux boundaries? + static const bool correctFixedFluxBCs = true; + // Constructors - //- Construct from a dictionary and a phase pair + //- Construct from a dictionary and an interface turbulentDispersionModel ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ); @@ -106,22 +100,54 @@ public: static autoPtr New ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface, + const bool outer=true ); // Member Functions - //- Return a reference to the turbulence model for the continuous phase - const phaseCompressible::momentumTransportModel& - continuousTurbulence() const; - - //- Turbulent diffusivity - // multiplying the gradient of the phase-fraction + //- Return the turbulent diffusivity multiplying the gradient of the + // phase-fraction virtual tmp D() const = 0; }; +/*---------------------------------------------------------------------------*\ + Class blendedTurbulentDispersionModel Declaration +\*---------------------------------------------------------------------------*/ + +class blendedTurbulentDispersionModel +: + public BlendedInterfacialModel +{ +public: + + // Constructors + + //- Inherit base class constructors + using + BlendedInterfacialModel:: + BlendedInterfacialModel; + + + // Selectors + + static autoPtr New + ( + const dictionary& dict, + const phaseInterface& interface + ); + + + // Member Functions + + //- Return the turbulent diffusivity multiplying the gradient of the + // phase-fraction + tmp D() const; +}; + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/turbulentDispersionModelNew.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/turbulentDispersionModelNew.C index 17762cc48d..93fa0325bd 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/turbulentDispersionModelNew.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/turbulentDispersionModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "turbulentDispersionModel.H" -#include "phasePair.H" +#include "phaseSystem.H" // * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * // @@ -32,13 +32,19 @@ Foam::autoPtr Foam::turbulentDispersionModel::New ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface, + const bool outer ) { - word turbulentDispersionModelType(dict.lookup("type")); + const dictionary& modelDict = + outer + ? interface.fluid().modelSubDict(dict) + : dict; + + const word turbulentDispersionModelType(modelDict.lookup("type")); Info<< "Selecting turbulentDispersionModel for " - << pair << ": " << turbulentDispersionModelType << endl; + << interface.name() << ": " << turbulentDispersionModelType << endl; dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(turbulentDispersionModelType); @@ -53,8 +59,24 @@ Foam::turbulentDispersionModel::New << exit(FatalError); } - return cstrIter()(dict, pair); + return cstrIter()(modelDict, interface); } +Foam::autoPtr +Foam::blendedTurbulentDispersionModel::New +( + const dictionary& dict, + const phaseInterface& interface +) +{ + return + autoPtr + ( + new blendedTurbulentDispersionModel(dict, interface) + ); +} + + + // ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/virtualMassModels/Lamb/Lamb.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/virtualMassModels/Lamb/Lamb.C index 2226040666..3c5c45526b 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/virtualMassModels/Lamb/Lamb.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/virtualMassModels/Lamb/Lamb.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "Lamb.H" -#include "phasePair.H" #include "aspectRatioModel.H" #include "addToRunTimeSelectionTable.H" @@ -50,12 +49,12 @@ namespace virtualMassModels Foam::virtualMassModels::Lamb::Lamb ( const dictionary& dict, - const phasePair& pair, + const phaseInterface& interface, const bool registerObject ) : - virtualMassModel(dict, pair, registerObject), - aspectRatio_(aspectRatioModel::New(dict.subDict("aspectRatio"), pair)) + dispersedVirtualMassModel(dict, interface, registerObject), + aspectRatio_(aspectRatioModel::New(dict.subDict("aspectRatio"), interface)) {} diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/virtualMassModels/Lamb/Lamb.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/virtualMassModels/Lamb/Lamb.H index 13aad2d80c..a5317750e8 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/virtualMassModels/Lamb/Lamb.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/virtualMassModels/Lamb/Lamb.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -42,14 +42,13 @@ SourceFiles #ifndef Lamb_H #define Lamb_H -#include "virtualMassModel.H" +#include "dispersedVirtualMassModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { -class phasePair; class aspectRatioModel; namespace virtualMassModels @@ -61,7 +60,7 @@ namespace virtualMassModels class Lamb : - public virtualMassModel + public dispersedVirtualMassModel { private: @@ -79,11 +78,11 @@ public: // Constructors - //- Construct from a dictionary and a phase pair + //- Construct from a dictionary and an interface Lamb ( const dictionary& dict, - const phasePair& pair, + const phaseInterface& interface, const bool registerObject ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/virtualMassModels/constantVirtualMassCoefficient/constantVirtualMassCoefficient.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/virtualMassModels/constantVirtualMassCoefficient/constantVirtualMassCoefficient.C index 6fbf3fbd89..f275de0d19 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/virtualMassModels/constantVirtualMassCoefficient/constantVirtualMassCoefficient.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/virtualMassModels/constantVirtualMassCoefficient/constantVirtualMassCoefficient.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "constantVirtualMassCoefficient.H" -#include "phasePair.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -50,11 +49,11 @@ Foam::virtualMassModels::constantVirtualMassCoefficient:: constantVirtualMassCoefficient ( const dictionary& dict, - const phasePair& pair, + const phaseInterface& interface, const bool registerObject ) : - virtualMassModel(dict, pair, registerObject), + dispersedVirtualMassModel(dict, interface, registerObject), Cvm_("Cvm", dimless, dict) {} @@ -71,12 +70,10 @@ Foam::virtualMassModels::constantVirtualMassCoefficient:: Foam::tmp Foam::virtualMassModels::constantVirtualMassCoefficient::Cvm() const { - const fvMesh& mesh(this->pair_.phase1().mesh()); - return volScalarField::New ( "Cvm", - mesh, + interface_.mesh(), Cvm_ ); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/virtualMassModels/constantVirtualMassCoefficient/constantVirtualMassCoefficient.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/virtualMassModels/constantVirtualMassCoefficient/constantVirtualMassCoefficient.H index 495122faad..4a9198a729 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/virtualMassModels/constantVirtualMassCoefficient/constantVirtualMassCoefficient.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/virtualMassModels/constantVirtualMassCoefficient/constantVirtualMassCoefficient.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -35,15 +35,12 @@ SourceFiles #ifndef constantVirtualMassCoefficient_H #define constantVirtualMassCoefficient_H -#include "virtualMassModel.H" +#include "dispersedVirtualMassModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - -class phasePair; - namespace virtualMassModels { @@ -53,7 +50,7 @@ namespace virtualMassModels class constantVirtualMassCoefficient : - public virtualMassModel + public dispersedVirtualMassModel { // Private Data @@ -69,11 +66,11 @@ public: // Constructors - //- Construct from a dictionary and a phase pair + //- Construct from a dictionary and an interface constantVirtualMassCoefficient ( const dictionary& dict, - const phasePair& pair, + const phaseInterface& interface, const bool registerObject ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/virtualMassModels/dispersedVirtualMassModel/dispersedVirtualMassModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/virtualMassModels/dispersedVirtualMassModel/dispersedVirtualMassModel.C new file mode 100644 index 0000000000..b27e669fe8 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/virtualMassModels/dispersedVirtualMassModel/dispersedVirtualMassModel.C @@ -0,0 +1,72 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "dispersedVirtualMassModel.H" +#include "surfaceInterpolate.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::virtualMassModels::dispersedVirtualMassModel::dispersedVirtualMassModel +( + const dictionary& dict, + const phaseInterface& interface, + const bool registerObject +) +: + virtualMassModel(dict, interface, registerObject), + interface_(interface.modelCast()) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::virtualMassModels::dispersedVirtualMassModel::~dispersedVirtualMassModel() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp +Foam::virtualMassModels::dispersedVirtualMassModel::Ki() const +{ + return Cvm()*interface_.continuous().rho(); +} + + +Foam::tmp +Foam::virtualMassModels::dispersedVirtualMassModel::K() const +{ + return interface_.dispersed()*Ki(); +} + + +Foam::tmp +Foam::virtualMassModels::dispersedVirtualMassModel::Kf() const +{ + return fvc::interpolate(interface_.dispersed())*fvc::interpolate(Ki()); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/virtualMassModels/dispersedVirtualMassModel/dispersedVirtualMassModel.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/virtualMassModels/dispersedVirtualMassModel/dispersedVirtualMassModel.H new file mode 100644 index 0000000000..df18b8da0b --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/virtualMassModels/dispersedVirtualMassModel/dispersedVirtualMassModel.H @@ -0,0 +1,115 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::dispersedVirtualMassModel + +Description + Model for virtual mass between two phases where one phase can be considered + dispersed in the other and the virtual mass therefore characterised by a + virtual mass coefficient + +SourceFiles + dispersedVirtualMassModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef dispersedVirtualMassModel_H +#define dispersedVirtualMassModel_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "virtualMassModel.H" +#include "dispersedPhaseInterface.H" + +namespace Foam +{ +namespace virtualMassModels +{ + +/*---------------------------------------------------------------------------*\ + Class dispersedVirtualMassModel Declaration +\*---------------------------------------------------------------------------*/ + +class dispersedVirtualMassModel +: + public virtualMassModel +{ +protected: + + // Protected data + + //- Interface + const dispersedPhaseInterface interface_; + + +public: + + // Constructors + + // Construct from a dictionary and an interface + dispersedVirtualMassModel + ( + const dictionary& dict, + const phaseInterface& interface, + const bool registerObject + ); + + + //- Destructor + virtual ~dispersedVirtualMassModel(); + + + // Member Functions + + //- Return the virtual mass coefficient + virtual tmp Cvm() const = 0; + + //- Return the phase-intensive virtual mass coefficient Ki + // used in the momentum equation + // ddt(alpha1*rho1*U1) + ... = ... alphad*K*(DU1_Dt - DU2_Dt) + // ddt(alpha2*rho2*U2) + ... = ... alphad*K*(DU1_Dt - DU2_Dt) + virtual tmp Ki() const; + + //- Return the virtual mass coefficient K + // used in the momentum equation + // ddt(alpha1*rho1*U1) + ... = ... K*(DU1_Dt - DU2_Dt) + // ddt(alpha2*rho2*U2) + ... = ... K*(DU1_Dt - DU2_Dt) + virtual tmp K() const; + + //- Return the virtual mass coefficient Kf + // used in the face-momentum equations + virtual tmp Kf() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace virtualMassModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/virtualMassModels/noVirtualMass/noVirtualMass.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/virtualMassModels/noVirtualMass/noVirtualMass.C index c42453afe0..9afb7f0fcb 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/virtualMassModels/noVirtualMass/noVirtualMass.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/virtualMassModels/noVirtualMass/noVirtualMass.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "noVirtualMass.H" -#include "phasePair.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -44,11 +43,12 @@ namespace virtualMassModels Foam::virtualMassModels::noVirtualMass::noVirtualMass ( const dictionary& dict, - const phasePair& pair, + const phaseInterface& interface, const bool registerObject ) : - virtualMassModel(dict, pair, registerObject) + virtualMassModel(dict, interface, registerObject), + interface_(interface) {} @@ -61,23 +61,26 @@ Foam::virtualMassModels::noVirtualMass::~noVirtualMass() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // Foam::tmp -Foam::virtualMassModels::noVirtualMass::Cvm() const +Foam::virtualMassModels::noVirtualMass::K() const { - const fvMesh& mesh(this->pair_.phase1().mesh()); - return volScalarField::New ( - "zero", - mesh, - dimensionedScalar(dimless, 0) + "K", + interface_.mesh(), + dimensionedScalar(dimK, 0) ); } -Foam::tmp -Foam::virtualMassModels::noVirtualMass::K() const +Foam::tmp +Foam::virtualMassModels::noVirtualMass::Kf() const { - return Cvm()*dimensionedScalar(dimDensity, 0); + return surfaceScalarField::New + ( + "Kf", + interface_.mesh(), + dimensionedScalar(dimK, 0) + ); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/virtualMassModels/noVirtualMass/noVirtualMass.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/virtualMassModels/noVirtualMass/noVirtualMass.H index f20fe7c37a..f4d0f32b14 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/virtualMassModels/noVirtualMass/noVirtualMass.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/virtualMassModels/noVirtualMass/noVirtualMass.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -40,9 +40,6 @@ SourceFiles namespace Foam { - -class phasePair; - namespace virtualMassModels { @@ -54,6 +51,14 @@ class noVirtualMass : public virtualMassModel { +protected: + + // Protected data + + //- Interface + const phaseInterface interface_; + + public: //- Runtime type information @@ -62,11 +67,11 @@ public: // Constructors - //- Construct from a dictionary and a phase pair + //- Construct from a dictionary and an interface noVirtualMass ( const dictionary& dict, - const phasePair& pair, + const phaseInterface& interface, const bool registerObject ); @@ -77,11 +82,13 @@ public: // Member Functions - //- Virtual mass coefficient - virtual tmp Cvm() const; - - //- The virtual mass function K used in the momentum equation + //- Return the virtual mass coefficient K + // used in the momentum equations virtual tmp K() const; + + //- Return the virtual mass coefficient Kf + // used in the face-momentum equations + virtual tmp Kf() const; }; diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/virtualMassModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/virtualMassModel.C index 29a61d0f94..9240867c10 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/virtualMassModel.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/virtualMassModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,9 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "virtualMassModel.H" -#include "phasePair.H" -#include "surfaceInterpolate.H" -#include "BlendedInterfacialModel.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -45,7 +42,7 @@ const Foam::dimensionSet Foam::virtualMassModel::dimK(dimDensity); Foam::virtualMassModel::virtualMassModel ( const dictionary& dict, - const phasePair& pair, + const phaseInterface& interface, const bool registerObject ) : @@ -53,15 +50,14 @@ Foam::virtualMassModel::virtualMassModel ( IOobject ( - IOobject::groupName(typeName, pair.name()), - pair.phase1().mesh().time().timeName(), - pair.phase1().mesh(), + IOobject::groupName(typeName, interface.name()), + interface.mesh().time().timeName(), + interface.mesh(), IOobject::NO_READ, IOobject::NO_WRITE, registerObject ) - ), - pair_(pair) + ) {} @@ -73,29 +69,22 @@ Foam::virtualMassModel::~virtualMassModel() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -Foam::tmp Foam::virtualMassModel::Ki() const -{ - return Cvm()*pair_.continuous().rho(); -} - - -Foam::tmp Foam::virtualMassModel::K() const -{ - return pair_.dispersed()*Ki(); -} - - -Foam::tmp Foam::virtualMassModel::Kf() const -{ - return - fvc::interpolate(pair_.dispersed())*fvc::interpolate(Ki()); -} - - bool Foam::virtualMassModel::writeData(Ostream& os) const { return os.good(); } +Foam::tmp Foam::blendedVirtualMassModel::K() const +{ + return evaluate(&virtualMassModel::K, "K", virtualMassModel::dimK, false); +} + + +Foam::tmp Foam::blendedVirtualMassModel::Kf() const +{ + return evaluate(&virtualMassModel::Kf, "Kf", virtualMassModel::dimK, false); +} + + // ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/virtualMassModel.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/virtualMassModel.H index 9afa8d8f73..627368f6dd 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/virtualMassModel.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/virtualMassModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,6 +25,7 @@ Class Foam::virtualMassModel Description + Model for virtual mass between phases SourceFiles virtualMassModel.C @@ -40,12 +41,11 @@ SourceFiles #include "volFields.H" #include "dictionary.H" #include "runTimeSelectionTables.H" +#include "BlendedInterfacialModel.H" namespace Foam { -class phasePair; - /*---------------------------------------------------------------------------*\ Class virtualMassModel Declaration \*---------------------------------------------------------------------------*/ @@ -54,14 +54,6 @@ class virtualMassModel : public regIOobject { -protected: - - // Protected data - - //- Phase pair - const phasePair& pair_; - - public: //- Runtime type information @@ -77,10 +69,10 @@ public: dictionary, ( const dictionary& dict, - const phasePair& pair, + const phaseInterface& interface, const bool registerObject ), - (dict, pair, registerObject) + (dict, interface, registerObject) ); @@ -89,14 +81,17 @@ public: //- Coefficient dimensions static const dimensionSet dimK; + //- Does this model require correcting on fixed flux boundaries? + static const bool correctFixedFluxBCs = true; + // Constructors - //- Construct from a dictionary and a phase pair + //- Construct from a dictionary and an interface virtualMassModel ( const dictionary& dict, - const phasePair& pair, + const phaseInterface& interface, const bool registerObject ); @@ -110,36 +105,66 @@ public: static autoPtr New ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface, + const bool outer=true, + const bool registerObject=true ); // Member Functions - //- Return the virtual mass coefficient - virtual tmp Cvm() const = 0; - - //- Return the phase-intensive virtual mass coefficient Ki - // used in the momentum equation - // ddt(alpha1*rho1*U1) + ... = ... alphad*K*(DU1_Dt - DU2_Dt) - // ddt(alpha2*rho2*U2) + ... = ... alphad*K*(DU1_Dt - DU2_Dt) - virtual tmp Ki() const; - //- Return the virtual mass coefficient K // used in the momentum equation // ddt(alpha1*rho1*U1) + ... = ... K*(DU1_Dt - DU2_Dt) // ddt(alpha2*rho2*U2) + ... = ... K*(DU1_Dt - DU2_Dt) - virtual tmp K() const; + virtual tmp K() const = 0; //- Return the virtual mass coefficient Kf // used in the face-momentum equations - virtual tmp Kf() const; + virtual tmp Kf() const = 0; // Dummy write for regIOobject bool writeData(Ostream& os) const; }; +/*---------------------------------------------------------------------------*\ + Class blendedVirtualMassModel Declaration +\*---------------------------------------------------------------------------*/ + +class blendedVirtualMassModel +: + public BlendedInterfacialModel +{ +public: + + // Constructors + + //- Inherit base class constructors + using + BlendedInterfacialModel + ::BlendedInterfacialModel; + + + // Selectors + + static autoPtr New + ( + const dictionary& dict, + const phaseInterface& interface + ); + + + // Member Functions + + //- Return the lift coefficient K + tmp K() const; + + //- Return the lift coefficient Kf + tmp Kf() const; +}; + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/virtualMassModelNew.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/virtualMassModelNew.C index 7c279eea5f..a07a5558ef 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/virtualMassModelNew.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/virtualMassModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,20 +24,24 @@ License \*---------------------------------------------------------------------------*/ #include "virtualMassModel.H" -#include "phasePair.H" // * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * // Foam::autoPtr Foam::virtualMassModel::New ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface, + const bool outer, + const bool registerObject ) { - word virtualMassModelType(dict.lookup("type")); + const dictionary& modelDict = + outer ? interface.fluid().modelSubDict(dict) : dict; + + const word virtualMassModelType(modelDict.lookup("type")); Info<< "Selecting virtualMassModel for " - << pair << ": " << virtualMassModelType << endl; + << interface.name() << ": " << virtualMassModelType << endl; dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(virtualMassModelType); @@ -52,7 +56,21 @@ Foam::autoPtr Foam::virtualMassModel::New << exit(FatalError); } - return cstrIter()(dict, pair, true); + return cstrIter()(modelDict, interface, registerObject); +} + + +Foam::autoPtr Foam::blendedVirtualMassModel::New +( + const dictionary& dict, + const phaseInterface& interface +) +{ + return + autoPtr + ( + new blendedVirtualMassModel(dict, interface) + ); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallDampingModels/cosine/cosineWallDamping.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallDampingModels/cosine/cosineWallDamping.C index 7f8a7294c0..2ac5b6f0cf 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallDampingModels/cosine/cosineWallDamping.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallDampingModels/cosine/cosineWallDamping.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "cosineWallDamping.H" -#include "phasePair.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -58,7 +57,7 @@ Foam::wallDampingModels::cosine::limiter() const *min ( max(yWall() - zeroWallDist_, dimensionedScalar(dimLength, 0)) - /(Cd_*pair_.dispersed().d()), + /(Cd_*interface_.dispersed().d()), scalar(1) ) ) @@ -71,10 +70,10 @@ Foam::wallDampingModels::cosine::limiter() const Foam::wallDampingModels::cosine::cosine ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) : - wallDampingModel(dict, pair) + wallDampingModel(dict, interface) {} diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallDampingModels/cosine/cosineWallDamping.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallDampingModels/cosine/cosineWallDamping.H index 329dae765b..fa86ea5d72 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallDampingModels/cosine/cosineWallDamping.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallDampingModels/cosine/cosineWallDamping.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -40,9 +40,6 @@ SourceFiles namespace Foam { - -class phasePair; - namespace wallDampingModels { @@ -70,11 +67,11 @@ public: // Constructors - //- Construct from components + //- Construct from a dictionary and an interface cosine ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallDampingModels/linear/linearWallDamping.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallDampingModels/linear/linearWallDamping.C index a91921efe9..6e7f927542 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallDampingModels/linear/linearWallDamping.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallDampingModels/linear/linearWallDamping.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "linearWallDamping.H" -#include "phasePair.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -53,7 +52,7 @@ Foam::wallDampingModels::linear::limiter() const min ( max(yWall() - zeroWallDist_, dimensionedScalar(dimLength, 0)) - /(Cd_*pair_.dispersed().d()), scalar(1) + /(Cd_*interface_.dispersed().d()), scalar(1) ); } @@ -63,10 +62,10 @@ Foam::wallDampingModels::linear::limiter() const Foam::wallDampingModels::linear::linear ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) : - wallDampingModel(dict, pair) + wallDampingModel(dict, interface) {} diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallDampingModels/linear/linearWallDamping.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallDampingModels/linear/linearWallDamping.H index be70bf7d5c..98eedf357f 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallDampingModels/linear/linearWallDamping.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallDampingModels/linear/linearWallDamping.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -40,9 +40,6 @@ SourceFiles namespace Foam { - -class phasePair; - namespace wallDampingModels { @@ -70,11 +67,11 @@ public: // Constructors - //- Construct from components + //- Construct from a dictionary and an interface linear ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallDampingModels/sine/sineWallDamping.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallDampingModels/sine/sineWallDamping.C index afb477039f..13f718139d 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallDampingModels/sine/sineWallDamping.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallDampingModels/sine/sineWallDamping.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "sineWallDamping.H" -#include "phasePair.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -55,7 +54,7 @@ Foam::wallDampingModels::sine::limiter() const *min ( max(yWall() - zeroWallDist_, dimensionedScalar(dimLength, 0)) - /(Cd_*pair_.dispersed().d()), + /(Cd_*interface_.dispersed().d()), scalar(1) ) ); @@ -67,10 +66,10 @@ Foam::wallDampingModels::sine::limiter() const Foam::wallDampingModels::sine::sine ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) : - wallDampingModel(dict, pair) + wallDampingModel(dict, interface) {} diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallDampingModels/sine/sineWallDamping.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallDampingModels/sine/sineWallDamping.H index 9cd9ca342f..20382631cf 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallDampingModels/sine/sineWallDamping.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallDampingModels/sine/sineWallDamping.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -40,9 +40,6 @@ SourceFiles namespace Foam { - -class phasePair; - namespace wallDampingModels { @@ -70,11 +67,11 @@ public: // Constructors - //- Construct from components + //- Construct from a dictionary and an interface sine ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallDampingModels/wallDampingModel/wallDampingModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallDampingModels/wallDampingModel/wallDampingModel.C index 0381f47888..4e8d6af9c4 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallDampingModels/wallDampingModel/wallDampingModel.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallDampingModels/wallDampingModel/wallDampingModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "wallDampingModel.H" -#include "phasePair.H" #include "surfaceInterpolate.H" #include "wallFvPatch.H" @@ -36,19 +35,20 @@ namespace Foam defineRunTimeSelectionTable(wallDampingModel, dictionary); } -const Foam::dimensionSet Foam::wallDampingModel::dimF(1, -2, -2, 0, 0); - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::wallDampingModel::wallDampingModel ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) : - wallDependentModel(pair.phase1().mesh()), - pair_(pair), + wallDependentModel(interface.mesh()), + interface_ + ( + interface.modelCast() + ), Cd_("Cd", dimless, dict), zeroWallDist_ ( diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallDampingModels/wallDampingModel/wallDampingModel.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallDampingModels/wallDampingModel/wallDampingModel.H index a7dc2d9db3..6deab3ce85 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallDampingModels/wallDampingModel/wallDampingModel.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallDampingModels/wallDampingModel/wallDampingModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -65,12 +65,11 @@ SourceFiles #include "volFields.H" #include "dictionary.H" #include "runTimeSelectionTables.H" +#include "dispersedPhaseInterface.H" namespace Foam { -class phasePair; - /*---------------------------------------------------------------------------*\ Class wallDampingModel Declaration \*---------------------------------------------------------------------------*/ @@ -83,8 +82,8 @@ protected: // Protected data - //- Phase pair - const phasePair& pair_; + //- Interface + const dispersedPhaseInterface interface_; //- Diameter coefficient const dimensionedScalar Cd_; @@ -117,25 +116,19 @@ public: dictionary, ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ), - (dict, pair) + (dict, interface) ); - // Static Data Members - - //- Coefficient dimensions - static const dimensionSet dimF; - - // Constructors - //- Construct from components + //- Construct from a dictionary and an interface wallDampingModel ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ); @@ -148,7 +141,7 @@ public: static autoPtr New ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallDampingModels/wallDampingModel/wallDampingModelNew.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallDampingModels/wallDampingModel/wallDampingModelNew.C index 09aa69d710..5382a27b2a 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallDampingModels/wallDampingModel/wallDampingModelNew.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallDampingModels/wallDampingModel/wallDampingModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,20 +24,19 @@ License \*---------------------------------------------------------------------------*/ #include "wallDampingModel.H" -#include "phasePair.H" // * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * // Foam::autoPtr Foam::wallDampingModel::New ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) { - word wallDampingModelType(dict.lookup("type")); + const word wallDampingModelType(dict.lookup("type")); Info<< "Selecting wallDampingModel for " - << pair << ": " << wallDampingModelType << endl; + << interface.name() << ": " << wallDampingModelType << endl; dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(wallDampingModelType); @@ -52,7 +51,7 @@ Foam::autoPtr Foam::wallDampingModel::New << exit(FatalError); } - return cstrIter()(dict, pair); + return cstrIter()(dict, interface); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallLubricationModels/Antal/Antal.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallLubricationModels/Antal/Antal.C index 0dc82adc10..17edc74d1d 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallLubricationModels/Antal/Antal.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallLubricationModels/Antal/Antal.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "Antal.H" -#include "phasePair.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -34,12 +33,7 @@ namespace Foam namespace wallLubricationModels { defineTypeNameAndDebug(Antal, 0); - addToRunTimeSelectionTable - ( - wallLubricationModel, - Antal, - dictionary - ); + addToRunTimeSelectionTable(wallLubricationModel, Antal, dictionary); } } @@ -49,10 +43,10 @@ namespace wallLubricationModels Foam::wallLubricationModels::Antal::Antal ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) : - wallLubricationModel(dict, pair), + dispersedWallLubricationModel(dict, interface), Cw1_("Cw1", dimless, dict), Cw2_("Cw2", dimless, dict) {} @@ -68,7 +62,7 @@ Foam::wallLubricationModels::Antal::~Antal() Foam::tmp Foam::wallLubricationModels::Antal::Fi() const { - volVectorField Ur(pair_.Ur()); + const volVectorField Ur(interface_.Ur()); const volVectorField& n(nWall()); @@ -77,9 +71,9 @@ Foam::tmp Foam::wallLubricationModels::Antal::Fi() const max ( dimensionedScalar(dimless/dimLength, 0), - Cw1_/pair_.dispersed().d() + Cw2_/yWall() + Cw1_/interface_.dispersed().d() + Cw2_/yWall() ) - *pair_.continuous().rho() + *interface_.continuous().rho() *magSqr(Ur - (Ur & n)*n) *n ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallLubricationModels/Antal/Antal.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallLubricationModels/Antal/Antal.H index 2730cfd6d2..4eedafad00 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallLubricationModels/Antal/Antal.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallLubricationModels/Antal/Antal.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,15 +43,12 @@ SourceFiles #ifndef Antal_H #define Antal_H -#include "wallLubricationModel.H" +#include "dispersedWallLubricationModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - -class phasePair; - namespace wallLubricationModels { @@ -61,7 +58,7 @@ namespace wallLubricationModels class Antal : - public wallLubricationModel + public dispersedWallLubricationModel { // Private Data @@ -80,11 +77,11 @@ public: // Constructors - //- Construct from components + //- Construct from a dictionary and an interface Antal ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallLubricationModels/Frank/Frank.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallLubricationModels/Frank/Frank.C index bba071fd44..b4310a108a 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallLubricationModels/Frank/Frank.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallLubricationModels/Frank/Frank.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "Frank.H" -#include "phasePair.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -49,10 +48,10 @@ namespace wallLubricationModels Foam::wallLubricationModels::Frank::Frank ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) : - wallLubricationModel(dict, pair), + dispersedWallLubricationModel(dict, interface), Cwd_("Cwd", dimless, dict), Cwc_("Cwc", dimless, dict), p_(dict.lookup("p")) @@ -69,13 +68,13 @@ Foam::wallLubricationModels::Frank::~Frank() Foam::tmp Foam::wallLubricationModels::Frank::Fi() const { - volVectorField Ur(pair_.Ur()); + const volVectorField Ur(interface_.Ur()); const volVectorField& n(nWall()); const volScalarField& y(yWall()); - volScalarField Eo(pair_.Eo()); - volScalarField yTilde(y/(Cwc_*pair_.dispersed().d())); + const volScalarField Eo(interface_.Eo()); + const volScalarField yTilde(y/(Cwc_*interface_.dispersed().d())); return zeroGradWalls ( @@ -89,7 +88,7 @@ Foam::tmp Foam::wallLubricationModels::Frank::Fi() const dimensionedScalar(dimless/dimLength, 0), (1 - yTilde)/(Cwd_*y*pow(yTilde, p_ - 1)) ) - *pair_.continuous().rho() + *interface_.continuous().rho() *magSqr(Ur - (Ur & n)*n) *n ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallLubricationModels/Frank/Frank.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallLubricationModels/Frank/Frank.H index f12f7f9801..740a9437f8 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallLubricationModels/Frank/Frank.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallLubricationModels/Frank/Frank.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -51,15 +51,12 @@ SourceFiles #ifndef Frank_H #define Frank_H -#include "wallLubricationModel.H" +#include "dispersedWallLubricationModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - -class phasePair; - namespace wallLubricationModels { @@ -69,7 +66,7 @@ namespace wallLubricationModels class Frank : - public wallLubricationModel + public dispersedWallLubricationModel { // Private Data @@ -91,11 +88,11 @@ public: // Constructors - //- Construct from components + //- Construct from a dictionary and an interface Frank ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallLubricationModels/TomiyamaWallLubrication/TomiyamaWallLubrication.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallLubricationModels/TomiyamaWallLubrication/TomiyamaWallLubrication.C index 0f30d97ae0..06218f84e7 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallLubricationModels/TomiyamaWallLubrication/TomiyamaWallLubrication.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallLubricationModels/TomiyamaWallLubrication/TomiyamaWallLubrication.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "TomiyamaWallLubrication.H" -#include "phasePair.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -49,10 +48,10 @@ namespace wallLubricationModels Foam::wallLubricationModels::TomiyamaWallLubrication::TomiyamaWallLubrication ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) : - wallLubricationModel(dict, pair), + dispersedWallLubricationModel(dict, interface), D_("Cwd", dimLength, dict) {} @@ -68,12 +67,12 @@ Foam::wallLubricationModels::TomiyamaWallLubrication::~TomiyamaWallLubrication() Foam::tmp Foam::wallLubricationModels::TomiyamaWallLubrication::Fi() const { - volVectorField Ur(pair_.Ur()); + const volVectorField Ur(interface_.Ur()); const volVectorField& n(nWall()); const volScalarField& y(yWall()); - volScalarField Eo(pair_.Eo()); + const volScalarField Eo(interface_.Eo()); return zeroGradWalls ( @@ -83,12 +82,12 @@ Foam::wallLubricationModels::TomiyamaWallLubrication::Fi() const + pos0(Eo - 33)*0.179 ) *0.5 - *pair_.dispersed().d() + *interface_.dispersed().d() *( 1/sqr(y) - 1/sqr(D_ - y) ) - *pair_.continuous().rho() + *interface_.continuous().rho() *magSqr(Ur - (Ur & n)*n) *n ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallLubricationModels/TomiyamaWallLubrication/TomiyamaWallLubrication.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallLubricationModels/TomiyamaWallLubrication/TomiyamaWallLubrication.H index 02f4a48bdb..87195daa8a 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallLubricationModels/TomiyamaWallLubrication/TomiyamaWallLubrication.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallLubricationModels/TomiyamaWallLubrication/TomiyamaWallLubrication.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -49,15 +49,12 @@ SourceFiles #ifndef TomiyamaWallLubrication_H #define TomiyamaWallLubrication_H -#include "wallLubricationModel.H" +#include "dispersedWallLubricationModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - -class phasePair; - namespace wallLubricationModels { @@ -67,7 +64,7 @@ namespace wallLubricationModels class TomiyamaWallLubrication : - public wallLubricationModel + public dispersedWallLubricationModel { // Private Data @@ -83,11 +80,11 @@ public: // Constructors - //- Construct from components + //- Construct from a dictionary and an interface TomiyamaWallLubrication ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ); @@ -98,7 +95,7 @@ public: // Member Functions //- Return phase-intensive wall lubrication force - tmp Fi() const; + virtual tmp Fi() const; }; diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/phasePair/orderedPhasePair/orderedPhasePair.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallLubricationModels/dispersedWallLubricationModel/dispersedWallLubricationModel.C similarity index 60% rename from applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/phasePair/orderedPhasePair/orderedPhasePair.C rename to applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallLubricationModels/dispersedWallLubricationModel/dispersedWallLubricationModel.C index 69438250f3..c32c051272 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/phasePair/orderedPhasePair/orderedPhasePair.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallLubricationModels/dispersedWallLubricationModel/dispersedWallLubricationModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,61 +23,48 @@ License \*---------------------------------------------------------------------------*/ -#include "orderedPhasePair.H" -#include "phaseSystem.H" +#include "dispersedWallLubricationModel.H" +#include "fvcCurl.H" +#include "fvcFlux.H" +#include "surfaceInterpolate.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::orderedPhasePair::orderedPhasePair +Foam::wallLubricationModels::dispersedWallLubricationModel:: +dispersedWallLubricationModel ( - const phaseModel& dispersed, - const phaseModel& continuous + const dictionary& dict, + const phaseInterface& interface ) : - phasePair + wallLubricationModel(dict, interface), + interface_ ( - dispersed, - continuous, - true + interface.modelCast() ) {} // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -Foam::orderedPhasePair::~orderedPhasePair() +Foam::wallLubricationModels::dispersedWallLubricationModel:: +~dispersedWallLubricationModel() {} -// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -const Foam::phaseModel& Foam::orderedPhasePair::dispersed() const +Foam::tmp +Foam::wallLubricationModels::dispersedWallLubricationModel::F() const { - return phase1(); + return interface_.dispersed()*Fi(); } -const Foam::phaseModel& Foam::orderedPhasePair::continuous() const +Foam::tmp +Foam::wallLubricationModels::dispersedWallLubricationModel::Ff() const { - return phase2(); -} - - -Foam::word Foam::orderedPhasePair::name() const -{ - word namec(second()); - namec[0] = toupper(namec[0]); - return first() + "In" + namec; -} - - -Foam::word Foam::orderedPhasePair::otherName() const -{ - FatalErrorInFunction - << "Requested other name phase from an ordered pair." - << exit(FatalError); - - return word::null; + return fvc::interpolate(interface_.dispersed())*fvc::flux(Fi()); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallLubricationModels/dispersedWallLubricationModel/dispersedWallLubricationModel.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallLubricationModels/dispersedWallLubricationModel/dispersedWallLubricationModel.H new file mode 100644 index 0000000000..2ef3527ac7 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallLubricationModels/dispersedWallLubricationModel/dispersedWallLubricationModel.H @@ -0,0 +1,103 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::dispersedWallLubricationModel + +Description + Model for the wall lubrication force between two phases where one phase can + be considered dispersed in the other + +SourceFiles + dispersedWallLubricationModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef dispersedWallLubricationModel_H +#define dispersedWallLubricationModel_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "wallLubricationModel.H" +#include "dispersedPhaseInterface.H" + +namespace Foam +{ +namespace wallLubricationModels +{ + +/*---------------------------------------------------------------------------*\ + Class dispersedWallLubricationModel Declaration +\*---------------------------------------------------------------------------*/ + +class dispersedWallLubricationModel +: + public wallLubricationModel +{ +protected: + + // Protected data + + //- Interface + const dispersedPhaseInterface interface_; + + +public: + + // Constructors + + // Construct from a dictionary and an interface + dispersedWallLubricationModel + ( + const dictionary& dict, + const phaseInterface& interface + ); + + + //- Destructor + virtual ~dispersedWallLubricationModel(); + + + // Member Functions + + //- Return phase-intensive wallLubrication force + virtual tmp Fi() const = 0; + + //- Return wallLubrication force + virtual tmp F() const; + + //- Return face wallLubrication force + virtual tmp Ff() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace dragModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallLubricationModels/noWallLubrication/noWallLubrication.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallLubricationModels/noWallLubrication/noWallLubrication.C index 9c868283a4..84a2daa20d 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallLubricationModels/noWallLubrication/noWallLubrication.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallLubricationModels/noWallLubrication/noWallLubrication.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "noWallLubrication.H" -#include "phasePair.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -49,10 +48,11 @@ namespace wallLubricationModels Foam::wallLubricationModels::noWallLubrication::noWallLubrication ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) : - wallLubricationModel(dict, pair) + wallLubricationModel(dict, interface), + interface_(interface) {} @@ -65,29 +65,25 @@ Foam::wallLubricationModels::noWallLubrication::~noWallLubrication() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // Foam::tmp -Foam::wallLubricationModels::noWallLubrication::Fi() const +Foam::wallLubricationModels::noWallLubrication::F() const { - const fvMesh& mesh(this->pair_.phase1().mesh()); - return volVectorField::New ( - "noWallLubrication:Fi", - mesh, + "F", + interface_.mesh(), dimensionedVector(dimF, Zero) ); } -Foam::tmp -Foam::wallLubricationModels::noWallLubrication::F() const +Foam::tmp +Foam::wallLubricationModels::noWallLubrication::Ff() const { - const fvMesh& mesh(this->pair_.phase1().mesh()); - - return volVectorField::New + return surfaceScalarField::New ( - "noWallLubrication:F", - mesh, - dimensionedVector(dimF, Zero) + "F", + interface_.mesh(), + dimensionedScalar(dimF*dimArea, Zero) ); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallLubricationModels/noWallLubrication/noWallLubrication.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallLubricationModels/noWallLubrication/noWallLubrication.H index 7b608f3a33..ddab85ebea 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallLubricationModels/noWallLubrication/noWallLubrication.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallLubricationModels/noWallLubrication/noWallLubrication.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -40,9 +40,6 @@ SourceFiles namespace Foam { - -class phasePair; - namespace wallLubricationModels { @@ -54,6 +51,14 @@ class noWallLubrication : public wallLubricationModel { +protected: + + // Protected data + + //- Interface + const phaseInterface interface_; + + public: //- Runtime type information @@ -62,11 +67,11 @@ public: // Constructors - //- Construct from components + //- Construct from a dictionary and an interface noWallLubrication ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ); @@ -76,11 +81,11 @@ public: // Member Functions - //- Return phase-intensive wall lubrication force - tmp Fi() const; + //- Return wall lubrication force + virtual tmp F() const; - //- Wall lubrication force - tmp F() const; + //- Return face wall lubrication force + virtual tmp Ff() const; }; diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/wallLubricationModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/wallLubricationModel.C index e282f8aeb4..9684967932 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/wallLubricationModel.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/wallLubricationModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,11 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "wallLubricationModel.H" -#include "phasePair.H" -#include "fvcFlux.H" -#include "surfaceInterpolate.H" #include "wallFvPatch.H" -#include "BlendedInterfacialModel.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -72,11 +68,10 @@ Foam::tmp Foam::wallLubricationModel::zeroGradWalls Foam::wallLubricationModel::wallLubricationModel ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ) : - wallDependentModel(pair.phase1().mesh()), - pair_(pair) + wallDependentModel(interface.mesh()) {} @@ -88,15 +83,30 @@ Foam::wallLubricationModel::~wallLubricationModel() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -Foam::tmp Foam::wallLubricationModel::F() const +Foam::tmp Foam::blendedWallLubricationModel::F() const { - return pair_.dispersed()*Fi(); + return + evaluate + ( + &wallLubricationModel::F, + "F", + wallLubricationModel::dimF, + true + ); } -Foam::tmp Foam::wallLubricationModel::Ff() const +Foam::tmp +Foam::blendedWallLubricationModel::Ff() const { - return fvc::interpolate(pair_.dispersed())*fvc::flux(Fi()); + return + evaluate + ( + &wallLubricationModel::Ff, + "Ff", + wallLubricationModel::dimF*dimArea, + true + ); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/wallLubricationModel.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/wallLubricationModel.H index fcfceb565c..cbb275fc8a 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/wallLubricationModel.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/wallLubricationModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,6 +25,7 @@ Class Foam::wallLubricationModel Description + Model for the wall lubrication force between two phases SourceFiles wallLubricationModel.C @@ -41,12 +42,11 @@ SourceFiles #include "volFields.H" #include "dictionary.H" #include "runTimeSelectionTables.H" +#include "BlendedInterfacialModel.H" namespace Foam { -class phasePair; - /*---------------------------------------------------------------------------*\ Class wallLubricationModel Declaration \*---------------------------------------------------------------------------*/ @@ -57,12 +57,6 @@ class wallLubricationModel { protected: - // Protected data - - //- Phase pair - const phasePair& pair_; - - // Protected member functions //- Zero-gradient wall-lubrication force at walls @@ -84,9 +78,9 @@ public: dictionary, ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ), - (dict, pair) + (dict, interface) ); @@ -95,14 +89,17 @@ public: //- Coefficient dimensions static const dimensionSet dimF; + //- Does this model require correcting on fixed flux boundaries? + static const bool correctFixedFluxBCs = true; + // Constructors - //- Construct from components + //- Construct from a dictionary and an interface wallLubricationModel ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface ); @@ -115,20 +112,55 @@ public: static autoPtr New ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface, + const bool outer=true ); // Member Functions - //- Return phase-intensive wall lubrication force - virtual tmp Fi() const = 0; - //- Return wall lubrication force - virtual tmp F() const; + virtual tmp F() const = 0; //- Return face wall lubrication force - virtual tmp Ff() const; + virtual tmp Ff() const = 0; +}; + + +/*---------------------------------------------------------------------------*\ + Class blendedWallLubricationModel Declaration +\*---------------------------------------------------------------------------*/ + +class blendedWallLubricationModel +: + public BlendedInterfacialModel +{ +public: + + // Constructors + + //- Inherit base class constructors + using + BlendedInterfacialModel:: + BlendedInterfacialModel; + + + // Selectors + + static autoPtr New + ( + const dictionary& dict, + const phaseInterface& interface + ); + + + // Member Functions + + //- Return wall lubrication force + tmp F() const; + + //- Return face wall lubrication force + tmp Ff() const; }; diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/wallLubricationModelNew.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/wallLubricationModelNew.C index 748f40d20f..2412471465 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/wallLubricationModelNew.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/wallLubricationModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,20 +24,26 @@ License \*---------------------------------------------------------------------------*/ #include "wallLubricationModel.H" -#include "phasePair.H" +#include "phaseSystem.H" // * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * // Foam::autoPtr Foam::wallLubricationModel::New ( const dictionary& dict, - const phasePair& pair + const phaseInterface& interface, + const bool outer ) { - word wallLubricationModelType(dict.lookup("type")); + const dictionary& modelDict = + outer + ? interface.fluid().modelSubDict(dict) + : dict; + + const word wallLubricationModelType(modelDict.lookup("type")); Info<< "Selecting wallLubricationModel for " - << pair << ": " << wallLubricationModelType << endl; + << interface.name() << ": " << wallLubricationModelType << endl; dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(wallLubricationModelType); @@ -52,7 +58,22 @@ Foam::autoPtr Foam::wallLubricationModel::New << exit(FatalError); } - return cstrIter()(dict, pair); + return cstrIter()(modelDict, interface); +} + + +Foam::autoPtr +Foam::blendedWallLubricationModel::New +( + const dictionary& dict, + const phaseInterface& interface +) +{ + return + autoPtr + ( + new blendedWallLubricationModel(dict, interface) + ); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/derivedFvPatchFields/alphatPhaseChangeWallFunction/alphatPhaseChangeWallFunctionFvPatchScalarField.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/derivedFvPatchFields/alphatPhaseChangeWallFunction/alphatPhaseChangeWallFunctionFvPatchScalarField.C index b977ecfca7..e2c6df046b 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/derivedFvPatchFields/alphatPhaseChangeWallFunction/alphatPhaseChangeWallFunctionFvPatchScalarField.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/derivedFvPatchFields/alphatPhaseChangeWallFunction/alphatPhaseChangeWallFunctionFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -26,6 +26,8 @@ License #include "alphatPhaseChangeWallFunctionFvPatchScalarField.H" #include "fvPatchFieldMapper.H" #include "volFields.H" +#include "phaseInterface.H" +#include "phaseSystem.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -119,9 +121,15 @@ alphatPhaseChangeWallFunctionFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // bool alphatPhaseChangeWallFunctionFvPatchScalarField:: -activePhasePair(const phasePairKey& phasePair) const +activeInterface(const phaseInterface& interface) const { - if (phasePair == phasePairKey(otherPhaseName_, internalField().group())) + const phaseSystem& fluid = interface.fluid(); + + if + ( + interface.contains(fluid.phases()[internalField().group()]) + && interface.contains(fluid.phases()[otherPhaseName_]) + ) { return true; } @@ -140,16 +148,17 @@ alphatPhaseChangeWallFunctionFvPatchScalarField::dmdtf() const const scalarField& alphatPhaseChangeWallFunctionFvPatchScalarField:: -dmdtf(const phasePairKey& phasePair) const +dmdtf(const phaseInterface& interface) const { - if (activePhasePair(phasePair)) + if (activeInterface(interface)) { return dmdtf_; } else { FatalErrorInFunction - << " dmdtf requested for invalid phasePair!" + << "Phase change mass transfer rate requested for interface on " + << "which there is no phase change " << abort(FatalError); return dmdtf_; diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/derivedFvPatchFields/alphatPhaseChangeWallFunction/alphatPhaseChangeWallFunctionFvPatchScalarField.H b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/derivedFvPatchFields/alphatPhaseChangeWallFunction/alphatPhaseChangeWallFunctionFvPatchScalarField.H index 84ee8b1279..bf074d7d65 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/derivedFvPatchFields/alphatPhaseChangeWallFunction/alphatPhaseChangeWallFunctionFvPatchScalarField.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/derivedFvPatchFields/alphatPhaseChangeWallFunction/alphatPhaseChangeWallFunctionFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -39,12 +39,14 @@ SourceFiles #define alphatPhaseChangeWallFunctionFvPatchScalarField_H #include "alphatPhaseJayatillekeWallFunctionFvPatchScalarField.H" -#include "phasePairKey.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { + +class phaseInterface; + namespace compressible { @@ -120,14 +122,14 @@ public: // Member Functions - //- Is there phase change mass transfer for this phasePair - bool activePhasePair(const phasePairKey&) const; + //- Is there phase change mass transfer for this interface? + bool activeInterface(const phaseInterface&) const; //- Return the rate of phase-change const scalarField& dmdtf() const; - //- Return the rate of phase-change for specific phase pair - const scalarField& dmdtf(const phasePairKey&) const; + //- Return the rate of phase-change for an interface + const scalarField& dmdtf(const phaseInterface&) const; // Mapping functions diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C index 8344d40cee..a3b163e1a0 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C @@ -314,15 +314,9 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::updateCoeffs() const phaseModel& liquid = fluid.phases()[internalField().group()]; const phaseModel& vapor = fluid.phases()[otherPhaseName_]; - const phasePair pair(vapor, liquid); + const phaseInterface interface(vapor, liquid); - if - ( - db().foundObject - ( - IOobject::groupName("saturationModel", pair.name()) - ) - ) + if (fluid.foundInterfacialModel(interface)) { // Retrieve turbulence properties from models const phaseCompressible::momentumTransportModel& turbModel @@ -404,10 +398,7 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::updateCoeffs() // Saturation temperature const saturationModel& satModel = - db().lookupObject - ( - IOobject::groupName("saturationModel", pair.name()) - ); + fluid.lookupInterfacialModel(interface); const tmp tTsat = satModel.Tsat(lThermo.p()); const volScalarField& Tsat = tTsat(); const fvPatchScalarField& Tsatw(Tsat.boundaryField()[patchi]); @@ -419,7 +410,7 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::updateCoeffs() ? -refCast(fluid) .Li ( - pair, + interface, volatileSpecie, dmdtf_, Tsat, @@ -429,7 +420,7 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::updateCoeffs() : -refCast(fluid) .L ( - pair, + interface, dmdtf_, Tsat, patch().faceCells(), @@ -647,7 +638,7 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::updateCoeffs() } else { - Info<< "Saturation model for phase pair " << pair.name() + Info<< "Saturation model for interface " << interface.name() << " not found. Wall boiling disabled." << endl; operator== (alphatConv_); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/KocamustafaogullariIshiiDepartureDiameter/KocamustafaogullariIshiiDepartureDiameter.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/KocamustafaogullariIshiiDepartureDiameter/KocamustafaogullariIshiiDepartureDiameter.C index b5c1975744..bdc76d90fe 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/KocamustafaogullariIshiiDepartureDiameter/KocamustafaogullariIshiiDepartureDiameter.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/KocamustafaogullariIshiiDepartureDiameter/KocamustafaogullariIshiiDepartureDiameter.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2016-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2016-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -109,7 +109,7 @@ KocamustafaogullariIshiiDepartureDiameter::dDeparture const scalarField sigmaw ( - liquid.fluid().sigma(phasePairKey(liquid.name(), vapor.name()), patchi) + liquid.fluid().sigma(phaseInterface(liquid, vapor), patchi) ); return diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/KocamustafaogullariIshiiDepartureFrequency/KocamustafaogullariIshiiDepartureFrequency.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/KocamustafaogullariIshiiDepartureFrequency/KocamustafaogullariIshiiDepartureFrequency.C index 629de6aad2..875f073810 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/KocamustafaogullariIshiiDepartureFrequency/KocamustafaogullariIshiiDepartureFrequency.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/derivedFvPatchFields/wallBoilingSubModels/departureFrequencyModels/KocamustafaogullariIshiiDepartureFrequency/KocamustafaogullariIshiiDepartureFrequency.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2019-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -105,7 +105,7 @@ KocamustafaogullariIshiiDepartureFrequency::fDeparture const tmp tsigma ( - liquid.fluid().sigma(phasePairKey(liquid.name(), vapor.name())) + liquid.fluid().sigma(phaseInterface(liquid, vapor)) ); const volScalarField& sigma = tsigma(); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/KocamustafaogullariIshiiNucleationSite/KocamustafaogullariIshiiNucleationSite.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/KocamustafaogullariIshiiNucleationSite/KocamustafaogullariIshiiNucleationSite.C index 1e689742d3..b34bdd323b 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/KocamustafaogullariIshiiNucleationSite/KocamustafaogullariIshiiNucleationSite.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/KocamustafaogullariIshiiNucleationSite/KocamustafaogullariIshiiNucleationSite.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2019-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -104,7 +104,7 @@ KocamustafaogullariIshiiNucleationSite::N const scalarField sigmaw ( - liquid.fluid().sigma(phasePairKey(liquid.name(), vapor.name()), patchi) + liquid.fluid().sigma(phaseInterface(liquid, vapor), patchi) ); //eq. (32) diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C index 9b4279549c..0d7cafdf0a 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -433,10 +433,11 @@ void Foam::RASModels::kineticTheoryModel::correct() ); // Drag + const dispersedPhaseInterface interface(phase_, continuousPhase); const volScalarField beta ( - fluid.foundSubModel(phase_, continuousPhase) - ? fluid.lookupSubModel(phase_, continuousPhase).K() + fluid.foundInterfacialModel(interface) + ? fluid.lookupInterfacialModel(interface).K() : volScalarField::New ( "beta", diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseEulerFoam/multiphaseSystems/multiphaseSystems.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseEulerFoam/multiphaseSystems/multiphaseSystems.C index 831f21bb52..4e41f27082 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseEulerFoam/multiphaseSystems/multiphaseSystems.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseEulerFoam/multiphaseSystems/multiphaseSystems.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -29,9 +29,8 @@ License #include "TwoResistanceHeatTransferPhaseSystem.H" #include "PhaseTransferPhaseSystem.H" #include "InterfaceCompositionPhaseChangePhaseSystem.H" -#include "PopulationBalancePhaseSystem.H" #include "ThermalPhaseChangePhaseSystem.H" - +#include "PopulationBalancePhaseSystem.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/BlendedInterfacialModel/BlendedInterfacialModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/BlendedInterfacialModel/BlendedInterfacialModel.C index a5d2875e9e..a8b18575d7 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/BlendedInterfacialModel/BlendedInterfacialModel.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/BlendedInterfacialModel/BlendedInterfacialModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,6 +24,9 @@ License \*---------------------------------------------------------------------------*/ #include "BlendedInterfacialModel.H" +#include "phaseSystem.H" +#include "dispersedDisplacedPhaseInterface.H" +#include "segregatedDisplacedPhaseInterface.H" #include "fixedValueFvsPatchFields.H" #include "surfaceInterpolate.H" @@ -31,7 +34,7 @@ License namespace Foam { -namespace blendedInterfacialModel +namespace blendedInterfacialModel2 { template @@ -49,23 +52,24 @@ inline tmp interpolate(tmp f) return fvc::interpolate(f); } -} // End namespace blendedInterfacialModel +} // End namespace blendedInterfacialModel2 } // End namespace Foam + // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // template template class PatchField, class GeoMesh> void Foam::BlendedInterfacialModel::calculateBlendingCoeffs ( - tmp>& f1, - tmp>& f2, + tmp>& f1D2, + tmp>& f2D1, const bool subtract ) const { typedef GeometricField scalarGeoField; - if (model_.valid() && subtract) + if ((modelGeneral_.valid() || model1SegregatedWith2_.valid()) && subtract) { FatalErrorInFunction << "Cannot treat an interfacial model with no distinction between " @@ -73,27 +77,92 @@ void Foam::BlendedInterfacialModel::calculateBlendingCoeffs << exit(FatalError); } - if (model_.valid() || model1In2_.valid()) + if (model1SegregatedWith2_.valid() || model1DispersedIn2_.valid()) { - f1 = - blendedInterfacialModel::interpolate + f1D2 = + blendedInterfacialModel2::interpolate ( - blending_.f1(phase1_, phase2_) + blending_->f1(interface_.phase1(), interface_.phase2()) ); } - if (model_.valid() || model2In1_.valid()) + if (model1SegregatedWith2_.valid() || model2DispersedIn1_.valid()) { - f2 = + f2D1 = (subtract ? -1 : +1) - *blendedInterfacialModel::interpolate + *blendedInterfacialModel2::interpolate ( - blending_.f2(phase1_, phase2_) + blending_->f2(interface_.phase1(), interface_.phase2()) ); } } +template +template class PatchField, class GeoMesh> +void Foam::BlendedInterfacialModel::calculateBlendingCoeffs +( + tmp>& fG, + tmp>& f1D2, + tmp>& f2D1, + tmp>& fS, + const bool subtract +) const +{ + typedef GeometricField scalarGeoField; + + // Get the dispersed blending coefficients + calculateBlendingCoeffs(f1D2, f2D1, subtract); + + // Create a segregated blending coefficient if necessary + if (model1SegregatedWith2_.valid()) + { + fS = + scalarGeoField::New + ( + ModelType::typeName + ":" + + IOobject::groupName("fS", interface_.name()), + interface_.mesh(), + dimensionedScalar(dimless, 1) + ); + if (model1DispersedIn2_.valid()) + { + fS.ref() -= f1D2(); + } + if (model2DispersedIn1_.valid()) + { + fS.ref() -= f2D1(); + } + } + + // Create a general blending coefficient if necessary + if (modelGeneral_.valid()) + { + fG = + scalarGeoField::New + ( + ModelType::typeName + ":" + + IOobject::groupName("fG", interface_.name()), + interface_.mesh(), + dimensionedScalar(dimless, 1) + ); + + if (model1DispersedIn2_.valid()) + { + fG.ref() -= f1D2(); + } + if (model2DispersedIn1_.valid()) + { + fG.ref() -= f2D1(); + } + if (model1SegregatedWith2_.valid()) + { + fG.ref() -= fS(); + } + } +} + + template template class PatchField, class GeoMesh> void Foam::BlendedInterfacialModel::correctFixedFluxBCs @@ -110,17 +179,17 @@ void Foam::BlendedInterfacialModel::correctFixedFluxBCs if ( ( - !phase1_.stationary() + !interface_.phase1().stationary() && isA ( - phase1_.phi()().boundaryField()[patchi] + interface_.phase1().phi()().boundaryField()[patchi] ) ) || ( - !phase2_.stationary() + !interface_.phase2().stationary() && isA ( - phase2_.phi()().boundaryField()[patchi] + interface_.phase2().phi()().boundaryField()[patchi] ) ) ) @@ -131,6 +200,8 @@ void Foam::BlendedInterfacialModel::correctFixedFluxBCs } +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + template template < @@ -153,37 +224,48 @@ Foam::BlendedInterfacialModel::evaluate typedef GeometricField scalarGeoField; typedef GeometricField typeGeoField; - tmp f1, f2; - calculateBlendingCoeffs(f1, f2, subtract); + // Get the blending coefficients + tmp fG, f1D2, f2D1, fS; + calculateBlendingCoeffs(fG, f1D2, f2D1, fS, subtract); + // Construct the result tmp x = typeGeoField::New ( ModelType::typeName + ":" - + IOobject::groupName(name, phasePair(phase1_, phase2_).name()), - phase1_.mesh(), + + IOobject::groupName(name, interface_.name()), + interface_.mesh(), dimensioned(dims, Zero) ); - if (model_.valid()) + // Add the model contributions to the result + if (modelGeneral_.valid()) { - x.ref() += (scalar(1) - f1() - f2())*(model_().*method)(args ...); - } - - if (model1In2_.valid()) - { - x.ref() += f1*(model1In2_().*method)(args ...); - } - - if (model2In1_.valid()) - { - x.ref() += f2*(model2In1_().*method)(args ...); + x.ref() += fG*(modelGeneral_().*method)(args ...); + } + if (model1DispersedIn2_.valid()) + { + x.ref() += f1D2*(model1DispersedIn2_().*method)(args ...); + } + if (model2DispersedIn1_.valid()) + { + x.ref() += f2D1*(model2DispersedIn1_().*method)(args ...); + } + if (model1SegregatedWith2_.valid()) + { + x.ref() += fS*(model1SegregatedWith2_().*method)(args ...); } + // Correct boundary conditions if necessary if ( - correctFixedFluxBCs_ - && (model_.valid() || model1In2_.valid() || model2In1_.valid()) + ModelType::correctFixedFluxBCs + && ( + modelGeneral_.valid() + || model1DispersedIn2_.valid() + || model2DispersedIn1_.valid() + || model1SegregatedWith2_.valid() + ) ) { correctFixedFluxBCs(x.ref()); @@ -215,11 +297,14 @@ Foam::BlendedInterfacialModel::evaluate typedef GeometricField scalarGeoField; typedef GeometricField typeGeoField; - tmp f1, f2; - calculateBlendingCoeffs(f1, f2, subtract); + // Get the blending coefficients + tmp fG, f1D2, f2D1, fS; + calculateBlendingCoeffs(fG, f1D2, f2D1, fS, subtract); + // Construct the result HashPtrTable xs; + // Add the model contributions to the result auto addToXs = [&] ( const scalarGeoField& f, @@ -243,7 +328,7 @@ Foam::BlendedInterfacialModel::evaluate + IOobject::groupName ( IOobject::groupName(name, dxIter.key()), - phasePair(phase1_, phase2_).name() + interface_.name() ), f**dxIter() ).ptr() @@ -251,26 +336,33 @@ Foam::BlendedInterfacialModel::evaluate } } }; - - if (model_.valid()) + if (modelGeneral_.valid()) { - addToXs(scalar(1) - f1() - f2(), (model_().*method)(args ...)); - } - - if (model1In2_.valid()) - { - addToXs(f1, (model1In2_().*method)(args ...)); - } - - if (model2In1_.valid()) - { - addToXs(f2, (model2In1_().*method)(args ...)); + addToXs(fG, (modelGeneral_().*method)(args ...)); + } + if (model1DispersedIn2_.valid()) + { + addToXs(f1D2, (model1DispersedIn2_().*method)(args ...)); + } + if (model2DispersedIn1_.valid()) + { + addToXs(f2D1, (model2DispersedIn1_().*method)(args ...)); + } + if (model1SegregatedWith2_.valid()) + { + addToXs(fS, (model1SegregatedWith2_().*method)(args ...)); } + // Correct boundary conditions if necessary if ( - correctFixedFluxBCs_ - && (model_.valid() || model1In2_.valid() || model2In1_.valid()) + ModelType::correctFixedFluxBCs + && ( + modelGeneral_.valid() + || model1DispersedIn2_.valid() + || model2DispersedIn1_.valid() + || model1SegregatedWith2_.valid() + ) ) { forAllIter(typename HashPtrTable, xs, xIter) @@ -283,37 +375,185 @@ Foam::BlendedInterfacialModel::evaluate } +template +template +bool Foam::BlendedInterfacialModel::evaluate +( + bool (ModelType::*method)(Args ...) const, + Args ... args +) const +{ + return + ( + modelGeneral_.valid() + && (modelGeneral_().*method)(args ...) + ) + || ( + model1DispersedIn2_.valid() + && (model1DispersedIn2_().*method)(args ...) + ) + || ( + model2DispersedIn1_.valid() + && (model2DispersedIn1_().*method)(args ...) + ) + || ( + model1SegregatedWith2_.valid() + && (model1SegregatedWith2_().*method)(args ...) + ); +} + + +template +template +Foam::hashedWordList Foam::BlendedInterfacialModel::evaluate +( + const hashedWordList& (ModelType::*method)(Args ...) const, + Args ... args +) const +{ + wordList result; + + if (modelGeneral_.valid()) + { + result.append((modelGeneral_().*method)(args ...)); + } + if (model1DispersedIn2_.valid()) + { + result.append((model1DispersedIn2_().*method)(args ...)); + } + if (model2DispersedIn1_.valid()) + { + result.append((model2DispersedIn1_().*method)(args ...)); + } + if (model1SegregatedWith2_.valid()) + { + result.append((model1SegregatedWith2_().*method)(args ...)); + } + + return hashedWordList(move(result)); +} + + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template Foam::BlendedInterfacialModel::BlendedInterfacialModel ( - const phaseModel& phase1, - const phaseModel& phase2, - const blendingMethod& blending, - autoPtr model, - autoPtr model1In2, - autoPtr model2In1, - const bool correctFixedFluxBCs + const dictionary& dict, + const phaseInterface& interface ) : regIOobject ( IOobject ( - IOobject::groupName(typeName, phasePair(phase1, phase2).name()), - phase1.mesh().time().timeName(), - phase1.mesh() + IOobject::groupName(typeName, interface.name()), + interface.fluid().mesh().time().timeName(), + interface.fluid().mesh() ) ), - phase1_(phase1), - phase2_(phase2), - blending_(blending), - model_(model), - model1In2_(model1In2), - model2In1_(model2In1), - correctFixedFluxBCs_(correctFixedFluxBCs) -{} + interface_(interface) +{ + // Construct blending functions + const dictionary& blendingDict = interface.fluid().subDict("blending"); + blending_ = + blendingMethod::New + ( + ModelType::typeName, + blendingDict.found(ModelType::typeName) + ? blendingDict.subDict(ModelType::typeName) + : blendingDict.subDict("default"), + interface.fluid().phases().toc() + ); + + // Construct the models + PtrList interfaces; + PtrList models; + interface.fluid().generateInterfacialModels + < + ModelType, + dispersedDisplacedPhaseInterface, + segregatedDisplacedPhaseInterface, + displacedPhaseInterface, + dispersedPhaseInterface, + segregatedPhaseInterface, + phaseInterface + > + ( + dict, + interface, + interfaces, + models + ); + + // Define local set function + auto set = [&] + ( + const phaseInterface& interface, + ModelType* model, + autoPtr& modelGeneral, + autoPtr& model1DispersedIn2, + autoPtr& model2DispersedIn1, + autoPtr& model1SegregatedWith2 + ) + { + if (isA(interface)) + { + const phaseModel& dispersed = + refCast(interface).dispersed(); + + interface_.index(dispersed) == 0 + ? model1DispersedIn2.set(model) + : model2DispersedIn1.set(model); + } + else if (isA(interface)) + { + model1SegregatedWith2.set(model); + } + else + { + modelGeneral.set(model); + } + }; + + // Unpack the interface and model lists to populate the models used for the + // different parts of the blending space + forAll(interfaces, i) + { + if (isA(interfaces[i])) + { + /* + const phaseModel& displacing = + refCast + (interfaces[i]).displacing(); + + set + ( + interfaces[i], + models[i], + modelGeneralDisplaced_[displacing.index()], + model1DispersedIn2Displaced_[displacing.index()], + model2DispersedIn1Displaced_[displacing.index()], + model1SegregatedWith2Displaced_[displacing.index()] + ); + */ + + NotImplemented; + } + else + { + set + ( + interfaces[i], + models.set(i, nullptr).ptr(), + modelGeneral_, + model1DispersedIn2_, + model2DispersedIn1_, + model1SegregatedWith2_ + ); + } + } +} // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // @@ -326,103 +566,10 @@ Foam::BlendedInterfacialModel::~BlendedInterfacialModel() // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // template -Foam::tmp -Foam::BlendedInterfacialModel::K() const +const Foam::phaseInterface& +Foam::BlendedInterfacialModel::interface() const { - tmp (ModelType::*k)() const = &ModelType::K; - - return evaluate(k, "K", ModelType::dimK, false); -} - - -template -Foam::tmp -Foam::BlendedInterfacialModel::K(const scalar residualAlpha) const -{ - tmp (ModelType::*k)(const scalar) const = &ModelType::K; - - return evaluate(k, "K", ModelType::dimK, false, residualAlpha); -} - - -template -Foam::tmp -Foam::BlendedInterfacialModel::Kf() const -{ - return evaluate(&ModelType::Kf, "Kf", ModelType::dimK, false); -} - - -template -template -Foam::tmp> -Foam::BlendedInterfacialModel::F() const -{ - return evaluate(&ModelType::F, "F", ModelType::dimF, true); -} - - -template -Foam::tmp -Foam::BlendedInterfacialModel::Ff() const -{ - return evaluate(&ModelType::Ff, "Ff", ModelType::dimF*dimArea, true); -} - - -template -Foam::tmp -Foam::BlendedInterfacialModel::D() const -{ - return evaluate(&ModelType::D, "D", ModelType::dimD, false); -} - - -template -bool Foam::BlendedInterfacialModel::mixture() const -{ - return - (model1In2_.valid() && model1In2_->mixture()) - || (model2In1_.valid() && model2In1_->mixture()) - || (model_.valid() && model_->mixture()); -} - - -template -Foam::tmp -Foam::BlendedInterfacialModel::dmdtf() const -{ - return evaluate(&ModelType::dmdtf, "dmdtf", ModelType::dimDmdt, true); -} - - -template -Foam::hashedWordList Foam::BlendedInterfacialModel::species() const -{ - wordList species; - - if (model1In2_.valid()) - { - species.append(model1In2_->species()); - } - if (model2In1_.valid()) - { - species.append(model2In1_->species()); - } - if (model_.valid()) - { - species.append(model_->species()); - } - - return hashedWordList(move(species)); -} - - -template -Foam::HashPtrTable -Foam::BlendedInterfacialModel::dmidtf() const -{ - return evaluate(&ModelType::dmidtf, "dmidtf", ModelType::dimDmdt, true); + return interface_; } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/BlendedInterfacialModel/BlendedInterfacialModel.H b/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/BlendedInterfacialModel/BlendedInterfacialModel.H index d81b60c89c..b2932ad947 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/BlendedInterfacialModel/BlendedInterfacialModel.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/BlendedInterfacialModel/BlendedInterfacialModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -35,10 +35,9 @@ SourceFiles #define BlendedInterfacialModel_H #include "blendingMethod.H" -#include "phasePair.H" +#include "phaseInterface.H" #include "HashPtrTable.H" #include "hashedWordList.H" -#include "geometricZeroField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -56,26 +55,23 @@ class BlendedInterfacialModel { // Private Data - //- Reference to phase 1 - const phaseModel& phase1_; + //- The interface + const phaseInterface interface_; - //- Reference to phase 2 - const phaseModel& phase2_; + //- Blending method + autoPtr blending_; - //- Blending model - const blendingMethod& blending_; + //- Model for general configurations + autoPtr modelGeneral_; - //- Model for region with no obvious dispersed phase - autoPtr model_; + //- Model for phase 1 dispersed in phase 2 + autoPtr model1DispersedIn2_; - //- Model for dispersed phase 1 in continuous phase 2 - autoPtr model1In2_; + //- Model for phase 2 dispersed in phase 1 + autoPtr model2DispersedIn1_; - //- Model for dispersed phase 2 in continuous phase 1 - autoPtr model2In1_; - - //- If true set coefficients and forces to 0 at fixed-flux BCs - bool correctFixedFluxBCs_; + //- Model for phase 1 segregated with phase 2 + autoPtr model1SegregatedWith2_; // Private Member Functions @@ -84,8 +80,19 @@ class BlendedInterfacialModel template class PatchField, class GeoMesh> void calculateBlendingCoeffs ( - tmp>& f1, - tmp>& f2, + tmp>& f1D2, + tmp>& f2D1, + const bool subtract + ) const; + + //- Calculate the blending coefficients + template class PatchField, class GeoMesh> + void calculateBlendingCoeffs + ( + tmp>& fG, + tmp>& f1D2, + tmp>& f2D1, + tmp>& fS, const bool subtract ) const; @@ -96,7 +103,12 @@ class BlendedInterfacialModel GeometricField& field ) const; - //- Return the blended coeff/value + +protected: + + // Protected Member Functions + + //- Return a blended field template < class Type, @@ -114,7 +126,7 @@ class BlendedInterfacialModel Args ... args ) const; - //- Return the blended coeff/value + //- Return a table of blended fields template < class Type, @@ -132,6 +144,22 @@ class BlendedInterfacialModel Args ... args ) const; + //- Return a bool combined (or) from all models + template + bool evaluate + ( + bool (ModelType::*method)(Args ...) const, + Args ... args + ) const; + + //- Return a hashed word list combined from all models + template + hashedWordList evaluate + ( + const hashedWordList& (ModelType::*method)(Args ...) const, + Args ... args + ) const; + public: @@ -141,16 +169,11 @@ public: // Constructors - //- Construct from two phases, blending method and three models + //- Construct from a dictionary and an interface BlendedInterfacialModel ( - const phaseModel& phase1, - const phaseModel& phase2, - const blendingMethod& blending, - autoPtr model, - autoPtr model1In2, - autoPtr model2In1, - const bool correctFixedFluxBCs = true + const dictionary& dict, + const phaseInterface& interface ); //- Disallow default bitwise copy construction @@ -166,36 +189,8 @@ public: // Member Functions - //- Return the blended force coefficient - tmp K() const; - - //- Return the blended force coefficient with a specified residual alpha - tmp K(const scalar residualAlpha) const; - - //- Return the face blended force coefficient - tmp Kf() const; - - //- Return the blended force - template - tmp> F() const; - - //- Return the face blended force - tmp Ff() const; - - //- Return the blended diffusivity - tmp D() const; - - //- Return the list of individual species that are transferred - bool mixture() const; - - //- Return the blended mass transfer rate - tmp dmdtf() const; - - //- Return the list of individual species that are transferred - hashedWordList species() const; - - //- Return the blended mass transfer rates for individual species - HashPtrTable dmidtf() const; + //- Access the interface + const phaseInterface& interface() const; //- Dummy write for regIOobject bool writeData(Ostream& os) const; @@ -217,11 +212,12 @@ public: BlendedInterfacialModel, \ ( \ word(BlendedInterfacialModel::typeName_()) + "<" \ - + ModelType::typeName_() + ">" \ + + ModelType::typeName + ">" \ ).c_str(), \ DebugSwitch \ ); + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/blendingMethod/blendingMethod.H b/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/blendingMethod/blendingMethod.H index 98b8e6d416..69b6feed79 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/blendingMethod/blendingMethod.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/blendingMethod/blendingMethod.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -72,10 +72,7 @@ public: // Constructors //- Construct from a dictionary - blendingMethod - ( - const dictionary& dict - ); + blendingMethod(const dictionary& dict); // Selector diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/linear/linear.H b/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/linear/linear.H index 15795352f7..fe8601dffb 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/linear/linear.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/linear/linear.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -70,7 +70,7 @@ public: // Constructors - //- Construct from a dictionary and two phases + //- Construct from a dictionary and a list of phase names linear ( const dictionary& dict, diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/noBlending/noBlending.H b/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/noBlending/noBlending.H index 401cdbe361..fa97e2b535 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/noBlending/noBlending.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/BlendedInterfacialModel/blendingMethods/noBlending/noBlending.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -65,7 +65,7 @@ public: // Constructors - //- Construct from a dictionary and two phases + //- Construct from a dictionary and a list of phase names noBlending ( const dictionary& dict, diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/Make/files b/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/Make/files index 839e314d95..e1497b2a00 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/Make/files +++ b/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/Make/files @@ -2,9 +2,19 @@ phaseModel/phaseModel/phaseModel.C phaseModel/phaseModel/phaseModelNew.C phaseModel/phaseModel/phaseModels.C -phasePair/phasePairKey/phasePairKey.C -phasePair/phasePair/phasePair.C -phasePair/orderedPhasePair/orderedPhasePair.C +phaseInterface/phaseInterfaceKey/phaseInterfaceKey.C +phaseInterface/phaseInterface/phaseInterface.C +phaseInterface/dispersedPhaseInterface/dispersedPhaseInterface.C +phaseInterface/segregatedPhaseInterface/segregatedPhaseInterface.C +phaseInterface/displacedPhaseInterface/displacedPhaseInterface.C +phaseInterface/dispersedDisplacedPhaseInterface/dispersedDisplacedPhaseInterface.C +phaseInterface/segregatedDisplacedPhaseInterface/segregatedDisplacedPhaseInterface.C +phaseInterface/sidedPhaseInterface/sidedPhaseInterface.C +phaseInterface/dispersedSidedPhaseInterface/dispersedSidedPhaseInterface.C +phaseInterface/segregatedSidedPhaseInterface/segregatedSidedPhaseInterface.C +phaseInterface/displacedSidedPhaseInterface/displacedSidedPhaseInterface.C +phaseInterface/dispersedDisplacedSidedPhaseInterface/dispersedDisplacedSidedPhaseInterface.C +phaseInterface/segregatedDisplacedSidedPhaseInterface/segregatedDisplacedSidedPhaseInterface.C phaseSystem/phaseSystem.C phaseSystem/phaseSystemNew.C diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/PhaseSystems/HeatTransferPhaseSystem/HeatTransferPhaseSystem.C b/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/PhaseSystems/HeatTransferPhaseSystem/HeatTransferPhaseSystem.C index 39280baf47..8186e5a303 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/PhaseSystems/HeatTransferPhaseSystem/HeatTransferPhaseSystem.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/PhaseSystems/HeatTransferPhaseSystem/HeatTransferPhaseSystem.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2020-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -39,15 +39,14 @@ void Foam::HeatTransferPhaseSystem::addDmdtHefs // Loop the pairs forAllConstIter(phaseSystem::dmdtfTable, dmdtfs, dmdtfIter) { - const phasePairKey& key = dmdtfIter.key(); - const phasePair& pair(this->phasePairs_[key]); + const phaseInterface interface(*this, dmdtfIter.key()); - const volScalarField dmdtf(Pair::compare(pair, key)**dmdtfIter()); + const volScalarField& dmdtf = *dmdtfIter(); const volScalarField dmdtf21(posPart(dmdtf)); const volScalarField dmdtf12(negPart(dmdtf)); - const phaseModel& phase1 = pair.phase1(); - const phaseModel& phase2 = pair.phase2(); + const phaseModel& phase1 = interface.phase1(); + const phaseModel& phase2 = interface.phase2(); const rhoThermo& thermo1 = phase1.thermo(); const rhoThermo& thermo2 = phase2.thermo(); const volScalarField& he1 = thermo1.he(); @@ -86,11 +85,10 @@ void Foam::HeatTransferPhaseSystem::addDmidtHefs // Loop the pairs forAllConstIter(phaseSystem::dmidtfTable, dmidtfs, dmidtfIter) { - const phasePairKey& key = dmidtfIter.key(); - const phasePair& pair(this->phasePairs_[key]); + const phaseInterface interface(*this, dmidtfIter.key()); - const phaseModel& phase1 = pair.phase1(); - const phaseModel& phase2 = pair.phase2(); + const phaseModel& phase1 = interface.phase1(); + const phaseModel& phase2 = interface.phase2(); const rhoThermo& thermo1 = phase1.thermo(); const rhoThermo& thermo2 = phase2.thermo(); const basicSpecieMixture* compositionPtr1 = @@ -114,10 +112,7 @@ void Foam::HeatTransferPhaseSystem::addDmidtHefs const word& specie = dmidtfJter.key(); // Mass transfer rates - const volScalarField dmidtf - ( - Pair::compare(pair, key)**dmidtfJter() - ); + const volScalarField& dmidtf = *dmidtfJter(); const volScalarField dmidtf21(posPart(dmidtf)); const volScalarField dmidtf12(negPart(dmidtf)); @@ -190,17 +185,16 @@ void Foam::HeatTransferPhaseSystem::addDmdtHefsWithoutL // Loop the pairs forAllConstIter(phaseSystem::dmdtfTable, dmdtfs, dmdtfIter) { - const phasePairKey& key = dmdtfIter.key(); - const phasePair& pair(this->phasePairs_[key]); + const phaseInterface interface(*this, dmdtfIter.key()); - const volScalarField dmdtf(Pair::compare(pair, key)**dmdtfIter()); + const volScalarField& dmdtf = *dmdtfIter(); const volScalarField dmdtf21(posPart(dmdtf)); const volScalarField dmdtf12(negPart(dmdtf)); - const volScalarField& Tf = *Tfs[key]; + const volScalarField& Tf = *Tfs[dmdtfIter.key()]; - const phaseModel& phase1 = pair.phase1(); - const phaseModel& phase2 = pair.phase2(); + const phaseModel& phase1 = interface.phase1(); + const phaseModel& phase2 = interface.phase2(); const rhoThermo& thermo1 = phase1.thermo(); const rhoThermo& thermo2 = phase2.thermo(); const volScalarField& he1 = thermo1.he(); @@ -257,20 +251,19 @@ void Foam::HeatTransferPhaseSystem::addDmdtL // Loop the pairs forAllConstIter(phaseSystem::dmdtfTable, dmdtfs, dmdtfIter) { - const phasePairKey& key = dmdtfIter.key(); - const phasePair& pair(this->phasePairs_[key]); + const phaseInterface interface(*this, dmdtfIter.key()); - const volScalarField dmdtf(Pair::compare(pair, key)**dmdtfIter()); + const volScalarField& dmdtf = *dmdtfIter(); const volScalarField dmdtf21(posPart(dmdtf)); const volScalarField dmdtf12(negPart(dmdtf)); - const volScalarField& Tf = *Tfs[key]; + const volScalarField& Tf = *Tfs[dmdtfIter.key()]; - const phaseModel& phase1 = pair.phase1(); - const phaseModel& phase2 = pair.phase2(); + const phaseModel& phase1 = interface.phase1(); + const phaseModel& phase2 = interface.phase2(); // Latent heat contribution - const volScalarField L(this->L(pair, dmdtf, Tf, scheme)); + const volScalarField L(this->L(interface, dmdtf, Tf, scheme)); *eqns[phase1.name()] += ((1 - weight)*dmdtf12 + weight*dmdtf21)*L; *eqns[phase2.name()] += ((1 - weight)*dmdtf21 + weight*dmdtf12)*L; } @@ -306,13 +299,12 @@ void Foam::HeatTransferPhaseSystem::addDmidtHefsWithoutL // Loop the pairs forAllConstIter(phaseSystem::dmidtfTable, dmidtfs, dmidtfIter) { - const phasePairKey& key = dmidtfIter.key(); - const phasePair& pair(this->phasePairs_[key]); + const phaseInterface interface(*this, dmidtfIter.key()); - const volScalarField& Tf = *Tfs[key]; + const volScalarField& Tf = *Tfs[dmidtfIter.key()]; - const phaseModel& phase1 = pair.phase1(); - const phaseModel& phase2 = pair.phase2(); + const phaseModel& phase1 = interface.phase1(); + const phaseModel& phase2 = interface.phase2(); const rhoThermo& thermo1 = phase1.thermo(); const rhoThermo& thermo2 = phase2.thermo(); const basicSpecieMixture* compositionPtr1 = @@ -338,10 +330,7 @@ void Foam::HeatTransferPhaseSystem::addDmidtHefsWithoutL const word& specie = dmidtfJter.key(); // Mass transfer rates - const volScalarField dmidtf - ( - Pair::compare(pair, key)**dmidtfJter() - ); + const volScalarField& dmidtf = *dmidtfJter(); const volScalarField dmidtf21(posPart(dmidtf)); const volScalarField dmidtf12(negPart(dmidtf)); @@ -444,13 +433,12 @@ void Foam::HeatTransferPhaseSystem::addDmidtL // Loop the pairs forAllConstIter(phaseSystem::dmidtfTable, dmidtfs, dmidtfIter) { - const phasePairKey& key = dmidtfIter.key(); - const phasePair& pair(this->phasePairs_[key]); + const phaseInterface interface(*this, dmidtfIter.key()); - const volScalarField& Tf = *Tfs[key]; + const volScalarField& Tf = *Tfs[dmidtfIter.key()]; - const phaseModel& phase1 = pair.phase1(); - const phaseModel& phase2 = pair.phase2(); + const phaseModel& phase1 = interface.phase1(); + const phaseModel& phase2 = interface.phase2(); // Loop the species forAllConstIter(HashPtrTable, *dmidtfIter(), dmidtfJter) @@ -458,15 +446,15 @@ void Foam::HeatTransferPhaseSystem::addDmidtL const word& specie = dmidtfJter.key(); // Mass transfer rates - const volScalarField dmidtf - ( - Pair::compare(pair, key)**dmidtfJter() - ); + const volScalarField& dmidtf = *dmidtfJter(); const volScalarField dmidtf21(posPart(dmidtf)); const volScalarField dmidtf12(negPart(dmidtf)); // Latent heat contribution - const volScalarField Li(this->Li(pair, specie, dmidtf, Tf, scheme)); + const volScalarField Li + ( + this->Li(interface, specie, dmidtf, Tf, scheme) + ); *eqns[phase1.name()] += ((1 - weight)*dmidtf12 + weight*dmidtf21)*Li; *eqns[phase2.name()] += @@ -518,14 +506,14 @@ template Foam::tmp Foam::HeatTransferPhaseSystem::L ( - const phasePair& pair, + const phaseInterface& interface, const volScalarField& dmdtf, const volScalarField& Tf, const latentHeatScheme scheme ) const { - const rhoThermo& thermo1 = pair.phase1().thermo(); - const rhoThermo& thermo2 = pair.phase2().thermo(); + const rhoThermo& thermo1 = interface.phase1().thermo(); + const rhoThermo& thermo2 = interface.phase2().thermo(); // Interface enthalpies const volScalarField haf1(thermo1.ha(thermo1.p(), Tf)); @@ -557,15 +545,15 @@ template Foam::tmp Foam::HeatTransferPhaseSystem::L ( - const phasePair& pair, + const phaseInterface& interface, const scalarField& dmdtf, const scalarField& Tf, const labelUList& cells, const latentHeatScheme scheme ) const { - const rhoThermo& thermo1 = pair.phase1().thermo(); - const rhoThermo& thermo2 = pair.phase2().thermo(); + const rhoThermo& thermo1 = interface.phase1().thermo(); + const rhoThermo& thermo2 = interface.phase2().thermo(); // Interface enthalpies const scalarField haf1(thermo1.ha(Tf, cells)); @@ -600,15 +588,15 @@ template Foam::tmp Foam::HeatTransferPhaseSystem::Li ( - const phasePair& pair, + const phaseInterface& interface, const word& specie, const volScalarField& dmdtf, const volScalarField& Tf, const latentHeatScheme scheme ) const { - const rhoThermo& thermo1 = pair.phase1().thermo(); - const rhoThermo& thermo2 = pair.phase2().thermo(); + const rhoThermo& thermo1 = interface.phase1().thermo(); + const rhoThermo& thermo2 = interface.phase2().thermo(); const basicSpecieMixture* compositionPtr1 = isA(thermo1) ? &refCast(thermo1).composition() @@ -672,7 +660,7 @@ template Foam::tmp Foam::HeatTransferPhaseSystem::Li ( - const phasePair& pair, + const phaseInterface& interface, const word& specie, const scalarField& dmdtf, const scalarField& Tf, @@ -680,8 +668,8 @@ Foam::HeatTransferPhaseSystem::Li const latentHeatScheme scheme ) const { - const rhoThermo& thermo1 = pair.phase1().thermo(); - const rhoThermo& thermo2 = pair.phase2().thermo(); + const rhoThermo& thermo1 = interface.phase1().thermo(); + const rhoThermo& thermo2 = interface.phase2().thermo(); const basicSpecieMixture* compositionPtr1 = isA(thermo1) ? &refCast(thermo1).composition() diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/PhaseSystems/HeatTransferPhaseSystem/HeatTransferPhaseSystem.H b/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/PhaseSystems/HeatTransferPhaseSystem/HeatTransferPhaseSystem.H index 9511db34aa..81bc8c64be 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/PhaseSystems/HeatTransferPhaseSystem/HeatTransferPhaseSystem.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/PhaseSystems/HeatTransferPhaseSystem/HeatTransferPhaseSystem.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -162,11 +162,11 @@ public: // Member Functions - //- Return the latent heat for a given pair, mass transfer rate (used - // only for it's sign), and interface temperature + //- Return the latent heat for a given interface, mass transfer rate + // (used only for it's sign), and interface temperature virtual tmp L ( - const phasePair& pair, + const phaseInterface& interface, const volScalarField& dmdtf, const volScalarField& Tf, const latentHeatScheme scheme @@ -175,18 +175,18 @@ public: //- As above, but for a cell-set virtual tmp L ( - const phasePair& pair, + const phaseInterface& interface, const scalarField& dmdtf, const scalarField& Tf, const labelUList& cells, const latentHeatScheme scheme ) const; - //- Return the latent heat for a given pair, specie, mass transfer rate - // (used only for it's sign), and interface temperature + //- Return the latent heat for a given interface, specie, mass transfer + // rate (used only for it's sign), and interface temperature virtual tmp Li ( - const phasePair& pair, + const phaseInterface& interface, const word& member, const volScalarField& dmidtf, const volScalarField& Tf, @@ -196,7 +196,7 @@ public: //- As above, but for a cell-set virtual tmp Li ( - const phasePair& pair, + const phaseInterface& interface, const word& member, const scalarField& dmidtf, const scalarField& Tf, diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/PhaseSystems/HeatTransferPhaseSystem/heatTransferPhaseSystem.H b/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/PhaseSystems/HeatTransferPhaseSystem/heatTransferPhaseSystem.H index a8d3af736f..b8558cf286 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/PhaseSystems/HeatTransferPhaseSystem/heatTransferPhaseSystem.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/PhaseSystems/HeatTransferPhaseSystem/heatTransferPhaseSystem.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2020-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -41,7 +41,7 @@ SourceFiles namespace Foam { -class phasePair; +class phaseInterface; /*---------------------------------------------------------------------------*\ Class heatTransferPhaseSystem Declaration @@ -78,11 +78,11 @@ public: // Member Functions - //- Return the latent heat for a given pair, mass transfer rate (used - // only for it's sign), and interface temperature + //- Return the latent heat for a given interface, mass transfer rate + // (used only for it's sign), and interface temperature virtual tmp L ( - const phasePair& pair, + const phaseInterface& interface, const volScalarField& dmdtf, const volScalarField& Tf, const latentHeatScheme scheme @@ -91,18 +91,18 @@ public: //- As above, but for a cell-set virtual tmp L ( - const phasePair& pair, + const phaseInterface& interface, const scalarField& dmdtf, const scalarField& Tf, const labelUList& cells, const latentHeatScheme scheme ) const = 0; - //- Return the latent heat for a given pair, specie, mass transfer rate - // (used only for it's sign), and interface temperature + //- Return the latent heat for a given interface, specie, mass transfer + // rate (used only for it's sign), and interface temperature virtual tmp Li ( - const phasePair& pair, + const phaseInterface& interface, const word& member, const volScalarField& dmidtf, const volScalarField& Tf, @@ -112,7 +112,7 @@ public: //- As above, but for a cell-set virtual tmp Li ( - const phasePair& pair, + const phaseInterface& interface, const word& member, const scalarField& dmidtf, const scalarField& Tf, diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/PhaseSystems/InterfaceCompositionPhaseChangePhaseSystem/InterfaceCompositionPhaseChangePhaseSystem.C b/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/PhaseSystems/InterfaceCompositionPhaseChangePhaseSystem/InterfaceCompositionPhaseChangePhaseSystem.C index 65ae173efa..947db65453 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/PhaseSystems/InterfaceCompositionPhaseChangePhaseSystem/InterfaceCompositionPhaseChangePhaseSystem.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/PhaseSystems/InterfaceCompositionPhaseChangePhaseSystem/InterfaceCompositionPhaseChangePhaseSystem.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -42,37 +42,33 @@ correctDmdtfs() interfaceCompositionModelIter ) { - const phasePair& pair = - this->phasePairs_[interfaceCompositionModelIter.key()]; + const sidedInterfaceCompositionModel& compositionModel = + interfaceCompositionModelIter(); - *dmdtfs_[pair] = Zero; + const phaseInterface& interface = compositionModel.interface(); - forAllConstIter(phasePair, pair, pairIter) + *dmdtfs_[interface] = Zero; + + forAllConstIter(phaseInterface, interface, interfaceIter) { - const autoPtr& compositionModelPtr = - interfaceCompositionModelIter()[pairIter.index()]; + const phaseModel& phase = interfaceIter(); - if (!compositionModelPtr.valid()) continue; - - const interfaceCompositionModel& compositionModel = - compositionModelPtr(); - - const phaseModel& phase = *pairIter; + if (!compositionModel.haveModelInThe(phase)) continue; forAllConstIter ( hashedWordList, - compositionModel.species(), + compositionModel.modelInThe(phase).species(), specieIter ) { const word& specie = *specieIter; - *dmdtfs_[pair] += - (pairIter.index() == 0 ? +1 : -1) + *dmdtfs_[interface] += + (interfaceIter.index() == 0 ? +1 : -1) *( - *(*dmidtfSus_[pair])[specie] - + *(*dmidtfSps_[pair])[specie]*phase.Y(specie) + *(*dmidtfSus_[interface])[specie] + + *(*dmidtfSps_[interface])[specie]*phase.Y(specie) ); } } @@ -98,52 +94,47 @@ totalDmidtfs() const interfaceCompositionModelIter ) { - const phasePair& pair = - this->phasePairs_[interfaceCompositionModelIter.key()]; + const sidedInterfaceCompositionModel& compositionModel = + interfaceCompositionModelIter(); - if (!totalDmidtfs.found(pair)) + const phaseInterface& interface = compositionModel.interface(); + + if (!totalDmidtfs.found(interface)) { - totalDmidtfs.insert(pair, new HashPtrTable()); + totalDmidtfs.insert(interface, new HashPtrTable()); } - forAllConstIter(phasePair, pair, pairIter) + forAllConstIter(phaseInterface, interface, interfaceIter) { - const autoPtr& compositionModelPtr = - interfaceCompositionModelIter()[pairIter.index()]; + const phaseModel& phase = interfaceIter(); - if (!compositionModelPtr.valid()) continue; - - const interfaceCompositionModel& compositionModel = - compositionModelPtr(); - - const phaseModel& phase = *pairIter; + if (!compositionModel.haveModelInThe(phase)) continue; forAllConstIter ( hashedWordList, - compositionModel.species(), + compositionModel.modelInThe(phase).species(), specieIter ) { const word& specie = *specieIter; - tmp dmidtf ( - (pairIter.index() == 0 ? +1 : -1) + (interfaceIter.index() == 0 ? +1 : -1) *( - *(*dmidtfSus_[pair])[specie] - + *(*dmidtfSps_[pair])[specie]*phase.Y(specie) + *(*dmidtfSus_[interface])[specie] + + *(*dmidtfSps_[interface])[specie]*phase.Y(specie) ) ); - if (totalDmidtfs[pair]->found(specie)) + if (totalDmidtfs[interface]->found(specie)) { - *(*totalDmidtfs[pair])[specie] += dmidtf; + *(*totalDmidtfs[interface])[specie] += dmidtf; } else { - totalDmidtfs[pair]->insert(specie, dmidtf.ptr()); + totalDmidtfs[interface]->insert(specie, dmidtf.ptr()); } } } @@ -168,17 +159,16 @@ InterfaceCompositionPhaseChangePhaseSystem this->template lookupOrDefault