|
[Sponsors] |
April 17, 2013, 23:53 |
Question on sampleDict
|
#1 |
Senior Member
musaddeque hossein
Join Date: Mar 2009
Posts: 309
Rep Power: 18 |
Dear all:
Using sampleDict, I am trying to obtain pressure for the left and rightwall in a rectangular tank. The walls are called leftWall and rightWall in blockMesh. However sampleDict gives me reading for one wall only. How can I get it to read both walls? Any advice will be greatly appreciated. /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 1.6 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object sampleDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // setFormat raw; surfaceFormat raw; interpolationScheme cell; fields (alpha1 p); surfaces ( wallPressure { type patch; patches (leftWall); interpolate true; triangulate false; } ); surfaces ( wallPressure { type patch; patches (rightWall); interpolate true; triangulate false; } ); |
|
April 18, 2013, 18:59 |
|
#2 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Hi Musaddeque,
Summarizing the problem:
The entry "surfaces" should be used as a single list and names should not be repeated: Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 1.6 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object sampleDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // setFormat raw; surfaceFormat raw; interpolationScheme cell; fields (alpha1 p); surfaces ( wallPressure { type patch; patches (leftWall); interpolate true; triangulate false; } wallPressure2 { type patch; patches (rightWall); interpolate true; triangulate false; } ); Bruno
__________________
|
|
April 18, 2013, 22:47 |
|
#3 | |
Senior Member
musaddeque hossein
Join Date: Mar 2009
Posts: 309
Rep Power: 18 |
Quote:
------------------------------------------------------------------------------------------------------------------------------------------------ fields (alpha1 p); surfaces ( left { type patch; patches (leftWall); interpolate true; triangulate false; } right { type patch; patches (rightWall); interpolate true; triangulate false; } ); -------------------------------------------------------------------------------------------------------------------------------------- |
||
May 7, 2013, 15:54 |
OpenFoam does not recognize change in mesh size
|
#4 |
Senior Member
musaddeque hossein
Join Date: Mar 2009
Posts: 309
Rep Power: 18 |
Dear all:
I am running sloshingTank2D. In the blockMesh dict file, initially, the cell size was 50X50. Then I changed it to 271X271. Now when I run in parallel, I get the following error message: --> FOAM FATAL IO ERROR: size 2500 is not equal to the given value of 73441 file: /home/musa/OpenFOAM/musa-2.2.0/run/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/0/alpha1 from line 18 to line 2546. Here 2500 is the previous mesh size. 73441 is the current mesh size of 271x271. So what does OpenFOAM mean by this error message. The alpha1.org file that it is refering to does not have any reference to the mesh size. So why is it pointing to the alpha1 file? Thankyou. |
|
May 7, 2013, 17:25 |
|
#5 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Hi Musaddeque,
The error message is due to the internal field for "alpha1" having a value count different from the mesh's own cell count. In essence, when setFields is executed, if the values are not all equal, it will define one value (scalar or vector) per cell of the mesh. In the case folder you should find a file named "Allrun". This is a script that can be used to run the case as intended: Code:
./Allrun From your description, it seems that you've missed two important steps: Code:
cp 0/alpha1.org 0/alpha1 runApplication setFields This is one of the quickest/easiest solutions there are, which is why it's the one shown in this tutorial In addition, there is also the "Allclean" script, which is designed to quickly clean the tutorial case to make it ready for another run, or just to save disk space. To run it, it's the same way: Code:
./Allclean Bruno
__________________
|
|
May 7, 2013, 23:37 |
OpenFoam does not recognize change in mesh size
|
#6 | |
Senior Member
musaddeque hossein
Join Date: Mar 2009
Posts: 309
Rep Power: 18 |
Quote:
#!/bin/sh cd ${0%/*} || exit 1 # run from this directory foamCleanTutorials cases #rm -rf 0/alpha1 0/alpha1.gz probes wallPressure pRefProbe rm -rf probes wallPressure pRefProbe # ----------------------------------------------------------------- end-of-file Note that I commented out the removal of the 0/alpha1 fields because otherwise OpenFOAM deletes it each time Allclean is run and I do not know a way of recovering it. And I dont understand why the alpha files must be deleted each time. I am trying to call OpenFOAM from another code, so regenerating the alpha1 file each time is not something I can do. Any suggestions? |
||
May 7, 2013, 23:46 |
OpenFoam does not recognize change in mesh size
|
#7 |
Senior Member
musaddeque hossein
Join Date: Mar 2009
Posts: 309
Rep Power: 18 |
The error message I get appears after MPI sets up the processors and is as follows. Initially I had 50X50 cells then I increased to 271x271 cells.
Processor 3 Number of cells = 9180 Number of faces shared with processor 1 = 135 Number of faces shared with processor 2 = 269 Number of processor patches = 2 Number of processor faces = 404 Number of boundary faces = 18496 Number of processor faces = 812 Max number of cells = 27540 (49.998% above average 18360.2) Max number of processor patches = 2 (0% above average 2) Max number of faces between processors = 408 (0.492611% above average 406) Time = 0 --> FOAM FATAL IO ERROR: size 2500 is not equal to the given value of 73441 file: /home/musa/OpenFOAM/musa-2.2.0/run/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/0/alpha1 from line 18 to line 2546. From function Field<Type>::Field(const word& keyword, const dictionary&, const label) in file /home/opencfd/OpenFOAM/OpenFOAM-2.2.0/src/OpenFOAM/lnInclude/Field.C at line 236. FOAM exiting |
|
May 8, 2013, 14:25 |
|
#8 |
Senior Member
musaddeque hossein
Join Date: Mar 2009
Posts: 309
Rep Power: 18 |
One thing I dont understand is that we are running Allclean before Allrun. In Allclean the alpha1 and alpha1.org files are being removed from the 0 folder:
#!/bin/sh cd ${0%/*} || exit 1 # run from this directory foamCleanTutorials cases rm -rf 0/alpha1 0/alpha1.gz rm -rf probes wallPressure pRefProbe # ----------------------------------------------------------------- end-of-file Then Allrun is attempting to copy alpha1 file to alpha1.org as follows: cp 0/alpha1.org 0/alpha1 But this cannot happen because alpha1 and alpha1.org files were deleted in the Allclean process. Is there something wrong here or am I missing something? I look forward to your response. |
|
May 8, 2013, 18:48 |
|
#9 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Hi Musahossein,
That's very strange... the "0/alpha1.org" should have not been erased by Allclean. Only "0/alpha1" and "0/alpha1.gz" should have been erased! These two are the uncompressed and compressed forms of the same file. They do not affect "alpha1.org". Perhaps you accidentally erased "alpha1.org"? If you are missing this file right now, you can get it back with this command: Code:
cp $FOAM_TUTORIALS/multiphase/interDyMFoam/ras/sloshingTank2D/0/alpha1.org 0/alpha1.org Have a look for example at the tutorial "multiphase/interDyMFoam/ras/damBreakWithObstacle": https://github.com/OpenFOAM/OpenFOAM...akWithObstacle Best regards, Bruno
__________________
|
|
Tags |
sampledict, wallpressure |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
small question about the functionalities of topological changes in OpenFoam | ngj | OpenFOAM Running, Solving & CFD | 2 | February 28, 2013 11:02 |
Question Re Engineering Data Source | imnull | ANSYS | 0 | March 5, 2012 14:51 |
question on sampleDict | gorgon | OpenFOAM | 2 | December 8, 2011 20:07 |
internal field question - PitzDaily Case | atareen64 | OpenFOAM Running, Solving & CFD | 2 | January 26, 2011 16:26 |
Poisson Solver question | Suresh | Main CFD Forum | 3 | August 12, 2005 05:37 |