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

how to monitor free surface elevation vs time in OF?

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

Like Tree5Likes

Reply
 
LinkBack Thread Tools Display Modes
Old   October 30, 2009, 12:01
Default
  #21
Member
 
Robert Castilla
Join Date: Apr 2009
Location: Spain
Posts: 79
Rep Power: 8
rcastilla is on a distinguished road
Hi, Kumar,
in fact, parasitic current are important in my case. I have found a way to reduce them. As this subject is so different to "contour plottings", I have open a new thread. Please, have a look in parasitic currents and give me your opinnion.

Best regards

Robert
rcastilla is offline   Reply With Quote

Old   July 6, 2010, 05:01
Default
  #22
New Member
 
yannH
Join Date: Feb 2010
Posts: 26
Rep Power: 7
yannH is on a distinguished road
Hi everyone,

Is there an other way to get surface elevation, I mean without using a personnal script ?

My goal is to have the distance between my still water level and the interface when alpha1 is 0.5.

thanks

Yann
yannH is offline   Reply With Quote

Old   July 6, 2010, 06:09
Default
  #23
Senior Member
 
Suresh kumar Kannan
Join Date: Mar 2009
Location: Luxembourg, Luxembourg, Luxembourg
Posts: 129
Rep Power: 8
kumar is on a distinguished road
Hello yannH,
It is possible to extract the elevation of the liquid interface without using a personal script in paraview. But you still have to run the sample script, which comes with OpenFoam. You can extract the isosurface as at alpha 0.50 and then write the solution in vtk format. Then open paraview (not paraFoam) and load the .vtk file. The you can can use the slice option to get a section of your surface. Then use the (select points on) option from the edit menu. Then use the (extract selection) filter from the filters menu. Then open another window on the same screen by using split horizontal option, then use spread sheet view.

This will give you the coordinates of the interFace based on the points you selected. This is an easy way of extraction of elevation of the interface.

hope it helps
kumar is offline   Reply With Quote

Old   July 7, 2010, 11:32
Default
  #24
New Member
 
yannH
Join Date: Feb 2010
Posts: 26
Rep Power: 7
yannH is on a distinguished road
Hi Kumar,

Thanks for replying, I succeed with your explaination (I'm just looking after how to create a plot using the spreadsheet)

Do you think it's possible, I mean not too hard, to implement a variable for surface elevation directly in my interDyMFoam code ? because it would be quite simple for postprocess my cases !

regards,

Yann
yannH is offline   Reply With Quote

Old   November 11, 2010, 01:50
Exclamation urgent help needed...surface elevetion in wave tank
  #25
New Member
 
krishna
Join Date: Sep 2010
Posts: 6
Rep Power: 6
krishnaprasad is on a distinguished road
i am doing a wave tank problem in fluent. i have generated waves..i got wave elevation v/s tank length plot at iso-vof=o.5.. but i have a problem in ploting wave elevation v/s time..please help me.. it is urgent,,,...thank you in advance
krishnaprasad is offline   Reply With Quote

Old   December 1, 2010, 09:52
Default
  #26
Senior Member
 
Join Date: Nov 2010
Posts: 113
Rep Power: 6
lindstroem is on a distinguished road
Hi all,

I as well used the suggested code from ozgur. But I have a Problem: The genHOF.c doesnt finish the line "scanf("%f",&swl);" (round about line 20). I placed an output in the line afterwards, which was never reached.

The file height.dat is build, but empty and times contains all my timesteps.

Does anyone has an idea what might be wrong?

-> My fault.. I just have to enter it.. maybe sth was wrong in my input before...

Thanks in advance!

Last edited by lindstroem; December 2, 2010 at 06:36.
lindstroem is offline   Reply With Quote

Old   December 10, 2010, 06:29
Default
  #27
Member
 
Duong A. Hoang
Join Date: Apr 2009
Location: Delft, Netherlands
Posts: 92
Rep Power: 8
duongquaphim is on a distinguished road
Send a message via Yahoo to duongquaphim
Hi Krishna,

I think you can use sampleDict to extract isosurface plane at each time step in post-processing. Or more simple, just load data to paraview and plot the isosurface alpha = 0.5 in time.

Regards,

Duong
duongquaphim is offline   Reply With Quote

Old   January 1, 2011, 14:03
Smile Doubt about the integration method
  #28
Member
 
Charlie
Join Date: Dec 2010
Location: 415 Kinross Dr. Newark, DE 19711
Posts: 78
Rep Power: 6
cheng1988sjtu is on a distinguished road
Hi ozgur,

I'm actually not so comfortable with the integration method. We can find it OK in theoretic work, but there are many grids in which the gamma are between 0 and 1.

moreover, when there are some special situations such as overturning, then the integration method should be invalid.

In fact, if we have enough nPoints in the sampling, I believe, the criteria gamma[n]>0.5, gamma[n+1]<0.5 may be a better choice.

Any opinions are welcome. Thank you!

Zhen Cheng


Quote:
Originally Posted by ozgur View Post
Hi Niels,

Thanks for the hints.. In fact I myself was suspicious about to locate gamma=0.5 (at least by a linear interpolation).

Anyway after some dirty coding, I managed to get following results for the sloshingTank2D3DoF tutorial.



The correct location of the free surface is important for me, because I want make comparisons with experimental results.

Ozgur



Just to complete, a sampled gamma data looks like this for an individual time step:


x y z gamma
0 0 -10 1
0 0 -9.69697 1
0 0 -9.39394 1
0 0 -9.09091 1
0 0 -8.78788 1
0 0 -8.48485 1
0 0 -8.18182 1
0 0 -7.87879 1
0 0 -7.57576 1
0 0 -7.27273 1
0 0 -6.9697 1
0 0 -6.66667 1
0 0 -6.36364 1
0 0 -6.06061 1
0 0 -5.75758 1
0 0 -5.45455 1
0 0 -5.15152 1
0 0 -4.84848 1
0 0 -4.54545 1
0 0 -4.24242 1
0 0 -3.93939 0.999999
0 0 -3.63636 0.999999
0 0 -3.33333 0.999999
0 0 -3.0303 0.998297
0 0 -2.72727 0.998297
0 0 -2.42424 0.998297
0 0 -2.12121 0.875845
0 0 -1.81818 0.875845
0 0 -1.51515 0.875845
0 0 -1.21212 0.251325
0 0 -0.909091 0.251325
0 0 -0.606061 0.251325
0 0 -0.30303 0.00170957
0 0 -4.10783e-15 0.00201351
0 0 0.30303 0.00201351
0 0 0.606061 0.00201351
0 0 0.909091 2.12627e-05
0 0 1.21212 2.12627e-05
0 0 1.51515 2.12627e-05
0 0 1.81818 5.35303e-08
0 0 2.12121 5.35303e-08
0 0 2.42424 5.35303e-08
0 0 2.72727 1.30219e-11
0 0 3.0303 1.30219e-11
0 0 3.33333 1.30219e-11
0 0 3.63636 1.03978e-16
0 0 3.93939 1.03978e-16
0 0 4.24242 1.03978e-16
0 0 4.54545 4.42707e-24
0 0 4.84848 4.42707e-24
0 0 5.15152 4.42707e-24
0 0 5.45455 3.07062e-36
0 0 5.75758 3.07062e-36
0 0 6.06061 3.07062e-36
0 0 6.36364 1.69305e-52
0 0 6.66667 1.69305e-52
0 0 6.9697 1.69305e-52
0 0 7.27273 -1.2664e-58
0 0 7.57576 -1.2664e-58
0 0 7.87879 -1.2664e-58
0 0 8.18182 -1.11574e-57
0 0 8.48485 -1.11574e-57
0 0 8.78788 -1.11574e-57
0 0 9.09091 -2.91388e-57
0 0 9.39394 -2.91388e-57
0 0 9.69697 -2.91388e-57
0 0 10 -2.91388e-57
0 0 10.303 -2.28496e-57
0 0 10.6061 -2.28496e-57
0 0 10.9091 -1.05445e-57
0 0 11.2121 -1.05445e-57
0 0 11.5152 -1.05445e-57
0 0 11.8182 -3.28503e-58
0 0 12.1212 -3.28503e-58
0 0 12.4242 -3.28503e-58
0 0 12.7273 -7.07185e-59
0 0 13.0303 -7.07185e-59
0 0 13.3333 -7.07185e-59
0 0 13.6364 -1.11157e-59
0 0 13.9394 -1.11157e-59
0 0 14.2424 -1.32059e-60
0 0 14.5455 -1.32059e-60
0 0 14.8485 -1.32059e-60
0 0 15.1515 -1.17364e-61
0 0 15.4545 -1.17364e-61
0 0 15.7576 -1.17364e-61
0 0 16.0606 -7.47976e-63
0 0 16.3636 -7.47976e-63
0 0 16.6667 -7.47976e-63
0 0 16.9697 -3.43373e-64
0 0 17.2727 -3.43373e-64
0 0 17.5758 -8.76047e-66
0 0 17.8788 -1.34639e-65
0 0 18.1818 -1.34639e-65
0 0 18.4848 -1.48939e-67
0 0 18.7879 -1.48939e-67
0 0 19.0909 -1.48939e-67
0 0 19.3939 -1.95727e-70
0 0 19.697 -1.95727e-70
0 0 20 -1.95727e-70
cheng1988sjtu is offline   Reply With Quote

Old   August 7, 2011, 13:08
Default segmentation fault
  #29
New Member
 
Eliz Nurieva
Join Date: Jul 2011
Location: Maynooth
Posts: 2
Rep Power: 0
Eliz is on a distinguished road
Hi everybody,

I also try to plot surface elevation vs time and I copied Ozgur's C code, compiled and execute but it gives segmentation fault for some reason. Do you have any idea why it might happen?? Thanks in advance

Regards,
Eliz
Eliz is offline   Reply With Quote

Old   August 7, 2011, 17:36
Default check the code for openfile name?
  #30
Member
 
Charlie
Join Date: Dec 2010
Location: 415 Kinross Dr. Newark, DE 19711
Posts: 78
Rep Power: 6
cheng1988sjtu is on a distinguished road
please check the file name that you need to read and also the size of the dimensions in the code ( defaultly 15000, I think , but not sure, this number should be larger than the size of the file that you need to read) cheers!

Zhen

Quote:
Originally Posted by Eliz View Post
Hi everybody,

I also try to plot surface elevation vs time and I copied Ozgur's C code, compiled and execute but it gives segmentation fault for some reason. Do you have any idea why it might happen?? Thanks in advance

Regards,
Eliz
cheng1988sjtu is offline   Reply With Quote

Old   August 8, 2011, 08:29
Default
  #31
New Member
 
Eliz Nurieva
Join Date: Jul 2011
Location: Maynooth
Posts: 2
Rep Power: 0
Eliz is on a distinguished road
Thanks for your reply Zhen, The dimensions are 1500 and the name of the file looks fine.

I run it by using "gdb" with the help of this link, to see what the error is,

http://www.unknownroad.com/rtfm/gdbtut/gdbsegfault.html

and it said "Source file name is more recent than executable" . Do you have any idea why it says so??any suggestions??Thanks a lot!!

Regards,
Eliz
Eliz is offline   Reply With Quote

Old   August 8, 2011, 09:03
Default make sure the file is ok
  #32
Member
 
Charlie
Join Date: Dec 2010
Location: 415 Kinross Dr. Newark, DE 19711
Posts: 78
Rep Power: 6
cheng1988sjtu is on a distinguished road
Hi,

what format is the data file?

try to use vim to open the file and see if the first few lines are data or description words.

and make sure that the executive file (e.g> a.out) is in the right folder, :-)

Zhen

Quote:
Originally Posted by Eliz View Post
Thanks for your reply Zhen, The dimensions are 1500 and the name of the file looks fine.

I run it by using "gdb" with the help of this link, to see what the error is,

http://www.unknownroad.com/rtfm/gdbtut/gdbsegfault.html

and it said "Source file name is more recent than executable" . Do you have any idea why it says so??any suggestions??Thanks a lot!!

Regards,
Eliz
cheng1988sjtu is offline   Reply With Quote

Old   December 21, 2012, 02:52
Default sample with solidBodyMotionFvMesh
  #33
New Member
 
Jane L
Join Date: May 2012
Posts: 21
Rep Power: 4
Jane L is on a distinguished road
Hi FOAMers!

I have another question related to this topic. I'm also using the sample-utility to write the values for alpha1 (gamma) along a line into files for each time step. This can be read easily by octave.
I figured out that sample takes the data along a line in the fixed coordinate system. In my case (sloshing in a tank) I would like to sample the data along a line in the relative coordinate system of the tank which is moved by solidBodyMotionFvMesh.
Does anyone know how to do that?

Thanks a lot!
luchen2408 and pici like this.

Last edited by Jane L; January 8, 2013 at 08:22.
Jane L is offline   Reply With Quote

Old   May 1, 2013, 09:18
Default
  #34
Member
 
luchen
Join Date: Jul 2011
Posts: 30
Rep Power: 5
luchen2408 is on a distinguished road
hello,jane, I have the same problem with you ,I also need to make the plot of the liquid level with time, and I want to make the relative coordiate system moving with the model. Have you solved the problem?

Last edited by luchen2408; May 1, 2013 at 10:15.
luchen2408 is offline   Reply With Quote

Old   May 6, 2013, 02:05
Default
  #35
New Member
 
Jane L
Join Date: May 2012
Posts: 21
Rep Power: 4
Jane L is on a distinguished road
Hi luchen2408!

I hope my reply still helps a few days later. Go to the folder for the sample utility (OpenFOAM-2.1.1/applications/utilities/postProcessing/sampling/sample), make your own copy of that folder (for example relatveSample) and outcomment following lines in the *.C file:

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

// sSets.readUpdate(state);
// sSurfs.readUpdate(state);

Make all necessary changes in the other files in that folder and compile with wmake. If everything worked fine, you can run your of relatveSample right after the calculation like the normal sample utility. You may have a look in the attached example which I called dynamicSample for some reasons

kind regards
Attached Files
File Type: gz dynamicSample.tar.gz (34.6 KB, 30 views)
luchen2408 likes this.
Jane L is offline   Reply With Quote

Old   May 9, 2013, 10:26
Default
  #36
Member
 
luchen
Join Date: Jul 2011
Posts: 30
Rep Power: 5
luchen2408 is on a distinguished road
hello,jane, I copy your attached file into my case, I look through the file, but I can't catch them very much. I input " wmake", but failed, I got following result,
Making dependency list for source file dynamicSample.C
SOURCE=dynamicSample.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-40 -I/opt/openfoam171/src/finiteVolume/lnInclude -I/opt/openfoam171/src/meshTools/lnInclude -I/opt/openfoam171/src/sampling/lnInclude -I/opt/openfoam171/src/surfMesh/lnInclude -I/opt/openfoam171/src/lagrangian/basic/lnInclude -IlnInclude -I. -I/opt/openfoam171/src/OpenFOAM/lnInclude -I/opt/openfoam171/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/dynamicSample.o
dynamicSample.C: In function ‘int main(int, char**)’:
dynamicSample.C:100:5: error: ‘addOption’ is not a member of ‘Foam::argList’
dynamicSample.C:112:26: error: ‘class Foam::argList’ has no member named ‘optionLookupOrDefault’
dynamicSample.C:112:52: error: expected primary-expression before ‘>’ token
dynamicSample.C:112:62: warning: left operand of comma operator has no effect [-Wunused-value]
dynamicSample.C:119:9: error: ‘MUST_READ_IF_MODIFIED’ is not a member of ‘Foam::IOobject’
dynamicSample.C:128:9: error: ‘MUST_READ_IF_MODIFIED’ is not a member of ‘Foam::IOobject’
make: *** [Make/linux64GccDPOpt/dynamicSample.o] Error 1
luch@ctcnwk843-ubuntu:~/Desktop/test/testheight/00/system/dynamicSample$

can you explain it more about it and how can I get the final result? Thanks very much
luchen2408 is offline   Reply With Quote

Old   May 21, 2013, 10:45
Default
  #37
Member
 
luchen
Join Date: Jul 2011
Posts: 30
Rep Power: 5
luchen2408 is on a distinguished road
hello ,Dear Jane, I have tried the method you referred, I can wmake and generate a file--dynamicsample, when I run the file, I also got an error as following.
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time



--> FOAM FATAL IO ERROR:
cannot open file

file: /home/luch/Desktop/test/testheight/00/system/newdynamicSample/system/controlDict at line 0.

From function regIOobject::readStream()
in file db/regIOobject/regIOobjectRead.C at line 61.

FOAM exiting

luch@ctcnwk843-ubuntu:~/Desktop/test/testheight/00/system/newdynamicSample$


after I copy the controlDict into the folder and run the file, I also got error:

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time



--> FOAM FATAL ERROR:
No times selected

From function dynamicsample
in file db/Time/timeSelector.C at line 240.

FOAM exiting

luch@ctcnwk843-ubuntu:~/Desktop/test/testheight/00/system/newdynamicSample$


can you give me more hint ?how can I make it ? thanks
luchen2408 is offline   Reply With Quote

Old   July 2, 2013, 01:32
Default
  #38
New Member
 
Jane L
Join Date: May 2012
Posts: 21
Rep Power: 4
Jane L is on a distinguished road
Hi luchen!

Did does the ordinary "sample" utilty which comes with OpenFOAM give results? This was described in the previous posts.

Kind regards
Jane L is offline   Reply With Quote

Old   July 4, 2013, 09:20
Default
  #39
Member
 
luchen
Join Date: Jul 2011
Posts: 30
Rep Power: 5
luchen2408 is on a distinguished road
Dear Jane,I have tried "sample" utility, it can give a height with the original coordinate system, however, my simulation object is moving, I have to make a local coordinate system with my object and give the sample with the local coordinate system,but I don't konw how to make it. do you have any suggestion?
luchen2408 is offline   Reply With Quote

Old   July 11, 2013, 06:41
Default
  #40
New Member
 
Jane L
Join Date: May 2012
Posts: 21
Rep Power: 4
Jane L is on a distinguished road
Hi Luchen,

so we're talking about the same problem
I faced the same problem as you do and I found that the "sample" utility gives the coordinates in the global inertial coordinate system. Therefore it needs to updade the geometry changes (movement). I disabled this updating progress so in the sample routine the movement of the geometry is not known and it writes the coordinates in the local system.
If the original sample works on vour machine you could try the following:
Outcomment the lines
Quote:
// Handle geometry/topology changes
// polyMesh::readUpdateState state = mesh.readUpdate();

// sSets.readUpdate(state);
// sSurfs.readUpdate(state);
directly in the sample.C file without any renaming or copying. You have to run wmake in that folder to compilethe change in sample. If that works you may run sample after your simulation and check if the results are in a local coordinate system.

Which version of OF do you use by the way?

kind regards
Jane L is offline   Reply With Quote

Reply

Tags
interfoam interdymfoam

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
How to write k and epsilon before the abnormal end xiuying OpenFOAM Running, Solving & CFD 8 August 27, 2013 15:33
Time Chart of Surface Elevation MAB CFX 9 July 29, 2008 06:10
urgent request-Free surface height plot with time KK FLUENT 6 January 7, 2008 13:50
Convergence moving mesh lr103476 OpenFOAM Running, Solving & CFD 30 November 19, 2007 15:09
unsteady calcs in FLUENT Sanjay Padhiar Main CFD Forum 1 March 31, 1999 12:32


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