CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

Writing particle properties to the grid cells they are in

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   March 6, 2012, 19:46
Default Writing particle properties to the grid cells they are in
  #1
New Member
 
Join Date: Mar 2009
Location: Sao Jose dos Campos, Brazil
Posts: 28
Rep Power: 8
piccinini is on a distinguished road
Hello,

I've used the code bellow in dieselFoam.C of dieselFoam 1.7.1 to write some particle properties to the grid cells particles are in. The code compiles and runs in serial, but hangs when running in parallel mode. Anybody could help me?

Quote:

if (runTime.write())
{

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Output parcel properties to grid cells
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

drop_m= 0.0*drop_m;
drop_T= 0.0*drop_T;
drop_smd= 0.0*drop_smd;
drop_U= 0.0*drop_U;

spray::iterator mol(dieselSpray.begin());

for (mol = dieselSpray.begin(); mol != dieselSpray.end(); ++mol)
{
label cellI=mol().cell();
drop_m[cellI]+=mol().m();
}

for (mol = dieselSpray.begin(); mol != dieselSpray.end(); ++mol)
{
label cellI=mol().cell();
drop_T[cellI]+=mol().m()*mol().T()/drop_m[cellI];
drop_U[cellI]+=mol().m()*mol().U()/drop_m[cellI];
drop_smd[cellI]=dieselSpray.smdcell(cellI);
}


// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

drop_m.write();
drop_U.write();
drop_T.write();
drop_smd.write();
}
thanks

Last edited by piccinini; March 6, 2012 at 21:40. Reason: wrong piece of code
piccinini is offline   Reply With Quote

Old   March 6, 2012, 21:49
Default
  #2
New Member
 
Join Date: Mar 2009
Location: Sao Jose dos Campos, Brazil
Posts: 28
Rep Power: 8
piccinini is on a distinguished road
it seems to hang in this function:

Quote:
scalar spray::smdcell(const label thisCell) const
{
scalar numerator = 0.0, denominator = VSMALL;

for
(
spray::const_iterator elmnt = begin();
elmnt != end();
++elmnt
)
{
label celli = elmnt().cell();
if (thisCell == celli)
{
scalar Pc = p()[celli];
scalar T = elmnt().T();
scalar rho = fuels_->rho(Pc, T, elmnt().X());

scalar tmp = elmnt().N(rho)*pow(elmnt().d(), 2.0);
numerator += tmp*elmnt().d();
denominator += tmp;
}

}

reduce(numerator, sumOp<scalar>());
reduce(denominator, sumOp<scalar>());

return numerator/denominator;
}
as the problem disappeared when I commented it out.
piccinini is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Number of cells in mesh don't match with size of cellLevel colinB OpenFOAM Native Meshers: snappyHexMesh and Others 11 January 13, 2015 12:47
SnappyHexMesh for internal Flow vishwa OpenFOAM Native Meshers: snappyHexMesh and Others 23 August 6, 2014 03:50
Import netgen mesh to OpenFOAM hsieh Open Source Meshers: Gmsh, Netgen, CGNS, ... 32 September 13, 2011 05:50
Position of cells in a orthogonal grid alberto OpenFOAM Running, Solving & CFD 2 February 6, 2008 13:28
Grid Quality and the Solution Faraz Main CFD Forum 4 January 10, 2000 19:18


All times are GMT -4. The time now is 22:06.