View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000960 | OpenFOAM | Bug | public | 2013-08-13 21:49 | 2013-08-14 10:22 |
Reporter | dkxls | Assigned To | |||
Priority | normal | Severity | major | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Platform | Linux x86_64 | OS | openSUSE | OS Version | 12.2 |
Summary | 0000960: [ReactingParcel]: Mass losses due to incorrect handeling of parcels below min mass | ||||
Description | When the parcels below minimum threshold are removed from the system, the whole parcel mass (i.e. mass0) has to be added to the carrier phase. In the current implementation only the mass1 = mass0 - dMassPC is added to the carrier phase. This results in loosing all the evaporated mass (dMassPC). The bug has been there earlier, but got triggered severely when using this mechanism to remove the critical mass from the liquid phase. I attached a patch that should fix the bug. | ||||
Additional Information | There also seems to be an unnecessary variable 'dmass', which is just a duplication of 'dMassPC'. This could be cleaned up at the same time, but is not included in the patch to avoid confusion. | ||||
Tags | No tags attached. | ||||
|
0001-Fix-mass-losses.patch (1,539 bytes)
From 21afa958a4cbf02f69421a725b2f065b5d05b4da Mon Sep 17 00:00:00 2001 From: Armin Wehrfritz <armin.wehrfritz@aalto.fi> Date: Tue, 13 Aug 2013 23:25:40 +0300 Subject: [PATCH] Fix mass losses --- .../parcels/Templates/ReactingParcel/ReactingParcel.C | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C index 29e0940..1e68dc1 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C @@ -371,13 +371,13 @@ void Foam::ReactingParcel<ParcelType>::calc } // Remove the particle when mass falls below minimum threshold - if (np0*mass1 < td.cloud().constProps().minParticleMass()) + if (mag(np0*mass1 - td.cloud().constProps().minParticleMass()) < SMALL) { td.keepParticle = false; if (td.cloud().solution().coupled()) { - scalar dm = np0*mass1; + scalar dm = np0*mass0; // Absorb parcel into carrier phase forAll(Y_, i) @@ -391,7 +391,7 @@ void Foam::ReactingParcel<ParcelType>::calc } td.cloud().UTrans()[cellI] += dm*U0; - td.cloud().phaseChange().addToPhaseChangeMass(dm); + td.cloud().phaseChange().addToPhaseChangeMass(np0*mass1); } return; -- 1.7.10.4 |
|
It should be mentioned that the mass loss was initially discovered by Kalle! (http://www.cfd-online.com/Forums/members/kalle.html) |
|
Now I would have almost introduced a bug myself. The new if statement only works sufficient when minParticleMass is 1e-15. I uploaded a revised patch (0001-Fix-mass-losses_v1.patch). |
|
0001-Fix-mass-losses_v1.patch (1,196 bytes)
diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C index 29e0940..d3dbe8a 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C @@ -371,13 +371,13 @@ void Foam::ReactingParcel<ParcelType>::calc } // Remove the particle when mass falls below minimum threshold - if (np0*mass1 < td.cloud().constProps().minParticleMass()) + if ((np0*mass1 - td.cloud().constProps().minParticleMass()) < SMALL) { td.keepParticle = false; if (td.cloud().solution().coupled()) { - scalar dm = np0*mass1; + scalar dm = np0*mass0; // Absorb parcel into carrier phase forAll(Y_, i) @@ -391,7 +391,7 @@ void Foam::ReactingParcel<ParcelType>::calc } td.cloud().UTrans()[cellI] += dm*U0; - td.cloud().phaseChange().addToPhaseChangeMass(dm); + td.cloud().phaseChange().addToPhaseChangeMass(np0*mass1); } return; |
|
Thanks for the report - fixed by commit 17a7659 |
Date Modified | Username | Field | Change |
---|---|---|---|
2013-08-13 21:49 | dkxls | New Issue | |
2013-08-13 21:50 | dkxls | File Added: 0001-Fix-mass-losses.patch | |
2013-08-13 22:10 | dkxls | Note Added: 0002402 | |
2013-08-14 10:13 | dkxls | Note Added: 0002404 | |
2013-08-14 10:13 | dkxls | File Added: 0001-Fix-mass-losses_v1.patch | |
2013-08-14 10:21 |
|
Priority | immediate => normal |
2013-08-14 10:21 |
|
Severity | crash => major |
2013-08-14 10:22 |
|
Note Added: 0002405 | |
2013-08-14 10:22 |
|
Status | new => resolved |
2013-08-14 10:22 |
|
Fixed in Version | => 2.2.x |
2013-08-14 10:22 |
|
Resolution | open => fixed |
2013-08-14 10:22 |
|
Assigned To | => user2 |