CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Extracting Liquid Penetration Length (http://www.cfd-online.com/Forums/openfoam-solving/122195-extracting-liquid-penetration-length.html)

ahcai007 August 14, 2013 07:23

Extracting Liquid Penetration Length
 
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

mturcios777 August 14, 2013 12:55

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.

ahcai007 August 16, 2013 06:14

Quote:

Originally Posted by mturcios777 (Post 445780)
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!!

ENKIME May 15, 2014 14:44

Liquid Length
 
1 Attachment(s)
Quote:

Originally Posted by mturcios777 (Post 445780)
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:confused:.
Hopping you can help.
Thanks a lot my friend
Kind regards

mturcios777 May 15, 2014 14:57

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!

ENKIME May 16, 2014 12:03

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.

sara91 March 2, 2016 17:42

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 ^^

ENKIME March 2, 2016 23:36

Quote:

Originally Posted by sara91 (Post 587763)
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

sara91 March 3, 2016 04:44

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 ^^

ENKIME March 5, 2016 23:51

Dear Sara
Sorry my mistake the correct command is paste; typo error.

Your welcome


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