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

dieselFoam: Summation of total droplet momentum in a Cell

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 17, 2010, 21:11
Default dieselFoam: Summation of total droplet momentum in a Cell
  #1
Member
 
N. A.
Join Date: May 2010
Posts: 64
Rep Power: 15
N. A. is on a distinguished road
Hello,

Can someone share their experience on how can total momentum of droplets in a cell be calculated and stored in a a variable. I am new to C++ language and I really need someone's experience in creating a new variables in dieselFoam.

Thanks,
Nir
N. A. is offline   Reply With Quote

Old   July 17, 2010, 23:15
Default
  #2
Senior Member
 
su_junwei's Avatar
 
su junwei
Join Date: Mar 2009
Location: Xi'an China
Posts: 151
Rep Power: 20
su_junwei is on a distinguished road
Send a message via MSN to su_junwei
Quote:
Originally Posted by N. A. View Post
Hello,

Can someone share their experience on how can total momentum of droplets in a cell be calculated and stored in a a variable. I am new to C++ language and I really need someone's experience in creating a new variables in dieselFoam.

Thanks,
Nir
You can do it like this

volVectorField moment
(
IOobject
(
"moment",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedVector("moment", dimensionSet(1, -2, -2, 0, 0),vector::zero)
);

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

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

Junwei
su_junwei is offline   Reply With Quote

Old   July 17, 2010, 23:52
Default
  #3
Member
 
N. A.
Join Date: May 2010
Posts: 64
Rep Power: 15
N. A. is on a distinguished road
Hi Junwei,

Thanks. Is this addition to be made in dieselFoam.C of the solver dieselFoam or should be added in one of the files in the ../src/dieselSpray.. directory.

Thanks,
Nir
N. A. is offline   Reply With Quote

Old   July 18, 2010, 04:21
Default
  #4
Senior Member
 
su_junwei's Avatar
 
su junwei
Join Date: Mar 2009
Location: Xi'an China
Posts: 151
Rep Power: 20
su_junwei is on a distinguished road
Send a message via MSN to su_junwei
Quote:
Originally Posted by N. A. View Post
Hi Junwei,

Thanks. Is this addition to be made in dieselFoam.C of the solver dieselFoam or should be added in one of the files in the ../src/dieselSpray.. directory.

Thanks,
Nir
I think you can do it in dieselFoam.

Junwei
su_junwei is offline   Reply With Quote

Old   August 26, 2010, 12:58
Default
  #5
Member
 
N. A.
Join Date: May 2010
Posts: 64
Rep Power: 15
N. A. is on a distinguished road
Hi Junwei,

I wish to add a variable in the lagrangian equations and solve for it. Just as we solve for x,d, m, T, etc for particle properties, I am trying to solve for distorted surface area for each particle and wish to calculate each time-step.

Do you know how another variable be added into lagrangian variables and solve for it.

Any ifnormation will be very helpful.

Thanks,
Nir
N. A. is offline   Reply With Quote

Old   August 26, 2010, 21:37
Default
  #6
Senior Member
 
su_junwei's Avatar
 
su junwei
Join Date: Mar 2009
Location: Xi'an China
Posts: 151
Rep Power: 20
su_junwei is on a distinguished road
Send a message via MSN to su_junwei
Hi Nir
You can add a variable into parcel class in /src/lagrangian/dieselSpray/parcel/
1) add variable
2) add read and write access function to this variable
3) add IO operation in parcelIO.C

You can alter the variable like the following code
cloudObject is the particle cloud. yourVariable is your variable name you defined.
for
(
spray::iterator particle = cloudObject.begin();
particle != cloudObject.end();
++particle
)
{
particle().yourVariable()=.... // do as you like.
}

Regards, Junwei
su_junwei is offline   Reply With Quote

Old   September 14, 2010, 09:37
Default
  #7
New Member
 
Palma González García
Join Date: May 2009
Location: Valencia, Spain
Posts: 8
Rep Power: 16
Palminchi is on a distinguished road
What a nice topic!

Last edited by Palminchi; September 20, 2010 at 07:48.
Palminchi is offline   Reply With Quote

Old   September 20, 2010, 07:43
Default
  #8
New Member
 
Palma González García
Join Date: May 2009
Location: Valencia, Spain
Posts: 8
Rep Power: 16
Palminchi is on a distinguished road
Dear su_junwei,

As far as I understand, if you are multiplying m()*U(), the dimmension of the vector when you defined it before should be (1 1 -1), shouldn't it?
Please, confirm if this is something I don't understand or something I can't see when you make the iterator programming.

And other question is, with the iterator, could I obtain the momentum flux of the droplets(which is m*U^2) ? And do you know how I could obtain the gas momentum?

Best regards and thank you very much,
Palma.
Palminchi 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
FvMatrix coefficients shrina OpenFOAM Running, Solving & CFD 10 October 3, 2013 14:38
Cells with t below lower limit Purushothama Siemens 2 May 31, 2010 21:58
Derivation of Momentum Equation in Integral Form Demonwolf Main CFD Forum 2 October 29, 2009 19:53
[Commercial meshers] Trimmed cell and embedded refinement mesh conversion issues michele OpenFOAM Meshing & Mesh Conversion 2 July 15, 2005 04:15
Warning 097- AB Siemens 6 November 15, 2004 04:41


All times are GMT -4. The time now is 10:56.