Skip to content

Commit 0237223

Browse files
Changes in example crowned_roller
1 parent 614b2c3 commit 0237223

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

examples/crowned_roller/crowned_roller.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,18 @@
2121
Static contact analysis example of a crowned roller pressed against a flat plate.
2222
The roller has the dimensions D = 20mm, L = 20mm.
2323
The crowning profile has the form:
24-
p = (e**(|x|) - 1) / (e**(L/2) - 1) * 0.015
24+
p(x) = (e**(|x|) - |x| - 1) / (e**(L/2) - L/2 - 1) * p_max
2525
Roller and plate are made out of steel. E = 210000N/mm², mue = 0.3
2626
27-
The roller is modeled as a rigid body, so the Emodule of the plate must be halved.
27+
The roller is modeled as a rigid body, so the Emodule of the plate must be halfed.
2828
See https://elib.dlr.de/12219/1/diss_041005_duplex_rgb.pdf page 45, eq. 3.12
2929
3030
The analysis consists of two load steps.
3131
Step 1: Load of 40_000N is applied at center of roller (no tilting)
3232
Analytic solution:
3333
p_h = 271 * sqrt(F / (D * L))
3434
= 271 * sqrt(40_000N / (20mm * 20mm))
35-
= 2710N/mm²
35+
= 2_710N/mm²
3636
Due to the crowning, real pressure must be higher.
3737
Step 2: Load of 40_000N is applied 10% (2mm) out of center. So the pressure on one side
3838
of the roller is higher.
@@ -70,6 +70,7 @@ def main():
7070
with ccx_model.Model(CCX_PATH, CGX_PATH) as model:
7171
model.jobname = 'crowned_roller'
7272
gmsh = model.get_gmsh()
73+
# build geometry and mesh in separate function
7374
build_mesh_in_gmsh(gmsh) # type: ignore
7475
# model.show_gmsh_gui()
7576
model.update_mesh_from_gmsh()
@@ -130,7 +131,7 @@ def main():
130131
sk.ContactFile([enums.EContactResults.CDIS])
131132
)
132133
model.add_steps(step_1, step_2)
133-
# model.show_model_in_cgx()
134+
model.show_model_in_cgx()
134135
model.solve()
135136
model.show_results_in_cgx()
136137

@@ -140,10 +141,11 @@ def build_mesh_in_gmsh(gmsh:ccx_model._gmsh): # type: ignore
140141
# make the roller
141142
#----------------------------------------------------------------------
142143
# x and y coordinates of the crowning profile
143-
x_spl = np.linspace(-10,10,51)
144-
y_spl = (np.exp(np.abs(x_spl)) -1) / (np.exp(10) -1) * 0.015
144+
x_p = np.linspace(-10,10,51)
145+
a_x_p = np.abs(x_p)
146+
y_p = (np.exp(a_x_p) - a_x_p - 1) / (np.exp(10) - 10 - 1) * 0.015 # type: ignore
145147
# make points
146-
spl_pnts = [gmsh.model.geo.addPoint(x,y,0) for x, y in zip(x_spl, y_spl)]
148+
spl_pnts = [gmsh.model.geo.addPoint(x,y,0) for x, y in zip(x_p, y_p)]
147149
pr1 = gmsh.model.geo.addPoint(-10, .5, 0)
148150
pr2 = gmsh.model.geo.addPoint(10, .5, 0)
149151
# make lines
@@ -169,7 +171,7 @@ def build_mesh_in_gmsh(gmsh:ccx_model._gmsh): # type: ignore
169171
heights = np.linspace(0,1,30)[1:]**1.6
170172
gmsh.model.geo.revolve([out[0]], -10,10,0, 1,0,0, angle=np.pi/6-0.05,heights=heights, numElements=np.ones_like(heights), recombine=True)
171173

172-
# make the halve-space
174+
# make the plate
173175
#----------------------------------------------------------------------
174176
# make points
175177
ph1 = gmsh.model.geo.addPoint(-15, 0, 0)

readme.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ made out of 3D solid elements using Gmsh and CalculiX.<br><br>
44
After instantiating a pygccx model you can use the included Gmsh-Python-API
55
to build your geometry, mesh it and define physical groups (sets). For the usage of the Gmsh API look at http://gmsh.info//doc/texinfo/gmsh.html#Gmsh-API<br><br>
66
The gmsh mesh can then be converted to a pygccx mesh object, which
7-
is more closely related to CalculiX. All nodes and solid elements which are at least in one physical group will be converted and all physical groups to node or element sets.<br><br>
7+
is more closely related to CalculiX. All nodes and solid elements which are at least in one physical group will be converted and all physical groups to node- or element sets.<br><br>
88
Finally you have to define the keywords for the ccx input file.<br>
99
Each Keyword is represented by a class. Each class takes the parameters and data the keyword
1010
needs.<br>
@@ -15,6 +15,7 @@ in pygccx.
1515
Look in the examples folder for a quick start and to learn more about how to use pygccx.
1616
The best way to explore pygccx is by using an IDE like VS Code or PyCharm with auto completion,
1717
intellysense and static type checking switched on. So you can see all the members, parameters types and doc strings.
18+
In the folder doc/pygccx you can find an auto generated html documentation of all classes.
1819

1920
ATM no postprocessing capabilities are implemented. This is one of the next mile stones.<br>
2021

0 commit comments

Comments
 (0)