CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

Extracting Liquid Penetration Length

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

Reply
 
LinkBack Thread Tools Display Modes
Old   August 14, 2013, 07:23
Default Extracting Liquid Penetration Length
  #1
New Member
 
Ah Cai
Join Date: Dec 2010
Location: Malaysia
Posts: 16
Rep Power: 8
ahcai007 is on a distinguished road
Hi,

I am using OF22x, sprayFoam.

I would like to output the Liquid Penetration Length (LPL) to a file so that I can plot it against runTime. But, I can't seem to find the correct function for LPL.

For 20x, the function to call is dieselSpray.penetration(0.95), but it does not work for sprayFoam in 22x.

Any advice is appreciated. Thanks!!



Ahcai
ahcai007 is offline   Reply With Quote

Old   August 14, 2013, 12:55
Default
  #2
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 728
Rep Power: 20
mturcios777 will become famous soon enough
Its similar for OF22x. but instead of dieselSpray.penetration(0.95), use parcels.penetration(0.95). The member function has the same name, but the spray is now called parcels as sprayFoam is more general than dieselFoam.
mturcios777 is offline   Reply With Quote

Old   August 16, 2013, 06:14
Default
  #3
New Member
 
Ah Cai
Join Date: Dec 2010
Location: Malaysia
Posts: 16
Rep Power: 8
ahcai007 is on a distinguished road
Quote:
Originally Posted by mturcios777 View Post
Its similar for OF22x. but instead of dieselSpray.penetration(0.95), use parcels.penetration(0.95). The member function has the same name, but the spray is now called parcels as sprayFoam is more general than dieselFoam.
Thanks a lot!! it works perfectly!!
ahcai007 is offline   Reply With Quote

Old   May 15, 2014, 14:44
Default Liquid Length
  #4
Member
 
yes
Join Date: Apr 2014
Posts: 32
Rep Power: 4
ENKIME is on a distinguished road
Quote:
Originally Posted by mturcios777 View Post
Its similar for OF22x. but instead of dieselSpray.penetration(0.95), use parcels.penetration(0.95). The member function has the same name, but the spray is now called parcels as sprayFoam is more general than dieselFoam.

Hello Mutricios
I'm also new at using openFoam so I really appreciate some advice with my issue.
I was running a simulation of diesel spray in openFoam with OpenFoam 2.2.2.
I need a way to extract liquid length (LL) not liquid penetration(penetracion) to get a graph like the one attach.
I'm running out of sources of information because the specific of the problem.
Hopping you can help.
Thanks a lot my friend
Kind regards
Attached Images
File Type: jpg Screenshot from 2014-05-13 18:29:30.jpg (41.5 KB, 74 views)
ENKIME is offline   Reply With Quote

Old   May 15, 2014, 14:57
Default
  #5
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 728
Rep Power: 20
mturcios777 will become famous soon enough
I don't believe there is a default function for calculating the liquid length, though I could be wrong. You'll have to search the Kinematic library for sprays to see if something is there. Or you'll need to add that function, which doesn't look too difficult. You'll have to follow a similar procedure that the penetration function uses, but instead of averaging with mass, just take the max of all the distances. Good luck!
mturcios777 is offline   Reply With Quote

Old   May 16, 2014, 12:03
Default
  #6
Member
 
yes
Join Date: Apr 2014
Posts: 32
Rep Power: 4
ENKIME is on a distinguished road
Thanks a lot for the quick answer my friend I really appreciate your time.
Really I'm a rookie in this, but exactly where can I find the statement that, need to be added, in the main solver or in the cloud properties?
Also I'm using foamLog for extract that information and bash commands for the penetration do you know a simplest way for extract the information?
King regards.
ENKIME is offline   Reply With Quote

Old   March 2, 2016, 17:42
Post
  #7
New Member
 
Join Date: Feb 2016
Location: Italy
Posts: 4
Rep Power: 2
sara91 is on a distinguished road
Hi!
I am new to OpenFOAM too and I need to output LPL to a file so that I can plot it against runTime.
My problem is that I really don't know what to do. I mean: how do I use parcels.penetration?
I am currently using OF version 3.0.x with sprayFoam solver.
Thank you in advance ^^
sara91 is offline   Reply With Quote

Old   March 2, 2016, 23:36
Default
  #8
Member
 
yes
Join Date: Apr 2014
Posts: 32
Rep Power: 4
ENKIME is on a distinguished road
Quote:
Originally Posted by sara91 View Post
Hi!
I am new to OpenFOAM too and I need to output LPL to a file so that I can plot it against runTime.
My problem is that I really don't know what to do. I mean: how do I use parcels.penetration?
I am currently using OF version 3.0.x with sprayFoam solver.
Thank you in advance ^^
Dear Sara
I use to have the same issue, so as I was recommended, you can record your simulation in a log file, when it finish you can use bash commands such as grep, to extract file, awk to manipulate data and other to extract certain lines in the log file such as penetration and time.
Using this commands you can extract the penetration and the time and plot it.
I suggest this commands:
ps -ef |grep "" log| more » time.txt
This command will extract from the log file all the coincidences of the word time in all the lines you can also do it with the Liquid penetration.

awk '{$3 = $3*a; print$3}' a=1000 tim.txt » time1.txt

This will print all the numbers, however the time in the log file is in seconds, a common practice is to set it in miliseconds so you can multiply for 1000.

Finally
past time1.txt liquid1.txt | awk'{print$1, $2}' »LL.txt

This will create a txt file with two columns of time and liquid penetration and you can plot as you wish, I recommend plot in veusz, quite good ploter.

Hope this help

Kind Regards
ENKIME is offline   Reply With Quote

Old   March 3, 2016, 04:44
Post
  #9
New Member
 
Join Date: Feb 2016
Location: Italy
Posts: 4
Rep Power: 2
sara91 is on a distinguished road
Hi ENKIME!
Thank you very much for answering so quickly, your reply has been very helpful.
I have just another question on the last command you wrote, past time1.txt liquid1.txt | awk'{print$1, $2}' »LL.txt . As I tried it as it is it gave me this error:

No command 'past' found, did you mean:
Command 'pat' from package 'dist' (universe)
Command 'paste' from package 'coreutils' (main)
Command 'nast' from package 'nast' (universe)
Command 'pass' from package 'pass' (universe)
Command 'last' from package 'sysvinit-utils' (main)
past: command not found
awk{print$1, $2}: command not found

I thought I should try with paste, and as a result it gives me again the last error line, awk{print$1, $2}: command not found.

Do you have any suggestion on on how can I fix it? Sorry if this is a silly question, I really have only the basis to work with OF...

Thank you again ^^

I think I resolved, it seems it was just a typo.
Thank you anyway ^^

Last edited by sara91; March 3, 2016 at 17:14.
sara91 is offline   Reply With Quote

Old   March 5, 2016, 23:51
Default
  #10
Member
 
yes
Join Date: Apr 2014
Posts: 32
Rep Power: 4
ENKIME is on a distinguished road
Dear Sara
Sorry my mistake the correct command is paste; typo error.

Your welcome
ENKIME is offline   Reply With Quote

Old   October 20, 2016, 17:28
Default
  #11
New Member
 
Luis Fernando Rua Mojica
Join Date: May 2016
Location: Monterrey - México
Posts: 7
Rep Power: 2
ruamojica is on a distinguished road
Hello friends,

I think is more simple to prepare a file from de begining of simulation. I use logfiles to write the information in each loop. There we can extract all the information what we want. the procedure is create two files, those can be taked of the solver sprayEngineFoam:

logSumary.H
startSummary.H

They can be copied to the folder sprayFoam (a level up from the sprayEngineFoam).

After that, we modify the file sprayFoam.C to call the files in the simulation.

Then is necessary recompile the solver, being at the ubication of the solver we ejecute wclean and wmake.

I attach the files that I prepared.

I'm sorry for bad english
Attached Files
File Type: c sprayFoam.C (3.3 KB, 2 views)
File Type: h logSummary.H (548 Bytes, 4 views)
File Type: h startSummary.H (378 Bytes, 1 views)
ruamojica is offline   Reply With Quote

Old   October 20, 2016, 17:30
Default
  #12
New Member
 
Luis Fernando Rua Mojica
Join Date: May 2016
Location: Monterrey - México
Posts: 7
Rep Power: 2
ruamojica is on a distinguished road
I have a question. Why the solver deliver the LPL at 95% and not the 100%?
ruamojica is offline   Reply With Quote

Old   October 20, 2016, 17:44
Default
  #13
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 728
Rep Power: 20
mturcios777 will become famous soon enough
95% is pretty standard for liquid spray penetration studies, as the remaining 5% of mass is vapour during injection (due to self similarity). You are free to write your own function that uses whatever fraction you like, but there isn't much point as pretty well everyone uses 95%:

http://homepages.cae.wisc.edu/~hesse...n%20andSmr.htm
mturcios777 is offline   Reply With Quote

Old   October 20, 2016, 17:53
Default
  #14
New Member
 
Luis Fernando Rua Mojica
Join Date: May 2016
Location: Monterrey - México
Posts: 7
Rep Power: 2
ruamojica is on a distinguished road
thanks so much!!!
ruamojica is offline   Reply With Quote

Reply

Tags
dieselspray, sprayfoam

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
Turbulence length scale and integral length scale rizhang CFX 2 April 22, 2016 07:22
Liquid penetration length and lift-off length lunar1984 STAR-CD 2 June 16, 2013 16:14
ploting liquid penetration mooyii OpenFOAM 2 September 9, 2011 18:24
Determination of liquid length in fluent jwillie2000 FLUENT 0 August 6, 2010 11:21
Need some help for total liquid fraction linus FLUENT 0 December 19, 2006 04:29


All times are GMT -4. The time now is 19:16.