v0.15.0
Loading...
Searching...
No Matches
Cube_RVE_with_reinforcement.jou
Go to the documentation of this file.
1#!python
2#To create RVE for all the three type of boundary conditions, i.e. (Linear dispacemet, traction and periodic)
3
4cubit.cmd('new')
5
6autofactor=7;
7
8#=============================================================
9#Geometry
10#=============================================================
11
12cubit.cmd('brick x 1 y 1 z 1')
13
14cubit.cmd('brick x 1 y 0.4 z 0.4')
15
16cubit.cmd('subtract volume 2 from volume 1 keep')
17cubit.cmd('delete volume 1')
18cubit.cmd('imprint volume 2 3')
19cubit.cmd('merge volume 2 3')
20
21#=============================================================
22#Periodic mesh
23#=============================================================
24
25cubit.cmd('surface 20 scheme trimesh')
26str1='surface 20 size auto factor '+str(autofactor); cubit.cmd(str1)
27cubit.cmd('mesh surface 20')
28cubit.cmd('surface 22 scheme copy source surface 20 source vertex 27 target vertex 26 source curve 47 target curve 48 nosmoothing')
29cubit.cmd('mesh surface 22')
30
31cubit.cmd('surface 10 scheme trimesh')
32str1='surface 10 size auto factor '+str(autofactor); cubit.cmd(str1)
33cubit.cmd('mesh surface 10')
34cubit.cmd('surface 12 scheme copy source surface 10 source vertex 11 target vertex 10 source curve 23 target curve 24 nosmoothing')
35cubit.cmd('mesh surface 12')
36
37cubit.cmd('surface 17 scheme trimesh')
38str1='surface 17 size auto factor '+str(autofactor); cubit.cmd(str1)
39cubit.cmd('mesh surface 17')
40cubit.cmd('surface 18 scheme copy source surface 17 source vertex 26 target vertex 29 source curve 38 target curve 44 nosmoothing')
41cubit.cmd('mesh surface 18')
42
43cubit.cmd('surface 19 scheme trimesh')
44str1='surface 19 size auto factor '+str(autofactor); cubit.cmd(str1)
45cubit.cmd('mesh surface 19')
46cubit.cmd('surface 21 scheme copy source surface 19 source vertex 28 target vertex 27 source curve 45 target curve 47 nosmoothing')
47cubit.cmd('mesh surface 21')
48
49str1='volume all size auto factor '+str(autofactor); cubit.cmd(str1)
50cubit.cmd('volume all scheme tetmesh')
51cubit.cmd('mesh volume all')
52
53
54#=============================================================
55#Defining blocks for elastic, transversely-isotropic and potential flow problems
56#=============================================================
57
58vol=['3', '2','2']
59mat=['MAT_ELASTIC_1','MAT_ELASTIC_TRANSISO_1','PotentialFlow_1']
60for i in range(0, 3):
61 cubit.cmd('set duplicate block elements on')
62 str1='block ' + str(i+1) +' volume '+vol[i]; cubit.cmd(str1)
63 str1='block ' + str(i+1) +' name "'+mat[i] + '"'; cubit.cmd(str1)
64
65
66#=============================================================
67#Material properties for matrix part
68#=============================================================
69
70cubit.cmd('block 1 attribute count 2')
71Em=3.5e3; Enu=0.3; #giga to mega as we used dimension in mm
72
73Elastic=[str(Em), str(Enu)]
74for i in range(0, 2):
75 str1='block 1 attribute index ' + str(i+1) +' '+Elastic[i]; cubit.cmd(str1)
76
77#=============================================================
78#Material properties for fibres
79#=============================================================
80
81#to use as isotropic
82#cubit.cmd('block 2 attribute count 5')
83#Ep=Em; Ez=Em; nup=Enu; nupz=Enu; Gzp=Em/(2*(1+Enu));
84
85cubit.cmd('block 2 attribute count 5')
86#Ep=40e3; Ez=230e3; nup=0.26; nupz=0.26; Gzp=24e3;
87Ep=10*Em; Ez=20*Em; nup=0.26; nupz=0.26; Gzp=5*Em;
88#Ep=2*Em; Ez=5*Em; nup=0.26; nupz=0.26; Gzp=2*Em;
89
90TransIso=[str(Ep), str(Ez), str(nup), str(nupz), str(Gzp)]
91for i in range(0, 5):
92 str1='block 2 attribute index ' + str(i+1) +' '+TransIso[i]; cubit.cmd(str1)
93
94#=============================================================
95#Material properties for interface between fibres and matrix
96#=============================================================
97
98alpha_interf=500
99cubit.cmd('set duplicate block elements on')
100str1='block 7 surface 23 26 29 32'; cubit.cmd(str1)
101str1='block 7 name "MAT_INTERF_1"'; cubit.cmd(str1)
102cubit.cmd('block 7 attribute count 4')
103str1='block 7 attribute index 1 '+str(alpha_interf); cubit.cmd(str1) #now we use 4 parameters for interface
104str1='block 7 attribute index 2 '+str(0.0); cubit.cmd(str1)
105str1='block 7 attribute index 3 '+str(0.0); cubit.cmd(str1)
106str1='block 7 attribute index 4 '+str(0.0); cubit.cmd(str1)
107
108
109#=============================================================
110#Defining interfaces
111#=============================================================
112
113Interface=['7', '8','9','11']
114for i in range(0, 4):
115 str1='sideset ' + str(i+1) +' surface '+Interface[i]; cubit.cmd(str1)
116 str1='sideset ' + str(i+1) +' name "interface'+str(i+1); cubit.cmd(str1)
117
118#=============================================================
119#Defining pressures for potential flow problem
120#=============================================================
121
122Pres=['10', '12']; count=0; count1=len(Interface);
123for i in range(0, 1):
124 str1='create pressure '+str(count+1)+' on surface '+str(Pres[count])+' magnitude 1'; cubit.cmd(str1)
125 str1='create pressure '+str(count+2)+' on surface '+str(Pres[count+1])+' magnitude -1'; cubit.cmd(str1)
126 str1='sideset '+str(count1+1)+' name "PressureIO_' + str(i+1) + '_1"'; cubit.cmd(str1)
127 str1='sideset '+str(count1+2)+' name "PressureIO_' + str(i+1) + '_2"'; cubit.cmd(str1)
128 count=count+2; count1=count1+2;
129
130#=============================================================
131#Definign zero proessrues for potential flow problem (This should be of the same order as PotentialFlow blocks )
132#=============================================================
133
134zeroPressureNode=[1]
135for i in range(0, 1):
136 str1='nodeset ' + str(i+1) + ' node ' + str(zeroPressureNode[i]); cubit.cmd(str1)
137 str1='nodeset ' + str(i+1)+' name "ZeroPressure_' + str(i+1)+ '"'; cubit.cmd(str1)
138
139#=============================================================
140#Defining surfaces for dispacement, traction and periodic boundary conditions
141#=============================================================
142
143cubit.cmd('sideset 101 surface 20 10 19 18') # all -ve boundary surfaces
144cubit.cmd('sideset 102 surface 21 17 22 12') # all +ve boundary surfaces
145cubit.cmd('sideset 103 surface 20 10 19 18 21 17 22 12') # all boundary surfaces
146
147cubit.cmd('save as "/Users/zahur/Documents/moFEM/mofem-cephas/mofem_v0.2/users_modules/homogenisation/meshes/Cube_RVE_with_reinforcement.cub" overwrite')