|
[Sponsors] |
[Commercial meshers] How to convert a .msh file to open Foam? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 29, 2011, 03:48 |
How to convert a .msh file to open Foam?
|
#1 |
Member
Evangelos
Join Date: Sep 2011
Posts: 87
Rep Power: 15 |
Hi
i have created a .msh file from gambit and i want to convert the .msh file to an OF file in order to run the file with OF My problem is how can i convert the file? i must create a new case. ok and then? what files this case must enclose ? and where i can find these files ? What solver i must choose; i am not a programmer.... thanks a lot! |
|
September 29, 2011, 06:45 |
|
#2 |
Super Moderator
Maxime Perelli
Join Date: Mar 2009
Location: Switzerland
Posts: 3,297
Rep Power: 41 |
it depends on what you want to solve
Choose and copy a tutorial from OF folder (tutorials are sorted with solver). Then if your mesh is full hexa, you can use following command to import your mesh >fluentMeshToFoam your_mesh.msh If your mesh constains any hanging nodes (typical with tetra-hexcore), you need to use the tpoly conversion within fluent, and then in OF use following command: >fluent3DMeshToFoam your_mesh.msh Once your mesh is well imported (use checkMesh to be sure everything is ok), you can modify the boundary files in /0 folder
__________________
In memory of my friend Hervé: CFD engineer & freerider |
|
September 30, 2011, 12:21 |
|
#3 |
Member
Evangelos
Join Date: Sep 2011
Posts: 87
Rep Power: 15 |
Hi and thanks for the reply
i create a file and i copy the icofoam file inside. In the cavity folder i paste my "fuel cell.msh" file and i take the following results (see pictures) i think that i pass the mesh in openFoam is it right or wrong ? thanks a lot |
|
September 30, 2011, 12:32 |
|
#4 |
Super Moderator
Maxime Perelli
Join Date: Mar 2009
Location: Switzerland
Posts: 3,297
Rep Power: 41 |
you just paste your file in the folder...
Now you need to conver it, use one of following commands fluentMeshToFoam your_mesh.msh or fluent3DMeshToFoam your_mesh.msh
__________________
In memory of my friend Hervé: CFD engineer & freerider |
|
September 30, 2011, 14:54 |
|
#5 |
Member
Evangelos
Join Date: Sep 2011
Posts: 87
Rep Power: 15 |
hello again sorry but its my first time so i have problems
i open openFoam console and after c:\cfd...\cavity> i write >FluentMeshToFoam .... my .msh file is fuel cell swlhnakia.msh can you tell me exactly what i must write because i make mistakes thanks a lot and sorry |
|
September 30, 2011, 15:00 |
|
#6 | |
Super Moderator
Maxime Perelli
Join Date: Mar 2009
Location: Switzerland
Posts: 3,297
Rep Power: 41 |
Quote:
your c:\cfd...\cavity> sounds like you are under windows. As far as I know you cannot run OF under windows (not directly): http://www.openfoam.com/resources/windows.php
__________________
In memory of my friend Hervé: CFD engineer & freerider |
||
October 7, 2011, 05:32 |
|
#7 |
Member
Evangelos
Join Date: Sep 2011
Posts: 87
Rep Power: 15 |
hi!
i finally pass the mesh to openfoam. The terminal tells that Writing mesh to "/home/danath1985/OpenFOAM/danath1985-2.0.1/run/tutorials/incompressible/Fuelcell/cavity/constant/region0" i search for the File " region0" but i can't find the file ! (when i open paraview all its ok and i can see the mesh) where can i find the file? in order to save because every time i make the same things... i have copy a tutorial (icofoam) if i find the file can i rename it as blockmeshdict in order to replace this file with the file that already exists; |
|
October 7, 2011, 05:42 |
|
#8 |
Super Moderator
Maxime Perelli
Join Date: Mar 2009
Location: Switzerland
Posts: 3,297
Rep Power: 41 |
in fact it writes all the info in the polyMesh folder
__________________
In memory of my friend Hervé: CFD engineer & freerider |
|
October 9, 2011, 06:21 |
|
#9 |
Member
Evangelos
Join Date: Sep 2011
Posts: 87
Rep Power: 15 |
Hi!
I run the code and i have some troubles... after solving p. i take time step continuity errors i change deltaT but the problem remains can you tell me what is wrong; Time = 0.0005 Courant Number mean: 8.81961e-07 max: 0.00267262 DILUPBiCG: Solving for Ux, Initial residual = 0, Final residual = 0, No Iterations 0 DILUPBiCG: Solving for Uy, Initial residual = 0, Final residual = 0, No Iterations 0 DILUPBiCG: Solving for Uz, Initial residual = 1, Final residual = 1.44421e-06, No Iterations 1 DICPCG: Solving for p, Initial residual = 1, Final residual = 1.30066e+07, No Iterations 1001 time step continuity errors : sum local = 22.9905, global = 0.0673409, cumulative = 0.0673409 DICPCG: Solving for p, Initial residual = 1.43669e-08, Final residual = 1.43669e-08, No Iterations 0 time step continuity errors : sum local = 23.0278, global = 0.0673409, cumulative = 0.134682 ExecutionTime = 48.5 s ClockTime = 50 s Time = 0.001 Courant Number mean: 53.0198 max: 5172.46 DILUPBiCG: Solving for Ux, Initial residual = 0.986577, Final residual = 11.6942, No Iterations 1001 DILUPBiCG: Solving for Uy, Initial residual = 0.99304, Final residual = 67784, No Iterations 1001 DILUPBiCG: Solving for Uz, Initial residual = 0.996546, Final residual = 7.40566e+06, No Iterations 1001 DICPCG: Solving for p, Initial residual = 0.995109, Final residual = 5.2908, No Iterations 1001 time step continuity errors : sum local = 7.06186e+09, global = 151003, cumulative = 151003 DICPCG: Solving for p, Initial residual = 0.975242, Final residual = 2.10525, No Iterations 1001 time step continuity errors : sum local = 5.68733e+11, global = 6.33381e+07, cumulative = 6.34891e+07 ExecutionTime = 353.47 s ClockTime = 360 s |
|
October 10, 2011, 02:06 |
|
#10 |
Super Moderator
Maxime Perelli
Join Date: Mar 2009
Location: Switzerland
Posts: 3,297
Rep Power: 41 |
"time step continuity errors " aren't error as you think.
>> http://www.openfoam.com/docs/user/monitoring-jobs.php Very very coarse approach to numerics: exact mathematics equation A=B will be treatead as A-B=epsilon, with epsilon very small. The smaller epsilon will be, the more accurate your A=B equation will be solved. epsilon is your error But I agree you have an error: your Courant Number C is too high (C<0.5). Reduce your deltat
__________________
In memory of my friend Hervé: CFD engineer & freerider |
|
October 15, 2011, 14:00 |
|
#11 |
Member
Evangelos
Join Date: Sep 2011
Posts: 87
Rep Power: 15 |
Hi
i have troubles when i run the case. i run icoFoam i pass the mesh from Gambit to openFoam.I use checkMesh and all its ok ! i try to decrease deltaT when i run the code the first pass is ok and the courant number is very low From the second pass the courant number rises a lot so after some passes the case stops i attach some pictures... Can you tell me what is wrong ? |
|
October 17, 2011, 02:25 |
|
#12 |
Super Moderator
Maxime Perelli
Join Date: Mar 2009
Location: Switzerland
Posts: 3,297
Rep Power: 41 |
Courant Number (Co) is your problem.
How did you define your dt?
__________________
In memory of my friend Hervé: CFD engineer & freerider |
|
October 17, 2011, 04:52 |
|
#13 |
Member
Evangelos
Join Date: Sep 2011
Posts: 87
Rep Power: 15 |
i have create a tube and i unite this tube with square
the lenght of the tube is 3cm and the lenght of the square is 1 cm δχ=0.04/40=0.001 n= 40 (10 cell/cm) δt = 1 * 0.001/0.1=0.01 U=0.1 Co = 1 |
|
October 17, 2011, 05:02 |
|
#14 |
Super Moderator
Maxime Perelli
Join Date: Mar 2009
Location: Switzerland
Posts: 3,297
Rep Power: 41 |
Basically you need to get your dt from your maximal expected velocity on your smallest cell, and then take factor 0.5 >> dt # 0.5 x min-cell/max-U
But in your case, did you scale your domain? In your checkMesh I see a bounding box from (0 0 0) to (16 16 4)..... meters
__________________
In memory of my friend Hervé: CFD engineer & freerider |
|
October 17, 2011, 06:20 |
|
#15 |
Member
Evangelos
Join Date: Sep 2011
Posts: 87
Rep Power: 15 |
What do you recomend ?
Is there an error in design ? |
|
October 17, 2011, 06:28 |
|
#16 |
Super Moderator
Maxime Perelli
Join Date: Mar 2009
Location: Switzerland
Posts: 3,297
Rep Power: 41 |
in the bounding box, the (16 16 4) agrees what you mentionned:"the lenght of the tube is 3cm and the lenght of the square is 1 cm" (3+1)
That means you created your geometry in Gambit with cm-scale (although there is no scale in Gambit) So now you need to scale your domain. Once you imported it with fluentMeshToFoam ***.msh , you need to scale it with: > transformPoints -scale (0.01 0.01 0.01)
__________________
In memory of my friend Hervé: CFD engineer & freerider |
|
October 21, 2011, 10:38 |
|
#17 |
Member
Evangelos
Join Date: Sep 2011
Posts: 87
Rep Power: 15 |
thanks for the reply the case work but in the end (paraview.pic)
what is wrong; i drew the model with Gambit (create real brick) and i put the volumes to the right place after i connect the faces of the volumes! i specify the boundary conditions walls,Vin(red) oulet (blue) i specify all the model as fluid! what can i do? i cannot see the flow in my model (only in Vin and outlet) |
|
October 21, 2011, 10:49 |
|
#18 |
Super Moderator
Maxime Perelli
Join Date: Mar 2009
Location: Switzerland
Posts: 3,297
Rep Power: 41 |
IN paraview, basically available are boundary surfaces and fluid-domain.
By openingany boundary surface, you can display any variable on this surface. If you want to see something in your model, then you have to "open" the fluid domain,and do some slice or clip. if you used foamToVTK utility, then in the VTK folder, you have folders containing boundary surfaces results. In the VTK folder you also have one (steady) or many (unsteady) files. Those one are results for entire model.
__________________
In memory of my friend Hervé: CFD engineer & freerider |
|
October 21, 2011, 11:04 |
|
#19 |
Member
Evangelos
Join Date: Sep 2011
Posts: 87
Rep Power: 15 |
thanks a lot!you are my hero!
|
|
October 21, 2011, 17:00 |
|
#20 |
Member
Evangelos
Join Date: Sep 2011
Posts: 87
Rep Power: 15 |
hi again!
i think i have a problem with my mesh! the flow stops!!!!at the end of the blue what is wrong i created with create real brick and i put the volumes to the right place. why the flow stops ? |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[swak4Foam] funkyDoCalc with OF2.3 massflow | NiFl | OpenFOAM Community Contributions | 14 | November 25, 2020 04:30 |
[foam-extend.org] Problems installing foam-extend-4.0 on openSUSE 42.2 and Ubuntu 16.04 | ordinary | OpenFOAM Installation | 19 | September 3, 2019 19:13 |
[swak4Foam] groovyBC in openFOAM-2.0 for parabolic velocity bc | ofslcm | OpenFOAM Community Contributions | 25 | March 6, 2017 11:03 |
[swak4Foam] build problem swak4Foam OF 2.2.0 | mcathela | OpenFOAM Community Contributions | 14 | April 23, 2013 14:59 |
pisoFoam compiling error with OF 1.7.1 on MAC OSX | Greg Givogue | OpenFOAM Programming & Development | 3 | March 4, 2011 18:18 |