CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > 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 Search this Thread 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: 29
Rep Power: 17
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: 29
Rep Power: 17
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 Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
[snappyHexMesh] Number of cells in mesh don't match with size of cellLevel colinB OpenFOAM Meshing & Mesh Conversion 14 December 12, 2018 09:07
[snappyHexMesh] SnappyHexMesh for internal Flow vishwa OpenFOAM Meshing & Mesh Conversion 24 June 27, 2016 09:54
[Netgen] Import netgen mesh to OpenFOAM hsieh OpenFOAM Meshing & Mesh Conversion 32 September 13, 2011 06: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 04:34.