|
[Sponsors] |
December 8, 2011, 17:51 |
sampleDict Bug
|
#1 |
Senior Member
musaddeque hossein
Join Date: Mar 2009
Posts: 309
Rep Power: 18 |
Dear all:
I have the following bits of commands in sampleDict per the users manual:setFormat raw; surfaceFormat raw; interpolationScheme cell; sets ( left { type uniform; axis xyz; start ( 0 -15.0 5.0); end ( 0 -15.0 -5.0); nPoints 10; } middle { type uniform; axis xyz; start ( 0 0 5.0); end ( 0 0 -5.0); nPoints 10; } right { type uniform; axis xyz; start ( 0 15 5.0); end ( 0 15 -5.0); nPoints 10; } ); fields (alpha1); surfaces ( wallPressure { type patch; patches (leftWall); interpolate true; triangulate false; } ); fields (p); My assumption is that once I run it, it will do two things: 1. Provide value of alpha1 2. Provide value of pressure at left wall. However, upon running sampleDict, in the sets folder, the following subfolders are generated for each time folder left_p.xy, middle_p.xy, right_p.xy. Upon opening of any one of these p.xy folders, the contents are: 0 -15 5 99954.9 0 -15 3.88889 99964.7 0 -15 2.77778 99974.7 0 -15 1.66667 99984.7 0 -15 0.555556 100004 0 -15 -0.555556 108959 0 -15 -1.66667 118995 0 -15 -2.77778 128842 0 -15 -3.88889 138618 0 -15 -5 148398 which is pressure along the three lines (left middle and right) that I defined. But this is bizzare, since I expected sampleDict to give me the alpha1 values along the 3 lines and the pressure at the left wall. Can any one help? |
|
December 9, 2011, 04:08 |
|
#2 |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30 |
I don't think the sample utility cares about the order in the input file. Thus, it doesn't correlate the fields keyword with the input that came previously. Just use "fields(alpha1 p)" instead. You will sample a bit more data than you need, but that shouldn't be a huge problem.
__________________
*On twitter @akidTwit *Spend as much time formulating your questions as you expect people to spend on their answer. |
|
December 9, 2011, 10:17 |
|
#3 |
Senior Member
musaddeque hossein
Join Date: Mar 2009
Posts: 309
Rep Power: 18 |
I see. Thanks for the reply! One thing I am also trying to do is to see if OpenFOAM can read pressure for one phase only. So say I have a glass half full of water and as I rock the glass back and forth, I only want to see the pressure on glass walls from the water only and not the air above it. Right now specifying "p" in sampleDict gives me the pressure along the entire height of the wall specified. Is there a command that will do this?
Many thanks for your response. |
|
December 9, 2011, 12:33 |
|
#4 |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30 |
I would sample alpha and p along the walls, and use a python script to filter out values you don't want.
__________________
*On twitter @akidTwit *Spend as much time formulating your questions as you expect people to spend on their answer. |
|
December 9, 2011, 12:51 |
|
#5 | |
Senior Member
musaddeque hossein
Join Date: Mar 2009
Posts: 309
Rep Power: 18 |
Quote:
Say my phases are 0 and 1. So I know the interface or free surface occurs at 0.5. I can find out using sampleDict what the phase values are along the vertical surface. The accuracy of the phase value will depend on how many points I sample the phase along the wall vertically. So if I have 40 cells in the vertical direction, then I must sample the phase at more than 40 points - say 60 points. Now I will need to compute where the phase transition ("0.5") occurs and correlate that with all the points the pressures are measured. So there will have to be two sets of interpolation: 1. Find where 0.5 phase occurs and record the height 2. Find the corresponding height in the pressure value file. Interpolate between the values in the event there is no exact match. Too bad OpenFOAM does not have this utility. An unfortunately I am not great at C++ |
||
December 9, 2011, 13:40 |
|
#6 |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30 |
You never said you want to interpolate the interface. Your previous description corresponds to throwing away all values smaller than 0.5 (assuming air is denoted with zero) and doing the same for the list of pressure values. In this case, you won't need to do interpolation.
If you don't like to do it this way, you can use the threshold filter in paraview, select the cells closest to the wall and then export the values as a spreadsheet. This will require more programming effort though if you want to automate the process.
__________________
*On twitter @akidTwit *Spend as much time formulating your questions as you expect people to spend on their answer. |
|
December 9, 2011, 14:13 |
|
#7 | |
Senior Member
musaddeque hossein
Join Date: Mar 2009
Posts: 309
Rep Power: 18 |
Quote:
|
||
December 12, 2011, 13:45 |
|
#8 |
Senior Member
musaddeque hossein
Join Date: Mar 2009
Posts: 309
Rep Power: 18 |
Dear All:
I put the following code inthe sampleDict file: fields (alpha1 p); surfaces ( wallPressure { type patch; patches (leftWall); interpolate true; triangulate false; } ); I also put the same code in the controlDict file: wallPressure { type surfaces; functionObjectLibs ("libsampling.so"); outputControl outputTime; outputInterval 10; surfaceFormat raw; interpolationScheme cellPoint; fields ( alpha1 p ); surfaces ( walls { type patch; patches (leftWall); interpolate true; triangulate false; } ); } I am modeling a rectangular tank with the fluid halfway up the tank, as a variation of the sloshingTank2D. After running OpenFOAM, I checked the pressures for the left wall at the same time interval. The output from controlDict for the first few lines is: # p POINT_DATA 82 # x y z p -0.5 -19.97 -10 536249 0.5 -19.97 -10 536249 0.5 -19.97 -9.5 536249 -0.5 -19.97 -9.5 536249 0.5 -19.97 -9 530098 -0.5 -19.97 -9 530098 0.5 -19.97 -8.5 522683 -0.5 -19.97 -8.5 522683 The output from the sampleDict file is: # p POINT_DATA 82 # x y z p -0.5 -19.97 -10 533173 0.5 -19.97 -10 536942 0.5 -19.97 -9.5 536942 -0.5 -19.97 -9.5 533173 0.5 -19.97 -9 533173 -0.5 -19.97 -9 526390 0.5 -19.97 -8.5 526390 -0.5 -19.97 -8.5 518337 There are significant difference pressure values between the two. Can anyone tell me why this may be occuring? Thanks |
|
Tags |
alpha1, patches, sampledict |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Bug about MULES::implicitSolve for interPhaseChangeFoam in OF-1.6 | chiven | OpenFOAM Bugs | 18 | April 18, 2013 23:56 |
Ercoftac centrifugal pump case study bug, Openfoam 1.6-ext (Floating point exception) | ArianeJasmin | OpenFOAM Programming & Development | 1 | April 4, 2012 15:11 |
Serious bug in LES interface | fs82 | OpenFOAM Bugs | 21 | November 16, 2009 09:15 |
Bug reports | Mattijs Janssens (Mattijs) | OpenFOAM | 0 | January 10, 2005 11:05 |
Forum y2k Bug | Jonas Larsson | Main CFD Forum | 1 | January 5, 2000 11:22 |