From 95b7a3be188631b18fda9e0b413410ac62641b0b Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 5 Oct 2011 10:31:30 +0100 Subject: [PATCH 1/2] ENH: Updated behaviour of 'log' in forces function object - values always written to file - values only written to screen if log = true --- .../functionObjects/forces/forces/forces.C | 47 +++++++++++-------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/src/postProcessing/functionObjects/forces/forces/forces.C b/src/postProcessing/functionObjects/forces/forces/forces.C index b23a6d2328..1dd26906b7 100644 --- a/src/postProcessing/functionObjects/forces/forces/forces.C +++ b/src/postProcessing/functionObjects/forces/forces/forces.C @@ -428,36 +428,43 @@ void Foam::forces::write() Info<< "forces output:" << nl << " forces(pressure, viscous)" << fm.first() << nl << " moment(pressure, viscous)" << fm.second() << nl; + } - forcesFilePtr_() << obr_.time().value() << tab << fm; + forcesFilePtr_() << obr_.time().value() << tab << fm; - if (localSystem_) + if (localSystem_) + { + forcesMoments fmLocal; + + fmLocal.first().first() = + coordSys_.localVector(fm.first().first()); + + fmLocal.first().second() = + coordSys_.localVector(fm.first().second()); + + fmLocal.second().first() = + coordSys_.localVector(fm.second().first()); + + fmLocal.second().second() = + coordSys_.localVector(fm.second().second()); + + forcesFilePtr_() << tab << fmLocal; + + if (log_) { - forcesMoments fmLocal; - - fmLocal.first().first() = - coordSys_.localVector(fm.first().first()); - - fmLocal.first().second() = - coordSys_.localVector(fm.first().second()); - - fmLocal.second().first() = - coordSys_.localVector(fm.second().first()); - - fmLocal.second().second() = - coordSys_.localVector(fm.second().second()); - - forcesFilePtr_() << tab << fmLocal; - - Info<< " local:" << nl << " forces(pressure, viscous)" << fmLocal.first() << nl << " moment(pressure, viscous)" << fmLocal.second() << nl; } + } - forcesFilePtr_() << endl; + + forcesFilePtr_() << endl; + + if (log_) + { Info<< endl; } } From 8ede7fdda49613fa406b0cb3f306f9f0c22b8974 Mon Sep 17 00:00:00 2001 From: Sergio Ferraris Date: Wed, 5 Oct 2011 13:37:07 +0100 Subject: [PATCH 2/2] ENH: Changing Yt to "calculated" to avoid division by zero --- .../multiComponentMixture/multiComponentMixture.C | 3 ++- .../fireFoam/les/oppositeBurningPanels/0/N2 | 15 +++++---------- .../combustion/fireFoam/les/smallPoolFire2D/0/N2 | 13 ++++--------- .../combustion/fireFoam/les/smallPoolFire3D/0/N2 | 13 ++++--------- .../reactingFoam/ras/counterFlowFlame2D/0/N2 | 11 +++-------- 5 files changed, 18 insertions(+), 37 deletions(-) diff --git a/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.C index 394e35e536..d5707fe8fd 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.C @@ -49,7 +49,8 @@ const ThermoType& Foam::multiComponentMixture::constructSpeciesData template void Foam::multiComponentMixture::correctMassFractions() { - volScalarField Yt("Yt", Y_[0]); + // It changes Yt patches to "calculated" + volScalarField Yt("Yt", 1.0*Y_[0]); for (label n=1; n