-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* split macros and bib file for paper to reduce conflicts * fix py_macros files * add resulting py macros to git ignore * small changes * fix some warnings * working on homogenization plots * homogenization figure in doit * more changes to homogenization appendix * working on beam model * changing beam design output WIP * working on beam design * new beam design working in snakemake * add GWP of steel * add beam figure to dodo file * update workflow graph * more changes for beam in paper * beam design is working in doit * changes to input values * adding conversion of steel gwp input * added computation paste specific heat capacity * improved sc input to mass fraction * fix sc value * fixed test files * fixed name of bending beam * delete test temp files * remove some temp files with gitignore * update parameters * working on function for calibraton of material model * add json package * e and fc over time is working * add test for E and fc over time * adding alpha_t28d to workflow * added macros for optimization input * add inits to include untested files in coverage * simplifed computation sc volume fraction and added test * fixed computation specific heat paste * small fixes mainly comments * imporve coverage * improve coverage * fixed tests * renaming volume content to mass per cubic meter concrete * add dummy test for dummy script * add safety factors * add loads to workflow * write test to check output keys of workflow * fix link to files * fix link to files * improve temp constraint * continue to write paper section on beam and fem * fix tests * improve beam design mixed constraint * improve beam appendix * working on paper * continue FEM * working on heat of hydration figure * working on introduction * working on introduction * working on introduction * build script for design approach graph * wip * workign on paper * include design approach in doit * improving doit workflow * improve doit output * imporving doit paths * improving dodo * working on introduction * update for analyze kpi * update for analyze kpi * fixed beam plot * working on introduction * improve introduction * create heat release figure * working on FEM section * create evolution figure * write evolution plot script * add evolution to tex * modify dummy script * fix dummy script units and test * integrate computation alpha 28 days to snakemake * Update usecases/optimization_paper/tex/tex_sections/appendix_fem_model.tex Co-authored-by: Sjard Mathis Rosenbusch <[email protected]> * Update usecases/optimization_paper/tex/tex_sections/appendix_fem_model.tex Co-authored-by: Sjard Mathis Rosenbusch <[email protected]> * Update usecases/optimization_paper/tex/tex_sections/concrete_model.tex Co-authored-by: Sjard Mathis Rosenbusch <[email protected]> * Update usecases/optimization_paper/tex/tex_sections/introduction.tex Co-authored-by: Sjard Mathis Rosenbusch <[email protected]> --------- Co-authored-by: Sjard Mathis Rosenbusch <[email protected]>
- Loading branch information
1 parent
a061d07
commit 9094ce3
Showing
21 changed files
with
452 additions
and
209 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
95 changes: 95 additions & 0 deletions
95
usecases/optimization_paper/bam_figures/create_mechanics_evolution_figure.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
import copy | ||
|
||
import fenics_concrete | ||
import matplotlib.pyplot as plt | ||
import numpy as np | ||
import pint | ||
import pytest | ||
from pint.testsuite.helpers import assert_quantity_almost_equal as assert_approx | ||
|
||
from lebedigital.simulation.concrete_homogenization import concrete_homogenization | ||
from lebedigital.unit_registry import ureg | ||
|
||
|
||
def create_mechanics_evolution_figure(input_parameter: dict, fig_path: str = "test_mechanics_evolution_plot.pdf"): | ||
# add figure to tex file and snakemake workflow | ||
|
||
material_problem = fenics_concrete.ConcreteThermoMechanical() | ||
e_fkt = material_problem.mechanics_problem.E_fkt | ||
fc_fkt = material_problem.mechanics_problem.general_hydration_fkt | ||
|
||
# general parameters | ||
parameter = { | ||
"alpha_t": input_parameter["evoExAlphaT"], | ||
"alpha_tx": input_parameter["evoExAlphaTx"], | ||
"alpha_0": 0.0, | ||
"a_E": input_parameter["evoExaE"], | ||
"a_X": input_parameter["evoExafc"], | ||
"E": input_parameter["evoExE"], | ||
"X": input_parameter["evoExfc"], | ||
} | ||
|
||
alpha_list = np.arange(0, 1, 0.005) | ||
|
||
variation_dict = { | ||
"alpha_t": { | ||
"params": [parameter["alpha_t"], 0.0, 0.6], | ||
"fkt": e_fkt, | ||
"ylabel": "Elastic modulus $E$ [GPa ???]", | ||
"ylim": 60, | ||
}, | ||
"a_E": { | ||
"params": [parameter["a_E"], 0.2, 1.3], | ||
"fkt": e_fkt, | ||
"ylabel": "Elastic modulus $E$ [GPa ???]", | ||
"ylim": 60, | ||
}, | ||
"a_X": { | ||
"params": [parameter["a_X"], 0.2, 1.3], | ||
"fkt": fc_fkt, | ||
"ylabel": "Compressive strength $f_c$ [MPa ???]", | ||
"ylim": 40, | ||
}, | ||
} | ||
|
||
# setup plot | ||
fig, axs = plt.subplots(1, len(variation_dict), figsize=(5 * len(variation_dict), 4)) | ||
ureg.setup_matplotlib() | ||
|
||
i = 0 | ||
for key in variation_dict.keys(): | ||
p = copy.deepcopy(parameter) | ||
var_par_list = variation_dict[key]["params"] | ||
fkt = variation_dict[key]["fkt"] | ||
|
||
for value in var_par_list: | ||
p[key] = value | ||
y_list = [] | ||
for alpha in alpha_list: | ||
y_list.append(fkt(alpha, p)) | ||
axs[i].plot(alpha_list, y_list, label=key + " = " + str(value)) | ||
|
||
axs[i].legend() | ||
axs[i].set_xlabel(f"Degree of hydration $\\alpha$") | ||
axs[i].set_ylabel(variation_dict[key]["ylabel"]) | ||
axs[i].set_xlim([0, 1]) | ||
axs[i].set_ylim([0, variation_dict[key]["ylim"]]) | ||
|
||
i += 1 | ||
|
||
fig.tight_layout() | ||
# plt.show() | ||
fig.savefig(fig_path) | ||
|
||
|
||
if __name__ == "__main__": | ||
parameter = { | ||
"evoExAlphaT": 0.2, | ||
"evoExAlphaTx": 0.8, | ||
"evoExaE": 0.5, | ||
"evoExafc": 0.5, | ||
"evoExE": 50, | ||
"evoExfc": 30, | ||
} | ||
|
||
create_mechanics_evolution_figure(parameter) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.