Hello
I am running the damB
Hello
I am running the damBreakFine case. When I run: setFields . damBreakFine I get following error: --> FOAM FATAL IO ERROR : size 2268 is not equal to the given value of 7700 How to do with this? Thanks |
I got the problem.
Thanks
I got the problem.
Thanks |
From memory, this is something
From memory, this is something to do with not copying gamma.org to gamma (check out the Allrun script).
Rick |
Hi,
I got the same problem. Followed instructions as told in the tutorial, but the same error occures. Unfortunately no solution is given in this thread. Anybody who can help? Greetz |
I assume you have sorted the problem but for anyone else who has the same problem, you must copy gamma.org over gamma
ie cp 0/gamma.org 0/gamma and type yes when it asks if you want to overwrite 0/gamma. gamma starts off as a file with patch conditions (zeroGradient,symmetry,empty), then when setFields is run it reads this file and overwrites it with what I'm guessing is the values for the internal cells and the patches values are at the bottom. So if you want to run setFields again (like if you changed your mesh) then you should copy gamma.org to gamma. gamma.org is a copy of the original gamma. Hopefully this will help somebody. Philip |
Hey there!
the copying help. cheers, Claus |
Hi Claus,
As far as I know, the origin of the error is that the mesh (or mesh density) has been changed since the 'setFields' was last ran. Is it the 'damBreak' case you are trying? When you copy 'damBreak' from the '$FOAM_TUTORIALS/interFoam/' directory, you run 'blockMesh' first and then 'setFields', does 'setFields' work fine then? Are you then changing the mesh density? If you now run 'setFields' you will get the error above, so assuming 'gamma.org' was not altered, if you 'cp 0/gamma.org 0/gamma' then when you run 'setFields' it will work (I had a quick go with damBreak now and after copying the gamma.org file then 'setFields' works without the error). In case 'gamma.org' was for some reason altered, just get it from $FOAM_TUTORIALS again ie 'cp $FOAM_TUTORIALS/interFoam/damBreak/0/gamma.org 0/gamma' Hopefully this helps, Btw I am assuming you are using the 'damBreak' case, let me know if the above doesn't help of if you are using a different case, Philip |
Though it might be necromancy to get back a thread nobody posted in for that long a time:
I do not remember which one it actually was, but one of the two things happened: Either the files in the "polyMesh" directory remained the same and deleting those (make a copy of your blockMeshDict and do rm casename/constant/polyMesh/* ) helped. Or it was necessary to renew the files of the variables in the casename/0 directory, as these are altered by earlier setFields-commands. Again: Keep a copy of the original files (before altering them with setFields) and just make "rm casename/0/*". In both cases you have to copy back the "old" files to the directory where they are needed. If you then do a "blockMesh -case casename" and a "setFields -case casename" everything should be okay again. In case I forget, remind me via private message, and I will upload a small script I wrote for these things... |
Quote:
Create mesh for time = 0.00 Reading set description: WP1 WP3 Time = 0.00 --> FOAM FATAL IO ERROR: size 30000 is not equal to the given value of 80000 file: /home/cfsengineers/OpenFOAM/cfsengineers-2.2.1/run/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/0.00/alpha1 from line 18 to line 30046. From function Field<Type>::Field(const word& keyword, const dictionary&, const label) in file /home/opencfd/OpenFOAM/OpenFOAM-2.2.1/src/OpenFOAM/lnInclude/Field.C at line 236. |
Copy alpha* from 0.org to 0. Is this large pink font really necessary? It hurts in the eyes ;).
|
Quote:
|
Quote:
#!/bin/sh cd ${0%/*} || exit 1 # run from this directory # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions runApplication blockMesh cp 0/alpha1.org 0/alpha1 runApplication setFields runApplication `getApplication` # ----------------------------------------------------------------- end-of-file But OpenFoam still complains. Any other suggestions? |
Quote:
Code is in FORTRAN 90: write(*,*) 'Cleaning files from previous run' call system(cd_command // './Allclean') ! clean all files from previous run. write(*,*) 'Running blockMesh' call system(cd_command // 'blockMesh') ! set up the tank geometry and mesh size write(*,*) 'recover phase file and run setFields' call system(cd_command // 'cp 0/alpha1.org 0/alpha1') ! create new alpha1 file from alpha1.org file call system(cd_command // 'setFields') ! coordinate mesh between geometry and phase file write(*,*) 'Decompose subdomains for parallel processing' call system(cd_command // 'decomposePar') |
check your alpha field before you run setFields. If it's not uniform, then you have found the source of your problem.
|
Quote:
|
Great that you made it work. But I doubt that this is a "glitch at runtime", as this is coded to work like that. On purpose ;). Otherwise you would not be able to proceed from a previous state.
|
You are right. There were two files left over from a previous model/run which was the source of the misread by OpenFOAM. So no glitches there.I just have to make sure that there are no leftover files or data from other runs and models that may affect the new run.
|
Hi to all,
I've got a familiar problem. I translate my mesh, with transformPoints -translate ... so that my coordinate system is in the outlet. But now I my setFields doesnt work anymore. I doenst write in the alpha.water case and the box which is in the case doesnt fit with the coordinates i put in setFields. Can someone help me? Thanks |
I just need to use new mesh
Dear all,
I am trying to run the compressible shocktube example, bu using a gmsh generated mesh. I cannot follow your advices, because I think there is no point on copying 0/* exactly from the original problem. How can I get correctly modified 0/*s? Btw, setFields reports: ------------------ --> FOAM FATAL IO ERROR: size 200 is not equal to the given value of 81612 ----------- because the original shocktube problem has 200 cells, whereas my problem contains 81612 cells. Any idea? Thanks. |
Setfields no rewriting alpha.water file
Hi all,
I modified the dambreak case to simulate a two-phase flow for a horizontal pipe. My mesh seems ok in Parafoam after running blockMesh. However, when I run setFields, the alpha.water files are not being re-written. Therefore my horizontal pipe is still completely filled with water (alpha = 1) even after I tried making the top half air using boxtocell. Anyone has got any idea what I'm missing? (It works perfectly fine for the dambreak case) Regards Shafik |
All times are GMT -4. The time now is 08:13. |