Skip to content

Commit ce7c721

Browse files
committed
add script and demo of element solution
1 parent fb743b3 commit ce7c721

File tree

14 files changed

+355
-0
lines changed

14 files changed

+355
-0
lines changed

Linear/Separate/README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Plane beams - element solution
2+
Tested with CGX/CCX 2.11
3+
4+
+ Linear static solution
5+
+ Plane stress model
6+
+ Test of element separation to avoid nodal averaging of results (AKA element solution in ANSYS)
7+
8+
File | Contents
9+
:------------- | :-------------
10+
[pre.fbd](pre.fbd) | Pre-processing script for CGX
11+
[post-e.fbd](post-e.fbd) | Post-processing script for CGX, no nodal averaging
12+
[post-n.fbd](post-n.fbd) | Post-processing script for CGX, nodal averaging
13+
[nodal.inp](nodal.inp)| CCX input with non-separated mesh (nodal averaging)
14+
[element.inp](element.inp)| CCX input with non-separated mesh (nodal averaging)
15+
16+
## Preprocessing
17+
```
18+
> cgx -b pre.fbd
19+
```
20+
There are four beams, fixed at the left end and loaded by a pressure on the top faces. Each beam is meshed with a different element type:
21+
22+
Disk |CGX | CCX
23+
:-- |:-- | :--
24+
1 (upper)|tr6s |CPS6
25+
2|tr3s | CPS3
26+
3|qu8s | CPS8R
27+
4 (lower)|qu4s | CPS4
28+
29+
<img src="mesh.png" width="400" title="Beams with different element types">
30+
31+
The pre-processing script calls `separate.py`, which separates the elements into disjoint meshes to avoid nodal averaging of the element results (stress). See the [Helper Scripts](../../Scripts) page for details.
32+
33+
## Solving
34+
Because of the different meshes, both versions with and without nodal averaging require different input input files and therefore, different simulation runs.
35+
```
36+
> ccx nodal
37+
> ccx element
38+
```
39+
40+
## Postprocessing
41+
42+
The difference between connected and disjoint meshes is shown by the CGX function `seta ! all`, which plots disjoint meshes in different colours.
43+
44+
### Nodal averaging (nodal solution)
45+
```
46+
> cgx -b post-n.fbd
47+
```
48+
<img src="nodal-mesh.png" width="400" title="Elements are connected by sharing nodes"> <img src="nodal-sx.png" width="400" title="Longitudinal stress, averaged at the nodes">
49+
50+
### No nodal averaging (element solution)
51+
```
52+
> cgx -b post-e.fbd
53+
```
54+
<img src="element-mesh.png" width="400" title="Elements don't share nodes, nodes are connected by equations"> <img src="element-sx.png" width="400" title="Longitudinal stress, not averaged at the nodes">

Linear/Separate/element-mesh.png

4.82 KB
Loading

Linear/Separate/element-sx.png

12.8 KB
Loading

Linear/Separate/element.inp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
*include,input=separate-nod.inc
2+
*include,input=separate-ele.inc
3+
*include,input=separate-eqn.inc
4+
*include, input=fix.nam
5+
*boundary
6+
Nfix,1,2
7+
*MATERIAL,NAME=steel
8+
*ELASTIC
9+
210000,.3
10+
*solid SECTION,ELSET=EALL,MATERIAL=steel
11+
*STEP
12+
*STATIC
13+
*dload
14+
*include,input=load.dlo
15+
*el file
16+
S
17+
*node file
18+
U
19+
*end step

Linear/Separate/mesh.png

4.17 KB
Loading

Linear/Separate/nodal-mesh.png

3.88 KB
Loading

Linear/Separate/nodal-sx.png

12.8 KB
Loading

Linear/Separate/nodal.inp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
*include,input=all.msh
2+
*include, input=fix.nam
3+
*boundary
4+
Nfix,1,2
5+
*MATERIAL,NAME=steel
6+
*ELASTIC
7+
210000,.3
8+
*solid SECTION,ELSET=Eall,MATERIAL=steel
9+
*STEP
10+
*STATIC
11+
*dload
12+
*include,input=load.dlo
13+
*el file
14+
S
15+
*node file
16+
U
17+
*end step

Linear/Separate/post-e.fbd

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
read element.frd new
2+
rot -z
3+
view elem
4+
view edge off
5+
seta ! all
6+
hcpy png
7+
sys mv hcpy_1.png element-mesh.png
8+
9+
ds -0 e 1
10+
view disp
11+
scal d 500
12+
frame
13+
plot fv all
14+
hcpy png
15+
sys mv hcpy_2.png element-sx.png

Linear/Separate/post-n.fbd

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
read nodal.frd
2+
rot -z
3+
view elem
4+
seta ! all
5+
hcpy png
6+
sys mv hcpy_1.png nodal-mesh.png
7+
8+
ds -0 e 1
9+
view disp
10+
scal d 500
11+
frame
12+
plot fv all
13+
hcpy png
14+
sys mv hcpy_2.png nodal-sx.png

0 commit comments

Comments
 (0)