CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM

mass does not conserve in Openfoam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 23, 2012, 20:40
Default mass does not conserve in Openfoam
  #1
Member
 
Join Date: Jun 2012
Posts: 65
Rep Power: 14
conceptone is on a distinguished road
Hi guys, right now I am running SprayFoam using C12H26. And I found the mass does not conserve(figure 1). So the liq+gas mass != injected mass. The input is mass flow rate data from Engine Combustion Network Website and the injected mass should be calculated by the data. However, actually the mass conserves, I mean I calculated the injected mass by using the mass flow rate data to integrate with time numerically by Matlab and found the two lines meet together!(figure 2) So actually the calculation for liq+gas mass is correct. I guess this should be caused by some coding bug problem, which is not correct for the injected mass calculation(the "Total mass injected" term in output file). Since I am not familiar with C++, I need this help for correcting the bug. Thanks!
Attached Images
File Type: jpg figure2.jpg (28.4 KB, 107 views)
File Type: jpg figure 1.jpg (22.7 KB, 83 views)
conceptone is offline   Reply With Quote

Old   September 24, 2012, 16:03
Default
  #2
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29
niklas will become famous soon enoughniklas will become famous soon enough
are you injecting into a closed volume?

what is the convergence criteria for the pressure solver?
niklas is offline   Reply With Quote

Old   September 24, 2012, 21:05
Default
  #3
Member
 
Join Date: Jun 2012
Posts: 65
Rep Power: 14
conceptone is on a distinguished road
Hi, right, I am injecting into a closed volume, which is a cuboid. I don't know what is the convergence criteria for pressure solver, where can I check this?

Today I plus some debug codes in openfoam's code, specifically in InjectionModel.C:
(first plus in line 479):

// Pad injection time if injection starts during this timestep
const scalar padTime = max(0.0, SOI_ - time0_);

//for Debug
Info<<"unsteady condition-newParcels:"<<newParcels<<endl;

// Introduce new parcels linearly across carrier phase timestep
for (label parcelI = 0; parcelI < newParcels; parcelI++)
(second plus in line 561)

if (pPtr->move(td, dt))
{
td.cloud().addParticle(pPtr);
massAdded += pPtr->nParticle()*pPtr->mass();
Info<<"unsteady condition-massAdded:"<<massAdded<<endl;
parcelsAdded++;
}
(third plus in line 572):

}
Info<<"unsteady condition-Total massAdded:"<<massAdded<<endl<<endl;

postInjectCheck(parcelsAdded, massAdded);
}
And after I run the case again, the output file outputs:
unsteady condition-newParcels:96 (the number is varying,should be all right)
unsteady condition-Total massAdded:0 (the number is always 0, unusual!)
since massInjected += returnReduce (massAdded)=massAdded, and the output injected mass is massInjected term, there should be some fatal problem here.
conceptone is offline   Reply With Quote

Old   January 10, 2013, 02:18
Default
  #4
New Member
 
pushkaraj
Join Date: Nov 2012
Posts: 8
Rep Power: 14
pushkaraj is on a distinguished road
hi conceptone

i am also trying to use sprayfoam for the spray A data given on ECN network...

I f you have solved the issue can you share me your files regarding dodecane specially spraycloud properties??
i am unable to determine the mass flow rate profile data.... how did u determine that?

regards,
Pushkaraj
pushkaraj is offline   Reply With Quote

Old   February 3, 2013, 17:14
Default
  #5
Member
 
Join Date: Jun 2012
Posts: 65
Rep Power: 14
conceptone is on a distinguished road
hi, sorry for the delay
you can tell me your email address, I will send you the file
conceptone is offline   Reply With Quote

Old   February 8, 2013, 04:35
Default hi
  #6
New Member
 
pushkaraj
Join Date: Nov 2012
Posts: 8
Rep Power: 14
pushkaraj is on a distinguished road
my email id:
pushkarajmali@gmail.com

thanks in advance
Pushkaraj
pushkaraj is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
calculate mass flow rate on face OpenFoam ronaldo OpenFOAM 7 November 8, 2019 01:10
Superlinear speedup in OpenFOAM 13 msrinath80 OpenFOAM Running, Solving & CFD 18 March 3, 2015 06:36
Cross-compiling OpenFOAM 1.7.0 on Linux for Windows 32 and 64bits with Mingw-w64 wyldckat OpenFOAM Announcements from Other Sources 3 September 8, 2010 07:25
Adventure of fisrst openfoam installation on Ubuntu 710 jussi OpenFOAM Installation 0 April 24, 2008 15:25
Mass flux and mass flow rate us Phoenics 10 March 31, 2006 03:06


All times are GMT -4. The time now is 18:41.