From 3f5df8fb78b169087575f63cca5888b3ca4f24fa Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Fri, 3 Jul 2020 08:59:28 +0100 Subject: [PATCH] reacting*EulerFoam/.../kineticTheoryModel: Run without drag This change protects the lookup of the drag model so that if it is not found then the drag terms in the Theta equation are set to zero. This is not likely to be correct usage in physical cases, but is useful for doing uncoupled simulations for the purpose of model verification. --- .../kineticTheoryModel/kineticTheoryModel.C | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseCompressibleMomentumTransportModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C b/applications/solvers/multiphase/reactingEulerFoam/phaseCompressibleMomentumTransportModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C index cfea9bcefe..cc8cd047b5 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseCompressibleMomentumTransportModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseCompressibleMomentumTransportModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C @@ -391,6 +391,7 @@ void Foam::RASModels::kineticTheoryModel::correct() { // Local references volScalarField alpha(max(alpha_, scalar(0))); + const phaseSystem& fluid = phase_.fluid(); const phaseModel& continuousPhase = this->continuousPhase(); const volScalarField& rho = phase_.rho(); const surfaceScalarField& alphaRhoPhi = alphaRhoPhi_; @@ -437,10 +438,17 @@ void Foam::RASModels::kineticTheoryModel::correct() ); // Drag - const dragModel& drag = - phase_.fluid().lookupSubModel(phase_, continuousPhase); - - volScalarField beta(drag.K()); + volScalarField beta + ( + fluid.foundSubModel(phase_, continuousPhase) + ? fluid.lookupSubModel(phase_, continuousPhase).K() + : volScalarField::New + ( + "beta", + phase_.mesh(), + dimensionedScalar(dragModel::dimK, 0) + ) + ); // Eq. 3.25, p. 50 Js = J1 - J2 volScalarField J1("J1", 3*beta);