View Issue Details

IDProjectCategoryView StatusLast Update
0001036OpenFOAMBugpublic2013-11-05 10:13
Reporterdkxls Assigned Touser2 
PrioritynormalSeverityminorReproducibilityN/A
Status resolvedResolutionfixed 
PlatformLinux x86_64OSopenSUSEOS Version12.2
Summary0001036: [InjectionModel]: Reported "mass introduced" is incorrect
DescriptionThe "mass introduced" printed out to the info file is incorrect.

The bug is in the function 'void Foam::InjectionModel<CloudType>::inject(TrackData& td)' where the 'massAdded' is summed up [1]. Here only mass that is introduced as parcel is added to 'massAdded', mass that is added to the continues phase (e.g. evaporated in the 'move' function) will be lost in this summary, which is incorrect.
The error can be significant in high temperature fuel sprays!

[1] https://github.com/OpenFOAM/OpenFOAM-2.2.x/blob/master/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C#L589
TagsNo tags attached.

Activities

dkxls

2013-10-07 11:44

reporter  

0001-InjectionModel-Correct-summation-of-injected-mass.patch (1,319 bytes)   
diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C
index f49e790..7514de2 100644
--- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C
+++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C
@@ -586,8 +586,10 @@ void Foam::InjectionModel<CloudType>::inject(TrackData& td)
                             pPtr->rho()
                         );
 
+                    const scalar mParcel0 = pPtr->nParticle()*pPtr->mass();
                     if (!pPtr->move(td, dt))
                     {
+                        massAdded += mParcel0;
                         delete pPtr;
                     }
                     else
@@ -595,7 +597,7 @@ void Foam::InjectionModel<CloudType>::inject(TrackData& td)
                         if (pPtr->nParticle() >= 1.0)
                         {
                             td.cloud().addParticle(pPtr);
-                            massAdded += pPtr->nParticle()*pPtr->mass();
+                            massAdded += mParcel0;
                             parcelsAdded++;
                         }
                         else

dkxls

2013-10-07 11:44

reporter   ~0002535

With the corrections in the provided patch, the reported masses are consistent for my simulation (with one injector), i.e.:
'mass introduced' - 'Current mass in system' = 'Mass transfer phase change'

user2

2013-11-05 10:13

  ~0002605

Thanks for the report - fixed by commit 6ffa11f

Issue History

Date Modified Username Field Change
2013-10-03 16:52 dkxls New Issue
2013-10-07 11:44 dkxls File Added: 0001-InjectionModel-Correct-summation-of-injected-mass.patch
2013-10-07 11:44 dkxls Note Added: 0002535
2013-11-05 10:13 user2 Priority urgent => normal
2013-11-05 10:13 user2 Severity major => minor
2013-11-05 10:13 user2 Note Added: 0002605
2013-11-05 10:13 user2 Status new => resolved
2013-11-05 10:13 user2 Fixed in Version => 2.2.x
2013-11-05 10:13 user2 Resolution open => fixed
2013-11-05 10:13 user2 Assigned To => user2