Skip to content

Commit

Permalink
update supension as describe in #150
Browse files Browse the repository at this point in the history
  • Loading branch information
jobinhio committed Dec 1, 2022
1 parent 710dca7 commit e63b64f
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 10 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 12 additions & 9 deletions examples/modules/csm/examples/suspension/suspension.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,21 @@
{
"Exports":
{
"fields":["displacement"]
"fields":["displacement","pid","von-mises-criterion"]
},
"Statistics":
"Measures":
{
"disp":
"Statistics":
{
"type":["min","max","mean"],
"field":"displacement"
},
"von-mises": {
"type": ["min","max","mean"],
"expr": "sqrt(0.5*((solid_stress_P_00-solid_stress_P_11)^2+(solid_stress_P_11-solid_stress_P_22)^2+(solid_stress_P_22-solid_stress_P_11)^2+6*(solid_stress_P_12^2+solid_stress_P_23^2+solid_stress_P_31^2))):solid_stress_P_00:solid_stress_P_11:solid_stress_P_22:solid_stress_P_12:solid_stress_P_23:solid_stress_P_31"
"disp":
{
"type":["min","max","mean"],
"field":"displacement"
},
"von-mises": {
"type": ["min","max","mean"],
"expr": "sqrt(0.5*((solid_stress_P_00-solid_stress_P_11)^2+(solid_stress_P_11-solid_stress_P_22)^2+(solid_stress_P_22-solid_stress_P_11)^2+6*(solid_stress_P_12^2+solid_stress_P_23^2+solid_stress_P_31^2))):solid_stress_P_00:solid_stress_P_11:solid_stress_P_22:solid_stress_P_12:solid_stress_P_23:solid_stress_P_31"
}
}
}
}
Expand Down
80 changes: 79 additions & 1 deletion examples/modules/csm/pages/suspension/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ suspensioncfg+='/suspension.cfg'
if os.path.exists(suspensioncfg):
app.setConfigFile(suspensioncfg)
s = solid(dim=3)
s = solid(dim=3)
ok,meas=simulate(s)
if ok:
# export in paraview format
s.exportResults()
----
== Data files

Expand Down Expand Up @@ -99,9 +103,64 @@ image:{imagesprefix}suspension/image6.png[1.png,width=209,height=188]

NOTE: The result were run in time (two whole period, but in the pictures can be seen only a quarter period).

[source,python]
----
import pandas as pd
df=pd.DataFrame(meas)
print(df.head())
# prepare for plotting
import plotly.graph_objects as go
----

[%collapsible.result]
.Results
====
----
Paraview files are in /scratch/jupyter/feelppdb/np_1/np_1/solid.exports
Statistics_disp_max Statistics_disp_mean_0 Statistics_disp_mean_1 \
0 0.000000 0.000000 0.000000
1 0.300347 0.133346 0.000059
2 0.607255 0.271978 0.000166
3 0.854034 0.379294 0.000305
4 1.116512 0.499815 0.000475
Statistics_disp_mean_2 Statistics_disp_min Statistics_von-mises_max \
0 0.000000 0.000000 0.000000
1 -0.001735 -0.032935 208.036037
2 -0.003278 -0.066174 419.853790
3 -0.004200 -0.092967 594.509462
4 -0.005155 -0.120885 775.939518
Statistics_von-mises_mean Statistics_von-mises_min time
0 0.000000 0.000000 0.0
1 19.379505 0.049740 0.1
2 39.259107 0.104465 0.2
3 55.140414 0.167094 0.3
4 72.230883 0.230105 0.4
----
====


=== Displacement

.Plot the max of the displacement over time
[source,python]
----
fig = go.Figure()
fig.add_trace(go.Scatter(x=df["time"], y=df["Statistics_disp_max"], name="max disp"))
fig.add_trace(go.Scatter(x=df["time"], y=df["Statistics_disp_min"], name="min disp"))
fig.update_layout(legend_title_text='Max displacement over time')
fig.show()
----

[%collapsible.result]
.Results
====
image:{imagesprefix}suspension/minmaxdisp.png[]
====


We display the displacement in the figures below. A 20x scale factor is used to make the displacement easy to see.
The maximum displacement is 1.778 mm. The design of the wishbones is very good because there is only little displacement due to the force.

Expand All @@ -128,3 +187,22 @@ feelppVtkJs.createSceneImporter( vtkVisuSection1, {
++++
****

=== Von-Mises Criterions

.Plot the max of the von-mises criterion over time
[source,python]
----
fig = go.Figure()
fig.add_trace(go.Scatter(x=df["time"], y=df["Statistics_von-mises_max"],name="max"))
fig.add_trace(go.Scatter(x=df["time"], y=df["Statistics_von-mises_min"],name="min"))
fig.add_trace(go.Scatter(x=df["time"], y=df["Statistics_von-mises_mean"],name="mean"))
fig.update_layout(legend_title_text='Von-Mises min,mean and max over time')
fig.show()
----

[%collapsible.result]
.Results
====
image:{imagesprefix}suspension/minmaxvonmises.png[]
====

0 comments on commit e63b64f

Please sign in to comment.