CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (https://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   how to monitor free surface elevation vs time in OF? (https://www.cfd-online.com/Forums/openfoam-post-processing/64462-how-monitor-free-surface-elevation-vs-time.html)

luchen2408 July 11, 2013 09:51

hi, Jane,
I have tried your method and I wmake, I got a file sample file, then I run the sample file. I can get the set and surface file. I found that the Z coordinate is negative in some time file. That means it is not based on the local coordinate system, it is also based on the globle coordinate system. I don't konw why.
BTW, I use OpenFOAM 1.7.1. what about you? is that because the different version?

pici July 11, 2013 10:04

Hi Jane,
I'm new of OpenFOAM, but your suggestion was really useful to address my problem.
Do you have some suggestion about to find the VOF level of a single point? or to trace in time the distance from a given point relative to the free surface?
Thank you in advance
Piero

pici July 11, 2013 13:30

Quote:

Originally Posted by luchen2408 (Post 439191)
hi, Jane,
I have tried your method and I wmake, I got a file sample file, then I run the sample file. I can get the set and surface file. I found that the Z coordinate is negative in some time file. That means it is not based on the local coordinate system, it is also based on the globle coordinate system. I don't konw why.
BTW, I use OpenFOAM 1.7.1. what about you? is that because the different version?

Hi Luchen,
I'm the last come, but perhaps I can participate to your discussion, because my problem is sloshing of a ship vessel and I too need to evaluate the free surface level in some position of my vessel (along a measuring laser ray bar).
I just did modifications suggested by Jane and I have my own sample running.
It works well, and I made the same modifications to probeLocations (it is located in same directory of sample).
I can state that both modified applications work very well, in Local Coordinates System.
I' m using rel. 2.1, so your trouble can be real.
Attached I send my modifications to probeLocations
Quote:

runTime.setTime(timeDirs[timeI], timeI);
Info<< "Time = " << runTime.timeName() << endl;

// Handle geometry/topology changes
// polyMesh::readUpdateState state = mesh.readUpdate();

// if
// (
// state == polyMesh::POINTS_MOVED
// || state == polyMesh::TOPO_CHANGE
// )
As you can see, changes are perfectly equivalent to Jane's changes.
Result of the probeLocations is a single file (ready for LibreOfficeCalc) that list, at time base, the VOF scalar (alpha1 in rel. 2.1.0) for each point indicated in probeDict file.
I hope to be useful.
A lot of thanks to Jane and to you, because I'm saving a lot of time and I'm learning a lot of OF features.
Bye
Piero

luchen2408 July 12, 2013 02:19

hello, Pici,I am also working on the sloshing vessel, I want to plot the max liquid level with time,not some position, because the vessel is moving with 6 DOF motion. The max liquid level will change to different location.I hope my local coordinate system can be transform and rotate with my model, then I can get the max liquide level.

Jane L July 12, 2013 02:36

hi luchen and wellcome to the discussion Piero!

@luchen: are the results the same as you get without the modification? Are there more parts of the code that have to do with the moving of the geometry?
I'm using OF2.1.1, so there might be the reason as this also fits to Piero's post. Is there a chance to uptade to 2.x?

@pici: Finding the location of the free surface elevation was also my objective. I wrote a script for octave (uses matlab syntax) to get a plot of the elevation for a certain location over time. I can send you that file but since I have one more week off, you would have to wait a bit ;)

kind regards

pici July 12, 2013 03:25

hi Jane, hi Luchen
I'm sure that Jane's method insure that data are extracted in Local Coord.Sys.
I tested it using an example made by a big cube (4meters x side, centered in 0,0,0) that oscillates about 10deg around an axis parallel to x passing through the lower base.
Using original sample with a line coincident with one of four box's vertical edge, I found that, except for time 0, in all time step the line is outside the box (receiving a lot of warning), while using my_sample with same line I have all results (coherent with Paraview plots). Same for my_probeLocation.
Advantage of probeLocation is that all results are in a single table.
@luchen: I think you should find a way to install rel. 2.1.0 (at least). My problem is the same as your, but I must calculate three rotations (pitch, roll, yawn) separately, because of my customer need.
@Jane: many thanks for your help: I will wait for your file.

Have a good day
Piero

luchen2408 July 12, 2013 03:44

hi,Jane and Pici,
Thanks for your advance, I will update OpenFOAM to 2.1.1 and try once more. I will give the result later.

luchen2408 July 17, 2013 04:08

hi,Jane and Pici,
I have tried the openFOAM 1.7.1 and OpenFOAM 2.1.1, there is some different code name and I tested the simulation. Unfortunately,I found the result is the same.I extract the result from the generated surface file. There isn't any difference between 1.7.1 and 2.1.1 version.

pici July 18, 2013 08:52

2 Attachment(s)
Quote:

Originally Posted by luchen2408 (Post 440228)
hi,Jane and Pici,
I have tried the openFOAM 1.7.1 and OpenFOAM 2.1.1, there is some different code name and I tested the simulation. Unfortunately,I found the result is the same.I extract the result from the generated surface file. There isn't any difference between 1.7.1 and 2.1.1 version.

Hi Jane and Luchen,
:o I suspect some stupid mistake: e.g., first time I tried to produce my_sample, I forgot to comment ALL instruction referencing change of geometry. No compiling error, but wrong results!
So I'm sending to you my (working) source code for my_sample and my_probeLocation (their name are still like the original, but dirs have the new name and compiled utils have the new name too).
I can state that they are working well and I'm using both for my job.
Good luck
Piero

luchen2408 July 18, 2013 10:16

hi,Jane and Pici,
Thanks for your comment and patience, I found that I made a mistake. I generated different sample file, but I took the same command 'sample'. Actually, I have to take the command './sample' after I took the new sample file. I just made a test and I got the different result. Thank you very much. It stopped me for a long time.

Jane L July 18, 2013 14:48

I'm glad to hear that it's now finally solved! May be this is helps other readers: Does it also work for OF1.7?

Kind regards Jane

Jane L July 22, 2013 03:58

1 Attachment(s)
hi,

here is the script I use to handle the data. It's written for Octave which uses Matlab syntax but is available under GNU license. Check: http://www.gnu.org/software/octave/

As you will see the script simply looks for the first phase-change, hence breaking waves will not be noticed.

Good luck!

luchen2408 July 23, 2013 08:00

yes,It also work for O.F.1.7.1

pici July 28, 2013 05:35

Hi Jane,
thank you for your script. I will test it immediately.
At the end, I decided to use my_probeLocation , because measuring levels are made using two small (but long) tubes inside the tank, so a couple of vertical lines (in Tank Coord Sys) are enough to analyze small free surface level; the advantage is that I don't have a set of files (one per each time step) but only a single file (like a spreadsheet) where the first column is the time and all data are ordered using my points ordered coordinates, while the disadvantage is that I have to interpolate the right Z-level using octave or Scilab.
Again thank you for your absolutely fantastic help.
Ciao
Piero

p.s. do you have any experience in integrating solvers? e.g., now I should solve the same sloshing problem, but with Three or Four different fluids together, so I need to integrate interDymFoam with multiphaseInterFoam . . . .

Nig̣ October 29, 2013 10:39

Hi ,Jane L and pici,

I'm trying to follow your procedure for modify the probeLocation.C and the sample.C files; but if I go in the directory where these file are stored I cannot save the modification (lines commented ) , I've also tryed to cancel and copy the same directory but when I compile the new C file it give me an error.

Can you give me a more detailed explanation to how set properly the new C files ??

pici October 31, 2013 09:33

Hi Nig̣,
it seems to be a permission's problem.
Because I don't know with which operating system are you working,in Linux term speaking, you have to be sure to be 'superuser' to clone the original probe_Location directory into a new dir, edit files and compile it.
But, perhaps, I can go wrong . . .
Let me know more details and how you job proceeds
bye
Piero

nctiwary September 14, 2015 08:11

how to plot wave surface elevation,pressure,velocity and force
 
hello guys
how to plot wave surface elevation,pressure,velocity and force w.r.t distance and time in IHFOAM..pls provide me the easiest way to do so


All times are GMT -4. The time now is 20:07.