Skip to content

Commit

Permalink
change young#s modulus parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
aradermacher authored and YuXHe15 committed Mar 6, 2024
1 parent 0936b9d commit 8d98589
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 46 deletions.
58 changes: 23 additions & 35 deletions examples/Wall/dodo_wall.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,12 @@
"infill", "zigzag"
), # default infill changable via command line doit -f dodo_wall.py infill=zigzag or solid or honeycomb
# mesh parameters (meshing by layer height)
"line_width": float(get_var('line_width', 11)), # mm # 11 for zigzag 10 for honeycomb to get same volume reduction
"mesh_size_factor": float(get_var('mesh_size',4)), # default mesh size factor changeable via command line doit -f dodo_wall.py mesh_size=4
"line_width": float(
get_var("line_width", 11)
), # mm # 11 for zigzag 10 for honeycomb to get same volume reduction
"mesh_size_factor": float(
get_var("mesh_size", 4)
), # default mesh size factor changeable via command line doit -f dodo_wall.py mesh_size=4
"layer_height": 10, # mm
}
# simulation parameters needs to be in pint units!!
Expand All @@ -40,42 +44,25 @@
* ureg(
""
), # which unit is used in mesh file important since fenicsxconcrete converts all in base units!
"dim": 3 * ureg(""),
"degree": 2 * ureg(""),
"q_degree": 2 * ureg(""),
"bc_setting": "fixed_y_bottom" * ureg(""),
"rho": 2400 * ureg("kg/m^3"),
"g": 9.81 * ureg("m/s^2"),
"E": 33000 * ureg("MPa"),
"nu": 0.2 * ureg(""),
"top_displacement": -20.0 * ureg("mm"),
"material_type": "linear" * ureg(""),
}
params_sim_process = {
"mesh_unit": "mm"
* ureg(
""
), # which unit is used in mesh file important since fenicsxconcrete converts all in base units!
"dim": 3 * ureg(""),
"degree": 2 * ureg(""),
"q_degree": 2 * ureg(""),
"material_type": "thixo" * ureg(""),
"rho": 2070 * ureg("kg/m^3"), # density of fresh concrete
"nu": 0.3 * ureg(""), # Poissons Ratio
"E_0": 0.0779 * ureg("MPa"), # Youngs Modulus at age=0
"R_E": 0 * ureg("Pa/s"), # Reflocculation (first) rate
"A_E": 0.00002 * ureg("MPa/s"), # Structuration (second) rate
"tf_E": 0 * ureg("s"), # Reflocculation time (switch point)
"age_0": 0 * ureg("s"), # start age of concrete
# layer parameter
"layer_height": params["layer_height"] * ureg("mm"), # to activate layer by layer
"num_layers": params["height"] / params["layer_height"] * ureg(""),
"time_per_layer": 6 * ureg("s"), # or velocity and layer thickness
"num_time_steps_per_layer": 2 * ureg(""),
"dim": 3 * ureg(""), # dimension of the simulation
"degree": 2 * ureg(""), # degree of the finite element
"q_degree": 2 * ureg(""), # degree of the quadrature
"g": 9.81 * ureg("m/s^2"), # gravity
"rho": 0
* ureg("kg/m^3"), # density of the material -> no body force in the moment!
"E": 30000 * ureg("MPa"), # Young's modulus (usually concrete: 33000)
"nu": 0.2 * ureg(""), # Poisson's ratio
# "bc_setting": "compr_disp_y" * ureg(""), # bc setting for structure simulation -> defined in task_structure_simulation_...
"top_displacement": -1.5 * ureg("mm"), # max displacement of top surface
"number_steps": 3 * ureg(""), # number of steps for simulation
"material_type": "linear" * ureg(""), # material type
"experiment_type": "structure" * ureg(""), # type of the experiment
}

# TODO datastore stuff??
OUTPUT_NAME = f"{Path(__file__).parent.name}_{params['infill']}_mesh_{params['mesh_size_factor']}"
OUTPUT_NAME = (
f"{Path(__file__).parent.name}_{params['infill']}_mesh_{params['mesh_size_factor']}"
)
OUTPUT = (
Path(__file__).parent / "output"
) # / f'{datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S")}'
Expand Down Expand Up @@ -147,6 +134,7 @@ def task_structure_simulation():
in_file_xdmf = OUTPUT / f"{OUTPUT_NAME}.xdmf"
out_file_xdmf = OUTPUT / f"{OUTPUT_NAME}_sim_disp_x.xdmf"


@create_after(executed="meshing")
def task_process_simulation():
"""Simulating the final structure loaded parallel to layers."""
Expand Down
27 changes: 16 additions & 11 deletions examples/toy/toy.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,19 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 2,
"id": "d493f0fe-461b-4c44-bf0d-9f496d7c626b",
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"The autoreload extension is already loaded. To reload it, use:\n",
" %reload_ext autoreload\n"
]
}
],
"source": [
"import logging\n",
"from pathlib import Path\n",
Expand Down Expand Up @@ -37,7 +46,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 3,
"id": "215a47e0-4ef5-4b70-aa20-5bfed13cac55",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -73,7 +82,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 4,
"id": "41db113a-c770-4c23-8ad1-a1fb0de17ce4",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -175,23 +184,19 @@
},
{
"cell_type": "code",
"execution_count": 21,
"execution_count": 5,
"id": "c14bca8a-187c-437e-a73d-16362beca47f",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[PosixPath('/home/araderma/Documents/03_codes/amworkflow/examples/toy/output_notebook/toy.h5'),\n",
" PosixPath('/home/araderma/Documents/03_codes/amworkflow/examples/toy/output_notebook/toy.csv'),\n",
" PosixPath('/home/araderma/Documents/03_codes/amworkflow/examples/toy/output_notebook/toy.vtk'),\n",
"[PosixPath('/home/araderma/Documents/03_codes/amworkflow/examples/toy/output_notebook/toy.csv'),\n",
" PosixPath('/home/araderma/Documents/03_codes/amworkflow/examples/toy/output_notebook/toy.stl'),\n",
" PosixPath('/home/araderma/Documents/03_codes/amworkflow/examples/toy/output_notebook/toy.msh'),\n",
" PosixPath('/home/araderma/Documents/03_codes/amworkflow/examples/toy/output_notebook/toy.xdmf'),\n",
" PosixPath('/home/araderma/Documents/03_codes/amworkflow/examples/toy/output_notebook/toy.stp')]"
]
},
"execution_count": 21,
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
Expand Down

0 comments on commit 8d98589

Please sign in to comment.