CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[Gmsh] GMSH and OpenFOAM

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 29, 2006, 13:38
Default GMSH and OpenFOAM
  #1
New Member
 
Giuseppe Noviello
Join Date: Mar 2009
Location: Palese bari
Posts: 19
Rep Power: 17
derath is on a distinguished road
Hi to all I'm new user of GMSH and OpenFOAM and I've a problem.
I'm generated a simple cube with 3d mesh in GMSH this is:
$NOD
488
1 0 0 0
2 1 0 0
3 1 1 0
4 0 1 0
5 1 0 1
6 1 1 1
10 0 1 1
14 0 0 1
15 0.1111111111111096 0 0
16 0.2222222222222192 0 0
............................................
$ELM
1080
1 1 32 1 2 1 15
2 1 32 1 2 15 16
.......................
108 1 32 22 2 110 14
109 3 31 6 4 2 23 111 22
......................................
but when I use gmshToFOAM for import it I've this
Read nVerts:488

Read nElems:1080

Mapping region 31 to Foam patch 0
Mapping region 33 to Foam patch 1
Cells:
total:0
hex :0
prism:0
pyr :0
tet :0

Patches:
Patch Size
0 486
1 486

CellZones:
Zone Size
--> FOAM FATAL ERROR : faces deallocated
From function const faceList& polyMesh::allFaces() const
in file meshes/polyMesh/polyMesh.C at line 655.

FOAM aborting

Foam::error::printStack(Foam:stream&)
Foam::error::abort()
Foam::polyMesh::allFaces() const
Foam::polyPatch::polyPatch(Foam::word const&, int, int, int, Foam::polyBoundaryMesh const&)
Foam::polyPatch::addwordConstructorToTable<foam::p olypatch>::New(Foam::word const&, int, int, int, Foam::polyBoundaryMesh const&)
Foam::polyPatch::New(Foam::word const&, Foam::word const&, int, int, int, Foam::polyBoundaryMesh const&)
Foam::polyMesh::polyMesh(Foam::IOobject const&, Foam::Field<foam::vector<double> > const&, Foam::List<foam::cellshape> const&, Foam::List<foam::list<foam::face> > const&, Foam::List<foam::word> const&, Foam::List<foam::word> const&, Foam::word const&, Foam::List<foam::word> const&)
gmshToFoam [0x804ef2f]
__libc_start_main
__gxx_personality_v0

Someone can help me?
thanks in advantage
Giuseppe
derath is offline   Reply With Quote

Old   May 1, 2006, 14:02
Default I guess you have to specify a
  #2
New Member
 
Andrea Palazzi
Join Date: Mar 2009
Posts: 15
Rep Power: 17
giampippetto is on a distinguished road
I guess you have to specify a physical volume, otherwise the cells aren't exported. If you have obtained the volume by, eg, extrusion, then you have to guess the volume number (the viewer tool helps you); in your case I bet it's volume #1, so add something like this to your .geo file:

Physical Volume{100} = {1};

Bye
Andrea
giampippetto is offline   Reply With Quote

Old   May 1, 2006, 14:14
Default Thanks Andrea it works........
  #3
New Member
 
Giuseppe Noviello
Join Date: Mar 2009
Location: Palese bari
Posts: 19
Rep Power: 17
derath is on a distinguished road
Thanks Andrea it works..............:-)
derath is offline   Reply With Quote

Old   March 19, 2007, 09:47
Default Hi, I have just menaged to
  #4
lam
Member
 
Hoang-Lam
Join Date: Mar 2009
Location: Lausanne, Switzerland
Posts: 60
Rep Power: 17
lam is on a distinguished road
Hi,

I have just menaged to install correctly OpenFoam.
(few dasy ago). And I read so many pasges of programmer's guide, and user's guide
Ans I have 2 questions:

1/ Ok, we can take the case of cavity:ok for the explanations about Condition Boundaries, Mesh, but :
HOW can we say to OpenFoam that we need it to solve for us a particular equation????
For example, if I want to solve the Navier-Stokes equation with the Mesh of the case "cavity" (or with any meshes), where do I have to precise it?
In wich files, or fields??

2/ I want to import a .msh (done by gmsh) into OpenFoam. But what's id the command precisely?

I hope that someone can help me.
thaks in advantage.

Lam
lam is offline   Reply With Quote

Old   March 19, 2007, 10:03
Default 1/ icoFoam is in: OpenFOAM/Op
  #5
Member
 
rafal zietara
Join Date: Mar 2009
Location: Manchester, UK
Posts: 60
Rep Power: 17
rafal is on a distinguished road
1/ icoFoam is in:
OpenFOAM/OpenFOAM-1.3/applications/solvers/incompressible/icoFoam


commands(for future reference):
$sol # takes you to solvers
than you think icoFoam is for incompressible fluids so:
$cd incompressible

cd icoFoam
and you have all files you need with all equations
2/ mshToFoam is your friend (i think ive never used)
rafal
rafal is offline   Reply With Quote

Old   March 19, 2007, 10:47
Default Hi Rafal, thanks to replyin
  #6
lam
Member
 
Hoang-Lam
Join Date: Mar 2009
Location: Lausanne, Switzerland
Posts: 60
Rep Power: 17
lam is on a distinguished road
Hi Rafal,

thanks to replying me so quickly.
But I think that I'm not sur to underdestand what you told me,

1/ You wanna say that I can NOT precise the equation I want to solve:but, with OpenFoam, I just can choice the solver (because icoFoam is a solver, isn't it?) in function of each problem.
Am I wrong?

2/ Ok, I will try, even if I don't know yet, what I have to fill in the fiel <root>, and <casename>

Hoang-Lam
lam is offline   Reply With Quote

Old   March 19, 2007, 11:21
Default hi Lam, 1/ i showed you where
  #7
Member
 
rafal zietara
Join Date: Mar 2009
Location: Manchester, UK
Posts: 60
Rep Power: 17
rafal is on a distinguished road
hi Lam,
1/ i showed you where are equations
you want to solve.
in:
/OpenFOAM/OpenFOAM-1.3/applications/solvers/incompressible/icoFoam
you have two files
icoFoam.C - contains N-S eqns + with PISO
(why they are written in this way
you need to read programmers guide (i believe
several times to make everything clear about
fields handling and discretization)
and second fiele
createFields.H - (which is included in icoFoam.C)
contains all reading fields from files.

you may ask why to split this into two files.
thats true it could be in one BIG file
more difficult to read. by splitting this you
separate field initialization and manipulation.

2/ i have never used mshToFoam but i believe
it is like always
<root> /path/to/your/directory/containg/msh/
<case> mesh.msh
but i can be wrong.
search forum for it, read user&programers guides
maybe use in FoamX is easier(?)
hope that helps

rafal

in icoFoam.C you have N-S equations which you
can modify if you dont like them (dont have
important for you forces)
rafal is offline   Reply With Quote

Old   March 19, 2007, 11:47
Default Thanks, Rafal! Things you've
  #8
lam
Member
 
Hoang-Lam
Join Date: Mar 2009
Location: Lausanne, Switzerland
Posts: 60
Rep Power: 17
lam is on a distinguished road
Thanks, Rafal!
Things you've explained to me are pretty clear.
It's a good start for me. I will try now

Thanks again.

Lam
lam is offline   Reply With Quote

Old   March 19, 2007, 12:26
Default Hey everybody, Impatiently,
  #9
lam
Member
 
Hoang-Lam
Join Date: Mar 2009
Location: Lausanne, Switzerland
Posts: 60
Rep Power: 17
lam is on a distinguished road
Hey everybody,

Impatiently, I take this file by the net: exemple.msh done by Gmsh.

And I used gmshToFoam:

-> mkdir totoCase
-> gmshToFoam /home/lam/OpenFOAM/lam-1.3/run/tutorials/icoFoam totoCase ~/Download/exemple.msh

But it doesn't work:

************************************************
Exec : gmshToFoam /home/lam/OpenFOAM/lam-1.3/run/tutorials/icoFoam totoCase /home/pham/Download/exemple.msh
Date : Mar 19 2007
Time : 17:38:14
Host : linux
PID : 8735
Root : /home/pham/OpenFOAM/pham-1.3/run/tutorials/icoFoam
Case : totoCase
Nprocs : 1
Create time



--> FOAM FATAL IO ERROR : cannot open file

file: /home/lam/OpenFOAM/lam-1.3/run/tutorials/icoFoam/totoCase/system/controlDict at line 0.

From function regIOobject::readStream(const word&)
in file db/regIOobject/regIOobjectRead.C at line 68.

FOAM exiting

***********************************************

Everyone can help me?
What do I need to convert that ?

Thanks in advance.

(you can see the contain of exemple.msh at the end of this mail, but could you tell me how to join a file in a Message, instead of pasting a too long file like exemple.msh?)

exemple.msh:

*************
$NOD
110
1 0 0 0
2 12.04 0 0
3 12.04 6.02 0
4 0 6.02 0
5 0 5.016666666666677 0
6 0 4.013333333333356 0
7 0 3.010000000000034 0
8 0 2.006666666666712 0
9 0 1.003333333333367 0
10 0.9261538461538181 0 0
11 1.852307692307636 0 0
12 2.778461538461454 0 0
13 3.70461538461528 0 0
14 4.630769230769109 0 0
15 5.556923076922938 0 0
16 6.483076923076765 0 0
17 7.409230769230593 0 0
18 8.33538461538442 0 0
19 9.261538461538269 0 0
20 10.18769230769218 0 0
21 11.11384615384609 0 0
22 12.04 1.003333333333303 0
23 12.04 2.006666666666611 0
24 12.04 3.009999999999925 0
25 12.04 4.013333333333239 0
26 12.04 5.016666666666597 0
27 11.11384615384616 6.02 0
28 10.18769230769233 6.02 0
29 9.261538461538493 6.02 0
30 8.335384615384656 6.02 0
31 7.409230769230819 6.02 0
32 6.483076923076984 6.02 0
33 5.556923076923149 6.02 0
34 4.630769230769313 6.02 0
35 3.704615384615477 6.02 0
36 2.77846153846163 6.02 0
37 1.852307692307754 6.02 0
38 0.9261538461538763 6.02 0
39 3.20486607222271 3.023730835499769 0
40 8.785570456768582 2.942154494276568 0
41 5.890041415784452 2.827810245864558 0
42 7.068417843577777 4.051633752998181 0
43 4.666473936568431 4.113761583337503 0
44 1.746476358849613 2.045132506854817 0
45 1.66108512559058 4.477370673046563 0
46 10.28338612900738 2.019084725966363 0
47 10.36088453087697 4.460307277816611 0
48 4.684037946250176 1.959466419583135 0
49 7.477634950015693 1.780081064058617 0
50 3.181037626672769 4.704844932976531 0
51 8.806594356501666 4.678218704444161 0
52 3.228941676784689 1.385444759849426 0
53 8.813289134634145 1.333885457597928 0
54 6.068811485511314 1.351329606511205 0
55 6.119958776833551 4.584951327405134 0
56 10.82023736793175 2.932519116922403 0
57 1.20831028707753 2.951162166015311 0
58 4.336426226494211 3.031683611446948 0
59 7.594811452881604 2.844032294684988 0
60 0.9027185875055713 4.864641433806117 0
61 1.167074993726187 1.109406057389359 0
62 11.13066333240834 4.858142478076046 0
63 10.87019715868786 1.100212004031592 0
64 7.931649253103467 5.034343157988877 0
65 4.041448277347159 5.038595722989901 0
66 2.402296221770476 5.128245327117689 0
67 9.616388298066857 5.114087243375444 0
68 6.076371330006538 3.692624645591604 0
69 6.86858845040018 0.9838509349772783 0
70 5.235546174123916 0.9968162165791251 0
71 2.195885606045013 2.960270853063578 0
72 2.393316559273726 1.045759448255547 0
73 9.643815634141552 1.021957255083185 0
74 9.819399073138445 2.91953964860476 0
75 4.061081514575364 1.016547863270589 0
76 8.006022008097835 0.9635788579107692 0
77 8.268809506212312 3.917102388266152 0
78 3.667160279589416 3.983952162859802 0
79 2.572667986363931 3.991150403074476 0
80 9.425783210746278 3.952278848374944 0
81 5.218468734328887 5.045328093357131 0
82 6.842766041496826 5.180163765903639 0
83 5.265832690233351 3.413160798309983 0
84 3.710339718690302 2.084606017969892 0
85 8.325989356840356 1.983391547720674 0
86 0.7675896959037325 2.11342713315732 0
87 0.8435732789845334 3.918493431614463 0
88 11.18774424301501 3.908281659269329 0
89 11.26806540297308 2.103656527545175 0
90 6.592713404722349 2.125626119945127 0
91 5.604565216919084 1.984032746739841 0
92 2.746642647630272 2.090817695837377 0
93 9.278578264171982 2.036663541503021 0
94 6.644478613305885 3.108334651169195 0
95 3.221574072240596 5.382334282359857 0
96 8.790312575328381 5.373327339505198 0
97 5.469428136475575 4.169955607611608 0
98 3.233285644307176 0.6895474322852577 0
99 8.812011537947631 0.6638818229730552 0
100 10.3228119420657 3.634581536322643 0
101 1.696308104726134 3.659684929462258 0
102 6.042592032955783 0.6663953939109775 0
103 6.044241442119975 5.370084813209879 0
104 1.548913720976916 5.302049706366417 0
105 10.48189579297041 5.294505934720005 0
106 5.156189037461824 2.643219399606885 0
107 11.55456607384993 1.553466386396466 0
108 0.4836669143770546 1.558207376216017 0
109 0.4365737905728652 4.453282699385743 0
110 11.59960236831409 4.449105209542208 0
$ENDNOD
$ELM
218
1 1 1 1 2 4 5
2 1 1 1 2 5 6
3 1 1 1 2 6 7
4 1 1 1 2 7 8
5 1 1 1 2 8 9
6 1 1 1 2 9 1
7 1 2 2 2 1 10
8 1 2 2 2 10 11
9 1 2 2 2 11 12
10 1 2 2 2 12 13
11 1 2 2 2 13 14
12 1 2 2 2 14 15
13 1 2 2 2 15 16
14 1 2 2 2 16 17
15 1 2 2 2 17 18
16 1 2 2 2 18 19
17 1 2 2 2 19 20
18 1 2 2 2 20 21
19 1 2 2 2 21 2
20 1 3 3 2 2 22
21 1 3 3 2 22 23
22 1 3 3 2 23 24
23 1 3 3 2 24 25
24 1 3 3 2 25 26
25 1 3 3 2 26 3
26 1 4 4 2 3 27
27 1 4 4 2 27 28
28 1 4 4 2 28 29
29 1 4 4 2 29 30
30 1 4 4 2 30 31
31 1 4 4 2 31 32
32 1 4 4 2 32 33
33 1 4 4 2 33 34
34 1 4 4 2 34 35
35 1 4 4 2 35 36
36 1 4 4 2 36 37
37 1 4 4 2 37 38
38 1 4 4 2 38 4
39 2 6 6 3 55 42 68
40 2 6 6 3 42 55 82
41 2 6 6 3 5 38 60
42 2 6 6 3 10 9 61
43 2 6 6 3 27 26 62
44 2 6 6 3 22 21 63
45 2 6 6 3 59 49 90
46 2 6 6 3 56 24 89
47 2 6 6 3 24 56 88
48 2 6 6 3 57 7 87
49 2 6 6 3 7 57 86
50 2 6 6 3 11 61 72
51 2 6 6 3 63 20 73
52 2 6 6 3 5 4 38
53 2 6 6 3 26 27 3
54 2 6 6 3 21 22 2
55 2 6 6 3 10 1 9
56 2 6 6 3 59 90 94
57 2 6 6 3 72 44 92
58 2 6 6 3 46 73 93
59 2 6 6 3 42 64 77
60 2 6 6 3 64 51 77
61 2 6 6 3 50 65 78
62 2 6 6 3 65 43 78
63 2 6 6 3 52 72 92
64 2 6 6 3 73 53 93
65 2 6 6 3 11 10 61
66 2 6 6 3 21 20 63
67 2 6 6 3 56 46 74
68 2 6 6 3 44 57 71
69 2 6 6 3 51 67 80
70 2 6 6 3 67 47 80
71 2 6 6 3 66 50 79
72 2 6 6 3 45 66 79
73 2 6 6 3 53 76 85
74 2 6 6 3 76 49 85
75 2 6 6 3 75 52 84
76 2 6 6 3 48 75 84
77 2 6 6 3 46 56 89
78 2 6 6 3 57 44 86
79 2 6 6 3 7 6 87
80 2 6 6 3 24 23 89
81 2 6 6 3 25 24 88
82 2 6 6 3 8 7 86
83 2 6 6 3 42 59 94
84 2 6 6 3 59 40 85
85 2 6 6 3 49 59 85
86 2 6 6 3 58 48 84
87 2 6 6 3 39 58 84
88 2 6 6 3 61 44 72
89 2 6 6 3 46 63 73
90 2 6 6 3 59 42 77
91 2 6 6 3 40 59 77
92 2 6 6 3 43 58 78
93 2 6 6 3 58 39 78
94 2 6 6 3 68 42 94
95 2 6 6 3 58 43 83
96 2 6 6 3 54 70 91
97 2 6 6 3 70 48 91
98 2 6 6 3 49 69 90
99 2 6 6 3 69 54 90
100 2 6 6 3 41 90 91
101 2 6 6 3 90 54 91
102 2 6 6 3 17 69 76
103 2 6 6 3 70 14 75
104 2 6 6 3 48 58 106
105 2 6 6 3 74 40 80
106 2 6 6 3 39 71 79
107 2 6 6 3 63 46 89
108 2 6 6 3 44 61 86
109 2 6 6 3 47 62 88
110 2 6 6 3 78 39 79
111 2 6 6 3 50 78 79
112 2 6 6 3 60 45 87
113 2 6 6 3 64 42 82
114 2 6 6 3 43 65 81
115 2 6 6 3 40 77 80
116 2 6 6 3 77 51 80
117 2 6 6 3 35 34 65
118 2 6 6 3 68 41 83
119 2 6 6 3 31 30 64
120 2 6 6 3 37 36 66
121 2 6 6 3 29 28 67
122 2 6 6 3 69 49 76
123 2 6 6 3 45 60 104
124 2 6 6 3 48 70 75
125 2 6 6 3 62 47 105
126 2 6 6 3 65 34 81
127 2 6 6 3 31 64 82
128 2 6 6 3 43 81 97
129 2 6 6 3 14 13 75
130 2 6 6 3 18 17 76
131 2 6 6 3 66 45 104
132 2 6 6 3 47 67 105
133 2 6 6 3 12 11 72
134 2 6 6 3 20 19 73
135 2 6 6 3 35 65 95
136 2 6 6 3 17 16 69
137 2 6 6 3 64 30 96
138 2 6 6 3 15 14 70
139 2 6 6 3 74 80 100
140 2 6 6 3 79 71 101
141 2 6 6 3 60 38 104
142 2 6 6 3 27 62 105
143 2 6 6 3 65 50 95
144 2 6 6 3 51 64 96
145 2 6 6 3 44 71 92
146 2 6 6 3 74 46 93
147 2 6 6 3 34 33 81
148 2 6 6 3 73 19 99
149 2 6 6 3 32 31 82
150 2 6 6 3 12 72 98
151 2 6 6 3 68 83 97
152 2 6 6 3 81 55 97
153 2 6 6 3 47 88 100
154 2 6 6 3 88 56 100
155 2 6 6 3 37 66 104
156 2 6 6 3 57 87 101
157 2 6 6 3 87 45 101
158 2 6 6 3 67 28 105
159 2 6 6 3 72 52 98
160 2 6 6 3 53 73 99
161 2 6 6 3 71 39 92
162 2 6 6 3 40 74 93
163 2 6 6 3 69 16 102
164 2 6 6 3 15 70 102
165 2 6 6 3 91 48 106
166 2 6 6 3 5 60 109
167 2 6 6 3 61 9 108
168 2 6 6 3 54 69 102
169 2 6 6 3 62 26 110
170 2 6 6 3 22 63 107
171 2 6 6 3 70 54 102
172 2 6 6 3 63 89 107
173 2 6 6 3 88 62 110
174 2 6 6 3 86 61 108
175 2 6 6 3 60 87 109
176 2 6 6 3 29 67 96
177 2 6 6 3 67 51 96
178 2 6 6 3 66 36 95
179 2 6 6 3 50 66 95
180 2 6 6 3 38 37 104
181 2 6 6 3 28 27 105
182 2 6 6 3 90 41 94
183 2 6 6 3 55 68 97
184 2 6 6 3 85 40 93
185 2 6 6 3 39 84 92
186 2 6 6 3 41 68 94
187 2 6 6 3 75 13 98
188 2 6 6 3 52 75 98
189 2 6 6 3 18 76 99
190 2 6 6 3 76 53 99
191 2 6 6 3 71 57 101
192 2 6 6 3 56 74 100
193 2 6 6 3 84 52 92
194 2 6 6 3 83 41 106
195 2 6 6 3 53 85 93
196 2 6 6 3 32 82 103
197 2 6 6 3 82 55 103
198 2 6 6 3 81 33 103
199 2 6 6 3 55 81 103
200 2 6 6 3 45 79 101
201 2 6 6 3 80 47 100
202 2 6 6 3 23 22 107
203 2 6 6 3 41 91 106
204 2 6 6 3 9 8 108
205 2 6 6 3 26 25 110
206 2 6 6 3 6 5 109
207 2 6 6 3 36 35 95
208 2 6 6 3 30 29 96
209 2 6 6 3 83 43 97
210 2 6 6 3 13 12 98
211 2 6 6 3 8 86 108
212 2 6 6 3 25 88 110
213 2 6 6 3 87 6 109
214 2 6 6 3 19 18 99
215 2 6 6 3 89 23 107
216 2 6 6 3 58 83 106
217 2 6 6 3 16 15 102
218 2 6 6 3 33 32 103
$ENDELM

*************
lam is offline   Reply With Quote

Old   March 19, 2007, 12:58
Default browse wiki: http://openfoamw
  #10
Member
 
rafal zietara
Join Date: Mar 2009
Location: Manchester, UK
Posts: 60
Rep Power: 17
rafal is on a distinguished road
browse wiki:
http://openfoamwiki.net/index.php/Contrib_gmsh2ToFoam
browse the forum to get more info about use
ie.
http://www.cfd-online.com/cgi-bin/Op...how.cgi?1/2261
hope this helps
rafal
rafal is offline   Reply With Quote

Old   March 19, 2007, 14:18
Default Hi Hong-Lam! Your problem i
  #11
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Hi Hong-Lam!

Your problem is that creating a directory with mkdir is not sufficient to create a "virgin case". ANY OpenFOAM-Utility (including the mesh converters) expects at least a controlDict in it. The best solution would be to copy a tutorial case for the solver you want to use later with your mesh and use the mesh converter with that (everything will be kept in place except the constant/polyMesh-Directory). Afterwards you only have to adapt the boundary conditions and you are ready.

The other way is to take the fatal errors of OpenFOAM literally: if it wants a controlDict then give it a controlDict. Proceed until it stops complaining (that way you lean a lot about OpenFOAM-cases)
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   March 20, 2007, 05:43
Default A new day, a new hope (lol) S
  #12
lam
Member
 
Hoang-Lam
Join Date: Mar 2009
Location: Lausanne, Switzerland
Posts: 60
Rep Power: 17
lam is on a distinguished road
A new day, a new hope (lol)
Sincerly, thanks to you Rafal, and Bernhard.

I will try at once what you adviced me to do.

Thanks a lot

Lam.
lam is offline   Reply With Quote

Old   March 20, 2007, 07:45
Default Hey, Thanks to BernHard, my
  #13
lam
Member
 
Hoang-Lam
Join Date: Mar 2009
Location: Lausanne, Switzerland
Posts: 60
Rep Power: 17
lam is on a distinguished road
Hey,

Thanks to BernHard, my problem with the convert gmshToFoam has evoluted: now, I know that I have the same error like Guiseppe Noviello in April 2006 (lol, look at this page up). (thanks to you Rafal!)
Can somebody give me a .msh file done by gmsh with specifiying a physical volume in the .geo.
In fact, I follow exactly Andrea's advice (page up) given to Guiseppe, one year ago.

Thanks in advance!

Lam
lam is offline   Reply With Quote

Old   March 20, 2007, 09:06
Default Hi, You could try this. It
  #14
Member
 
Erik Arlemark
Join Date: Mar 2009
Location: Eindhoven, Netherlands
Posts: 47
Rep Power: 17
Erik is on a distinguished road
Hi,

You could try this. It worked for me.

cheers
Erik

r=7.25;

//tjocklek av finare mesh
f=1;

//distans mellan bränslestavar
d=3.825;

//antal cellager för finmesh
fl=3;

//åttondelsblock
abl=5;

//3/4 Pi båge (cellager)
tfb=15;

//antal cellager för halvablock
hbl=3;

//antal cellager för block
bl=4;

//cellager för krökt block
kbl=10;

//för extrude
//längd av figuren
L=2000;

//antal cellager på längden
cl=60;

//cebtrym och referens för de elva volymblocken
p100 = newp; Point(p100) = {0, 0, 0, 0.1};

//volym 1
p1 = newp; Point(p1) = {-(r+d/2), -(r+d/2), 0, 0.1};
p2 = newp; Point(p2) = {-(r+f)*Cos(Pi/4), -(r+d/2), 0, 0.1};
p3 = newp; Point(p3) = {-(r+f)*Cos(Pi/4), -(r+f)*Sin(Pi/4), 0, 0.1};
p4 = newp; Point(p4) = {-(r+d/2), -(r+f)*Cos(Pi/4), 0, 0.1};
c1 = newreg; Line(c1) = {p1,p2};
c2 = newreg; Line(c2) = {p2,p3};
c3 = newreg; Line(c3) = {p3,p4};
c4 = newreg; Line(c4) = {p4,p1};
s1 = newreg; Line Loop(s1) = {c1,c2,c3,c4};
rs1 = newreg; Plane Surface(rs1) = {s1};
Transfinite Line {c1,c2,c3,c4} = hbl Using Progression 1;
Transfinite Surface {rs1} = {p1,p2,p3,p4};


//volym 2
p10 = newp; Point(p10) = {(r+f)*Cos(Pi/4), -(r+d/2), 0, 0.1};
p11 = newp; Point(p11) = {(r+f)*Cos(Pi/4), -(r+f)*Sin(Pi/4), 0, 0.1};
c10 = newreg; Line(c10) = {p2,p10};
c11 = newreg; Line(c11) = {p10,p11};
c12 = newreg; Circle(c12) = {p11,p100,p3};
s2 = newreg; Line Loop(s2) = {c10,c11,c12,-c2};
rs2 = newreg; Plane Surface(rs2) = {s2};
Transfinite Line {c11} = hbl Using Progression 1;
Transfinite Line {c10,c12} = kbl Using Progression 1;
Transfinite Surface {rs2} = {p2,p10,p11,p3};


//volym 3
p20 = newp; Point(p20) = {r+d, -(r+d/2), 0, 0.1};
p21 = newp; Point(p21) = {r+d, -(r+f)*Sin(Pi/4), 0, 0.1};
c20 = newreg; Line(c20) = {p10,p20};
c21 = newreg; Line(c21) = {p20,p21};
c22 = newreg; Line(c22) = {p21,p11};
s3 = newreg; Line Loop(s3) = {c20,c21,c22,-c11};
rs3 = newreg; Plane Surface(rs3) = {s3};
Transfinite Line {c20,c22} = bl Using Progression 1;
Transfinite Line {c21} = hbl Using Progression 1;
Transfinite Surface {rs3} = {p10,p20,p21,p11};


//volym 4
p30 = newp; Point(p30) = {-(r+f)*Cos(Pi/4), (r+f)*Sin(Pi/4), 0, 0.1};
p31 = newp; Point(p31) = {-(r+d/2), (r+f)*Sin(Pi/4), 0, 0.1};
c30 = newreg; Line(c30) = {p30,p31};
c31 = newreg; Line(c31) = {p31,p4};
c32 = newreg; Circle(c32) = {p3,p100,p30};
s4 = newreg; Line Loop(s4) = {c30,c32,c31,-c3};
rs4 = newreg; Plane Surface(rs4) = {s4};
Transfinite Line {c31,c32} = kbl Using Progression 1;
Transfinite Line {c30} = hbl Using Progression 1;
Transfinite Surface {rs4} = {p4,p3,p30,p31};


//volym 5

p40 = newp; Point(p40) = {r*Cos(Pi/4), -r*Sin(Pi/4), 0, 0.1};
p41 = newp; Point(p41) = {-r*Cos(Pi/4), -r*Sin(Pi/4), 0, 0.1};
c40 = newreg; Line(c40) = {p11,p40};
c41 = newreg; Line(c41) = {p41,p3};
c42 = newreg; Circle(c42) = {p40,p100,p41};
s5 =newreg; Line Loop(s5) = {-c12,c40,c42,c41};
rs5 = newreg; Plane Surface(rs5) = {s5};
Transfinite Line {c40,c41} = fl Using Progression 1;
Transfinite Line {c42} = kbl Using Progression 1;
Transfinite Surface {rs5} = {p3,p11,p40,p41};


//volym 6
p50 = newp; Point(p50) = {r+f, 0, 0, 0.1};
p51 = newp; Point(p51) = {r, 0, 0, 0.1};
c50 = newreg; Line(c50) = {p50,p51};
c51 = newreg; Circle(c51) = {p11,p100,p50};
c52 = newreg; Circle(c52) = {p51,p100,p40};
s6 = newreg; Line Loop(s6) = {c51,c50,c52,-c40};
rs6 = newreg; Plane Surface(rs6) = {s6};
Transfinite Line {c50} = fl Using Progression 1;
Transfinite Line {c51,c52} = abl Using Progression 1;
Transfinite Surface {rs6} = {p11,p50,p51,p40};


//volym 7
p60 = newp; Point(p60) = {0, r+f, 0, 0.1};
p61 = newp; Point(p61) = {0, r, 0, 0.1};
c60 = newreg; Line(c60) = {p60,p61};
c61 = newreg; Circle(c61) = {p50,p100,p60};
c62 = newreg; Circle(c62) = {p61,p100,p51};
s7 = newreg; Line Loop(s7) = {c61,c60,c62,-c50};
rs7 = newreg; Plane Surface(rs7) = {s7};
Transfinite Line {c60} = fl Using Progression 1;
Transfinite Line {c61,c62} = kbl Using Progression 1;
Transfinite Surface {rs7} = {p50,p60,p61,p51};



//volym 8
p70 = newp; Point(p70) = {-(r+f)*Cos(Pi/4), (r+f)*Sin(Pi/4), 0, 0.1};
p71 = newp; Point(p71) = {-r*Cos(Pi/4), r*Sin(Pi/4), 0, 0.1};
c70 = newreg; Line(c70) = {p70,p71};
c71 = newreg; Circle(c71) = {p60,p100,p70};
c72 = newreg; Circle(c72) = {p71,p100,p61};
s8 = newreg; Line Loop(s8) = {c71,c70,c72,-c60};
rs8 = newreg; Plane Surface(rs8) = {s8};
Transfinite Line {c70} = fl Using Progression 1;
Transfinite Line {c71,c72} = abl Using Progression 1;
Transfinite Surface {rs8} = {p60,p70,p71,p61};



//volym 9
c80 = newreg; Circle(c80) = {p41,p100,p71};
s9 = newreg; Line Loop(s9) = {-c32,-c41,c80,-c70};
rs9 = newreg; Plane Surface(rs9) = {s9};
Transfinite Line {c80} = kbl Using Progression 1;
Transfinite Surface {rs9} = {p70,p3,p41,p71};



//volym 10
p105 = newp; Point(p105) = {r+d, 0, 0, 0.1};
c100 = newreg; Line(c100) = {p21,p105};
c101 = newreg; Line(c101) = {p105,p50};
s10 = newreg; Line Loop(s10) = {c100,c101,-c51,-c22};
rs10 = newreg; Plane Surface(rs10) = {s10};
Transfinite Line {c100} = abl Using Progression 1;
Transfinite Line {c101} = bl Using Progression 1;
Transfinite Surface {rs10} = {p21,p105,p50,p11};


//volym 11
p110 = newp; Point(p110) = {-(r+f)*Cos(Pi/4), r+d, 0, 0.1};
p111 = newp; Point(p111) = {-(r+d/2), r+d, 0, 0.1};
c110 = newreg; Line(c110) = {p70,p110};
c111 = newreg; Line(c111) = {p110,p111};
c112 = newreg; Line(c112) = {p111,p31};
s11 = newreg; Line Loop(s11) = {c110,c111,c112,-c30};
rs11 = newreg; Plane Surface(rs11) = {s11};
Transfinite Line {c110,c112} = bl Using Progression 1;
Transfinite Line {c111} = hbl Using Progression 1;
Transfinite Surface {rs11} = {p70,p110,p111,p31};


//volym 12
p120 = newp; Point(p120) = {0, r+d, 0, 0.1};
c120 = newreg; Line(c120) = {p60,p120};
c121 = newreg; Line(c121) = {p120,p110};
s12 = newreg; Line Loop(s12) = {c120,c121,-c110,-c71};
rs12 = newreg; Plane Surface(rs12) = {s12};
Transfinite Line {c120} = bl Using Progression 1;
Transfinite Line {c121} = abl Using Progression 1;
Transfinite Surface {rs12} = {p60,p120,p110,p70};



//volym 13
c130 = newreg; Circle(c130) = {p105,p100,p120};
s13 = newreg; Line Loop(s13) = {c130,-c120,-c61,-c101};
rs13 = newreg; Plane Surface(rs13) = {s13};
Transfinite Line {c130} = kbl Using Progression 1;
Transfinite Surface {rs13} = {p50,p105,p120,p60};

Recombine Surface {rs1,rs2,rs3,rs4,rs5,rs6,rs7,rs8,rs9,rs10,rs11,rs1 2,rs13};

Extrude {0,0,L} {
Surface{rs1,rs2,rs3,rs4,rs5,rs6,rs7,rs8,rs9,rs10,r s11,rs12,rs13}; Layers{ {cl}, {1}, {1} }; Recombine;
}

Physical Surface(1000) = {6,21,53,11,44,41,57,36,31,26,16,48,60};

Physical Surface(2000) = {82,104,126,148,170,192,214,236,258,302,324,346,28 0};

Physical Volume(4000) = {1,2,3,4,5,6,7,8,9,10,11,12,13};
Erik is offline   Reply With Quote

Old   March 20, 2007, 09:07
Default have to mesh the geo file firs
  #15
Member
 
Erik Arlemark
Join Date: Mar 2009
Location: Eindhoven, Netherlands
Posts: 47
Rep Power: 17
Erik is on a distinguished road
have to mesh the geo file first though.
Erik is offline   Reply With Quote

Old   March 20, 2007, 09:14
Default Hi Erik, Thanks to try to h
  #16
lam
Member
 
Hoang-Lam
Join Date: Mar 2009
Location: Lausanne, Switzerland
Posts: 60
Rep Power: 17
lam is on a distinguished road
Hi Erik,

Thanks to try to help me.
But what is the file you wrote here? Is it a .geo file? Because I do not have gmsh to put it on .msh file.
Sorry to ask you that but have you got a .msh which does what you have written?

Thanks in advance, Erik.

Lam
lam is offline   Reply With Quote

Old   March 20, 2007, 11:07
Default Ok, sorry I thought you had gm
  #17
Member
 
Erik Arlemark
Join Date: Mar 2009
Location: Eindhoven, Netherlands
Posts: 47
Rep Power: 17
Erik is on a distinguished road
Ok, sorry I thought you had gmsh. I dont have gmsh either anymory to mesh with.
Erik is offline   Reply With Quote

Old   March 20, 2007, 11:37
Default No problem Erik. But nobody
  #18
lam
Member
 
Hoang-Lam
Join Date: Mar 2009
Location: Lausanne, Switzerland
Posts: 60
Rep Power: 17
lam is on a distinguished road
No problem Erik.

But nobody else can provide me a .msh done by a gmsh?
I can't help trying the convert "gmshToFoam", jsut see if it works!

Thanks in advance.

Lam
lam is offline   Reply With Quote

Old   March 20, 2007, 15:46
Default There is a CubeVer1.msh in
  #19
Senior Member
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26
mattijs is on a distinguished road
There is a CubeVer1.msh in

$FOAM_UTILITIES/mesh/conversion/gmshToFoam/
mattijs is offline   Reply With Quote

Old   March 21, 2007, 05:38
Default Hi Mattijs, THanks a lot fO
  #20
lam
Member
 
Hoang-Lam
Join Date: Mar 2009
Location: Lausanne, Switzerland
Posts: 60
Rep Power: 17
lam is on a distinguished road
Hi Mattijs,

THanks a lot fOr your help!
I try this, and I can see the mesh thanks to paraFoam. It seems to work.
But I've read the description written in
"gmshToFoam.C":

it is said:

"Note: There is something seriously wrong with the ordering written in the
.msh file. Normal operation is to use the ordering as described
in the manual. Use the -autoInvert to invert based on the geometry.
Not very well tested."

1/ What does it mean?
How can I use this otpion "-autoInvert"? Do I need this?

2/ And how can I use the function "checkMesh" to check a mesh, in general?

Thanks in advance,

Lam
lam is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Gmsh] Converting gmsh to OpenFoam Friendly OpenFOAM Meshing & Mesh Conversion 3 June 26, 2018 06:46
[Gmsh] gmsh 2.6.0 conversion to OpenFoam 160 rosswin OpenFOAM Meshing & Mesh Conversion 0 March 5, 2013 08:34
[Gmsh] 2D Mesh Generation Tutorial for GMSH aeroslacker OpenFOAM Meshing & Mesh Conversion 12 January 19, 2012 04:52
New OpenFOAM Forum Structure jola OpenFOAM 2 October 19, 2011 07:55
[Gmsh] Import problem ARC OpenFOAM Meshing & Mesh Conversion 0 February 27, 2010 11:56


All times are GMT -4. The time now is 16:17.