Question on sampleDict
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; } ); |
Hi Musaddeque,
Summarizing the problem:
The entry "surfaces" should be used as a single list and names should not be repeated: Code:
/*--------------------------------*- C++ -*----------------------------------*\ Bruno |
Quote:
------------------------------------------------------------------------------------------------------------------------------------------------ fields (alpha1 p); surfaces ( left { type patch; patches (leftWall); interpolate true; triangulate false; } right { type patch; patches (rightWall); interpolate true; triangulate false; } ); -------------------------------------------------------------------------------------------------------------------------------------- |
OpenFoam does not recognize change in mesh size
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. |
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 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 |
OpenFoam does not recognize change in mesh size
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? |
OpenFoam does not recognize change in mesh size
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 |
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. |
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 |
All times are GMT -4. The time now is 05:55. |