|
[Sponsors] |
April 15, 2009, 06:34 |
Pressure Gradient in channelOodles
|
#1 |
Senior Member
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 20 |
Hello World.
Is there a way to "monitor" the pressure gradient in channelOodles? I started a simulation with a given bulk velocity and let it run in hope the pressure gradient would converge - which it does! Unfortunately I simulated far too long, so the pressure gradient has reached a constant value long time ago. I tried to use foamLog to have a look at the log file and to get a glimpse at which timestep the pressure gradient became constant. But foamLog is not reporting the value for the pressure gradient. Do you have any ideas, how I can determine the value for the pressure gradient over time from the log file?
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!" |
|
April 16, 2009, 06:22 |
|
#2 |
Senior Member
|
Hi Sebastian,
Have a look at pyFoam in the OpenFOAM Wiki, it may suit your needs. It has pyFoamPlotWatcher utility, that allows you for monitoring custom variables, like the pressure gradient. As an alternative, if you do: tail -f <log_file> | grep 'pressure gradient' it will also work. Regards, Jose Santos |
|
April 18, 2009, 06:56 |
|
#3 | |
Senior Member
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 20 |
Quote:
Thanks for your answer. I avoided pyFoam because it looks really confusing with all these libraries you have to write. I'm happy enough I managed to read the C++ from OpenFOAM and I'm not quite sure if I can do this with Pearl. Meanwhile I tried to use the tail -f <log_file> | grep 'pressure gradient' but it just gave one output: "pressure gradient" and thats it. I even had to kill the process using Ctrl + C. So I'm still stuck. Does this mean I have to walk the dark and stony way to pyFoam?
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!" |
||
April 18, 2009, 13:02 |
|
#4 |
Senior Member
|
Hi Sebastian,
With pyFoam you dont have to write any library (at least to do what you want). Have a look in http://openfoamwiki.net/index.php/Co...omRegexp-files In what concerns the tail command, it will only work if your simulation is running, with your log file being updated on the fly. If you start your run with: channelOodles > log & and then you run the tail command, it will definitely work. Regards, Jose Santos |
|
April 18, 2009, 13:33 |
|
#5 |
New Member
Nikolaos Spyrou
Join Date: Mar 2009
Posts: 22
Rep Power: 17 |
Hi,
another possibility for monitoring the pressure gradient is the following: create for example a volScalarField "X" which gets his value from gradP in channelOodles. Then you can set "X" in the probes part in the controlDict and you will have the time series of gradP. For doing it that way it is necessary to add some lines in the top level code and recompile it but its anotherone of probably many solutions. Nikos |
|
April 18, 2009, 14:06 |
|
#6 | |
Senior Member
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 20 |
Quote:
What about using the view command instead?
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!" |
||
April 18, 2009, 15:44 |
|
#7 |
Senior Member
|
If your simulation is over, you could do:
cat <log_file> | grep 'pressure gradient' If you want to send it to a text file instead of terminal: cat <log_file> | grep 'pressure gradient' > textFile.txt You could afterwards post-process this text file in Octave or Matlab. I am not familiar with the view command, sorry. Regards, Jose Santos |
|
June 29, 2009, 18:57 |
channelOodles
|
#8 |
Member
mohd mojab
Join Date: Mar 2009
Posts: 31
Rep Power: 17 |
Hello
In channelOodles.C or oodles.C , in "PISO loop" there is if (corr == nCorr-1 && nonOrth == nNonOrthCorr) { pEqn.solve(mesh.solver(p.name() + "Final")); } else { pEqn.solve(mesh.solver(p.name())); } instead of pEqn.solve(); in turbFoam.C or icoFoam.C. Would you explain for me, what this section do, and why we need to have it in channelOodles.C? Thank you Mou |
|
August 11, 2009, 17:20 |
Comparison of pressure behavior in 5 periodic cells in icoFoam and channelOodles
|
#9 |
Member
mohd mojab
Join Date: Mar 2009
Posts: 31
Rep Power: 17 |
Hello
I compared the pressure gradient along 5 periodic unit cells for two solver icoFoam and channelOodles. The results are shown below: for icoFoam, we have inlet and outlet, icoFoam_Up.JPG icoFoam.JPG for channelOodles, the inlet and outlet are cyclic, channelOodles_Up.JPG channelOodles.JPG according to the icoFoam, it should be pressure drop along the whole channel, but in channelOodles, the pressure does not drop and it cycle in each cell. wold you explain why there is this wrong behavior for pressure gradient for channelOodles solver? Thank you Moe |
|
August 12, 2009, 03:21 |
Please give a detailed explanation.
|
#10 | |
Senior Member
Sandy Lee
Join Date: Mar 2009
Posts: 213
Rep Power: 18 |
Quote:
Is your method: step 1: In the file pdEqn. H of the solver, add a line: volScalarField X = fvc :: grad(p) step 2: In the controlDict(???) or createFields.H (??), write an output (or input?? I don't know) as follows: volScalarField X ( IOobject ( "X", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), fiv :: grad(p) ); ?? I guess I am wrong. I never use it, however I want to try. In addition, how can you set "X" in the probes part in the controlDict? Could you give me a detailed explanation? Thanks a lot. |
||
August 12, 2009, 06:01 |
for example
|
#11 |
Senior Member
Sandy Lee
Join Date: Mar 2009
Posts: 213
Rep Power: 18 |
For example:
functions ( probes { // Type of functionObject type probes; // Name of the directory for the probe data name probes; // Locations to be probed. runTime modifiable! probeLocations ( (0 9.95 19.77) (0 -9.95 19.77) ); // Fields to be probed. runTime modifiable! fields ( p ); } wallPressure { // Type of functionObject type surfaces; // Where to load it from (if not already in solver) functionObjectLibs ("libsampling.so"); // Output every 10th time step interval 10; surfaceFormat raw; fields ( p ); surfaces ( walls { type patch; patchName walls; triangulate false; } ); } ); I find it in the controlDict of the sloshingTank2D in the interDyMFoam solver. Is it about the set of the probe? Who can explain it? Thanx |
|
August 12, 2009, 06:10 |
|
#12 |
New Member
Nikolaos Spyrou
Join Date: Mar 2009
Posts: 22
Rep Power: 17 |
Hi Sandy,
I wanted to get a probe of the driving pressure gradient. Probes are defined in the controlDict that way: functions ( probes1 { // Type of functionObject type probes; // Where to load it from (if not already in solver) functionObjectLibs ("libsampling.so"); // Locations to be probed. runTime modifiable! probeLocations ( (x y z)//your coordinates ); // Fields to be probed. runTime modifiable! fields ( gradPField //for example ); } ); There you see, that only fields can be probed, not scalars like gradP in channelOodles. So you have to create a field containing the value of gradP (I called it gradPField) in order to get the probes of it. Creating gradPField: 1. create the following two fields in createFields.H: volScalarField FieldOnes ( IOobject ( "FieldOnes", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE ), mesh,gradP/gradP ); volScalarField gradPField ( IOobject ( "gradPField", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE ), mesh,scalar(0)*gradP ); FieldOnes contains only ones. 2. add the following line in channelOodles.C: after gradP += gragPplus; add: gradPField = gradP * FieldOnes; What I did is not elegant but it works. Nikos |
|
August 12, 2009, 06:44 |
|
#13 |
Senior Member
Sandy Lee
Join Date: Mar 2009
Posts: 213
Rep Power: 18 |
Hi Nikos, how can I set the "probeLocations" namely the coordinates? you think. Thanks.
|
|
August 12, 2009, 06:48 |
|
#14 |
New Member
Nikolaos Spyrou
Join Date: Mar 2009
Posts: 22
Rep Power: 17 |
instead of (x y z) you edit the coordinates of the points you want to probe in your domain.
Nikos |
|
August 12, 2009, 07:21 |
|
#15 |
Senior Member
Sandy Lee
Join Date: Mar 2009
Posts: 213
Rep Power: 18 |
||
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Neumann pressure BC and velocity field | Antech | Main CFD Forum | 0 | April 25, 2006 03:15 |
Gas pressure question | Dan Moskal | Main CFD Forum | 0 | October 24, 2002 23:02 |
pressure gradient term in low speed flow | Atit Koonsrisuk | Main CFD Forum | 2 | January 10, 2002 11:52 |
Hydrostatic pressure in 2-phase flow modeling (CFX4.2) | HB &DS | CFX | 0 | January 9, 2000 14:19 |
Hydrostatic pressure in 2-phase flow modeling (long) | DS & HB | Main CFD Forum | 0 | January 8, 2000 16:00 |