From 022519fcf3d40f638935d939c62c3ce3307e89bc Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Wed, 18 Jan 2023 14:52:44 +0000 Subject: [PATCH] multiphaseEuler::populationBalanceModel: Make precomputation of diameter-independent expressions depend on the source term update interval Patch contributed by Institute of Fluid Dynamics, Helmholtz-Zentrum Dresden - Rossendorf (HZDR) and VTT Technical Research Centre of Finland Ltd. --- .../populationBalanceModel/populationBalanceModel.C | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/applications/solvers/modules/multiphaseEuler/phaseSystems/populationBalanceModel/populationBalanceModel/populationBalanceModel.C b/applications/solvers/modules/multiphaseEuler/phaseSystems/populationBalanceModel/populationBalanceModel/populationBalanceModel.C index 6f269f12de..88b9578963 100644 --- a/applications/solvers/modules/multiphaseEuler/phaseSystems/populationBalanceModel/populationBalanceModel/populationBalanceModel.C +++ b/applications/solvers/modules/multiphaseEuler/phaseSystems/populationBalanceModel/populationBalanceModel/populationBalanceModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2017-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2017-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -1136,7 +1136,9 @@ void Foam::diameterModels::populationBalanceModel::solve() const scalar tolerance = mesh_.solution().solverDict(name_).lookup("tolerance"); - if (nCorr > 0) + const bool updateSrc = updateSources(); + + if (nCorr > 0 && updateSrc) { precompute(); } @@ -1152,7 +1154,7 @@ void Foam::diameterModels::populationBalanceModel::solve() << iCorr << endl; - if (updateSources()) + if (updateSrc) { sources(); }