pyvale 2025.5.3__cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pyvale might be problematic. Click here for more details.
- pyvale/__init__.py +89 -0
- pyvale/analyticmeshgen.py +102 -0
- pyvale/analyticsimdatafactory.py +91 -0
- pyvale/analyticsimdatagenerator.py +323 -0
- pyvale/blendercalibrationdata.py +15 -0
- pyvale/blenderlightdata.py +26 -0
- pyvale/blendermaterialdata.py +15 -0
- pyvale/blenderrenderdata.py +30 -0
- pyvale/blenderscene.py +488 -0
- pyvale/blendertools.py +420 -0
- pyvale/camera.py +146 -0
- pyvale/cameradata.py +69 -0
- pyvale/cameradata2d.py +84 -0
- pyvale/camerastereo.py +217 -0
- pyvale/cameratools.py +522 -0
- pyvale/cython/rastercyth.c +32211 -0
- pyvale/cython/rastercyth.cpython-311-i386-linux-gnu.so +0 -0
- pyvale/cython/rastercyth.py +640 -0
- pyvale/data/__init__.py +5 -0
- pyvale/data/cal_target.tiff +0 -0
- pyvale/data/case00_HEX20_out.e +0 -0
- pyvale/data/case00_HEX27_out.e +0 -0
- pyvale/data/case00_HEX8_out.e +0 -0
- pyvale/data/case00_TET10_out.e +0 -0
- pyvale/data/case00_TET14_out.e +0 -0
- pyvale/data/case00_TET4_out.e +0 -0
- pyvale/data/case13_out.e +0 -0
- pyvale/data/case16_out.e +0 -0
- pyvale/data/case17_out.e +0 -0
- pyvale/data/case18_1_out.e +0 -0
- pyvale/data/case18_2_out.e +0 -0
- pyvale/data/case18_3_out.e +0 -0
- pyvale/data/case25_out.e +0 -0
- pyvale/data/case26_out.e +0 -0
- pyvale/data/optspeckle_2464x2056px_spec5px_8bit_gblur1px.tiff +0 -0
- pyvale/dataset.py +325 -0
- pyvale/errorcalculator.py +109 -0
- pyvale/errordriftcalc.py +146 -0
- pyvale/errorintegrator.py +336 -0
- pyvale/errorrand.py +607 -0
- pyvale/errorsyscalib.py +134 -0
- pyvale/errorsysdep.py +327 -0
- pyvale/errorsysfield.py +414 -0
- pyvale/errorsysindep.py +808 -0
- pyvale/examples/__init__.py +5 -0
- pyvale/examples/basics/ex1_1_basicscalars_therm2d.py +131 -0
- pyvale/examples/basics/ex1_2_sensormodel_therm2d.py +158 -0
- pyvale/examples/basics/ex1_3_customsens_therm3d.py +216 -0
- pyvale/examples/basics/ex1_4_basicerrors_therm3d.py +153 -0
- pyvale/examples/basics/ex1_5_fielderrs_therm3d.py +168 -0
- pyvale/examples/basics/ex1_6_caliberrs_therm2d.py +133 -0
- pyvale/examples/basics/ex1_7_spatavg_therm2d.py +123 -0
- pyvale/examples/basics/ex2_1_basicvectors_disp2d.py +112 -0
- pyvale/examples/basics/ex2_2_vectorsens_disp2d.py +111 -0
- pyvale/examples/basics/ex2_3_sensangle_disp2d.py +139 -0
- pyvale/examples/basics/ex2_4_chainfielderrs_disp2d.py +196 -0
- pyvale/examples/basics/ex2_5_vectorfields3d_disp3d.py +109 -0
- pyvale/examples/basics/ex3_1_basictensors_strain2d.py +114 -0
- pyvale/examples/basics/ex3_2_tensorsens2d_strain2d.py +111 -0
- pyvale/examples/basics/ex3_3_tensorsens3d_strain3d.py +182 -0
- pyvale/examples/basics/ex4_1_expsim2d_thermmech2d.py +171 -0
- pyvale/examples/basics/ex4_2_expsim3d_thermmech3d.py +252 -0
- pyvale/examples/genanalyticdata/ex1_1_scalarvisualisation.py +35 -0
- pyvale/examples/genanalyticdata/ex1_2_scalarcasebuild.py +43 -0
- pyvale/examples/genanalyticdata/ex2_1_analyticsensors.py +80 -0
- pyvale/examples/imagedef2d/ex_imagedef2d_todisk.py +79 -0
- pyvale/examples/renderblender/ex1_1_blenderscene.py +121 -0
- pyvale/examples/renderblender/ex1_2_blenderdeformed.py +119 -0
- pyvale/examples/renderblender/ex2_1_stereoscene.py +128 -0
- pyvale/examples/renderblender/ex2_2_stereodeformed.py +131 -0
- pyvale/examples/renderblender/ex3_1_blendercalibration.py +120 -0
- pyvale/examples/renderrasterisation/ex_rastenp.py +153 -0
- pyvale/examples/renderrasterisation/ex_rastercyth_oneframe.py +218 -0
- pyvale/examples/renderrasterisation/ex_rastercyth_static_cypara.py +187 -0
- pyvale/examples/renderrasterisation/ex_rastercyth_static_pypara.py +190 -0
- pyvale/examples/visualisation/ex1_1_plot_traces.py +102 -0
- pyvale/examples/visualisation/ex2_1_animate_sim.py +89 -0
- pyvale/experimentsimulator.py +175 -0
- pyvale/field.py +128 -0
- pyvale/fieldconverter.py +351 -0
- pyvale/fieldsampler.py +111 -0
- pyvale/fieldscalar.py +166 -0
- pyvale/fieldtensor.py +218 -0
- pyvale/fieldtransform.py +388 -0
- pyvale/fieldvector.py +213 -0
- pyvale/generatorsrandom.py +505 -0
- pyvale/imagedef2d.py +569 -0
- pyvale/integratorfactory.py +240 -0
- pyvale/integratorquadrature.py +217 -0
- pyvale/integratorrectangle.py +165 -0
- pyvale/integratorspatial.py +89 -0
- pyvale/integratortype.py +43 -0
- pyvale/output.py +17 -0
- pyvale/pyvaleexceptions.py +11 -0
- pyvale/raster.py +31 -0
- pyvale/rastercy.py +77 -0
- pyvale/rasternp.py +603 -0
- pyvale/rendermesh.py +147 -0
- pyvale/sensorarray.py +178 -0
- pyvale/sensorarrayfactory.py +196 -0
- pyvale/sensorarraypoint.py +278 -0
- pyvale/sensordata.py +71 -0
- pyvale/sensordescriptor.py +213 -0
- pyvale/sensortools.py +142 -0
- pyvale/simcases/case00_HEX20.i +242 -0
- pyvale/simcases/case00_HEX27.i +242 -0
- pyvale/simcases/case00_HEX8.i +242 -0
- pyvale/simcases/case00_TET10.i +242 -0
- pyvale/simcases/case00_TET14.i +242 -0
- pyvale/simcases/case00_TET4.i +242 -0
- pyvale/simcases/case01.i +101 -0
- pyvale/simcases/case02.i +156 -0
- pyvale/simcases/case03.i +136 -0
- pyvale/simcases/case04.i +181 -0
- pyvale/simcases/case05.i +234 -0
- pyvale/simcases/case06.i +305 -0
- pyvale/simcases/case07.geo +135 -0
- pyvale/simcases/case07.i +87 -0
- pyvale/simcases/case08.geo +144 -0
- pyvale/simcases/case08.i +153 -0
- pyvale/simcases/case09.geo +204 -0
- pyvale/simcases/case09.i +87 -0
- pyvale/simcases/case10.geo +204 -0
- pyvale/simcases/case10.i +257 -0
- pyvale/simcases/case11.geo +337 -0
- pyvale/simcases/case11.i +147 -0
- pyvale/simcases/case12.geo +388 -0
- pyvale/simcases/case12.i +329 -0
- pyvale/simcases/case13.i +140 -0
- pyvale/simcases/case14.i +159 -0
- pyvale/simcases/case15.geo +337 -0
- pyvale/simcases/case15.i +150 -0
- pyvale/simcases/case16.geo +391 -0
- pyvale/simcases/case16.i +357 -0
- pyvale/simcases/case17.geo +135 -0
- pyvale/simcases/case17.i +144 -0
- pyvale/simcases/case18.i +254 -0
- pyvale/simcases/case18_1.i +254 -0
- pyvale/simcases/case18_2.i +254 -0
- pyvale/simcases/case18_3.i +254 -0
- pyvale/simcases/case19.geo +252 -0
- pyvale/simcases/case19.i +99 -0
- pyvale/simcases/case20.geo +252 -0
- pyvale/simcases/case20.i +250 -0
- pyvale/simcases/case21.geo +74 -0
- pyvale/simcases/case21.i +155 -0
- pyvale/simcases/case22.geo +82 -0
- pyvale/simcases/case22.i +140 -0
- pyvale/simcases/case23.geo +164 -0
- pyvale/simcases/case23.i +140 -0
- pyvale/simcases/case24.geo +79 -0
- pyvale/simcases/case24.i +123 -0
- pyvale/simcases/case25.geo +82 -0
- pyvale/simcases/case25.i +140 -0
- pyvale/simcases/case26.geo +166 -0
- pyvale/simcases/case26.i +140 -0
- pyvale/simcases/run_1case.py +61 -0
- pyvale/simcases/run_all_cases.py +69 -0
- pyvale/simcases/run_build_case.py +64 -0
- pyvale/simcases/run_example_cases.py +69 -0
- pyvale/simtools.py +67 -0
- pyvale/visualexpplotter.py +191 -0
- pyvale/visualimagedef.py +74 -0
- pyvale/visualimages.py +76 -0
- pyvale/visualopts.py +493 -0
- pyvale/visualsimanimator.py +111 -0
- pyvale/visualsimsensors.py +318 -0
- pyvale/visualtools.py +136 -0
- pyvale/visualtraceplotter.py +142 -0
- pyvale-2025.5.3.dist-info/METADATA +144 -0
- pyvale-2025.5.3.dist-info/RECORD +175 -0
- pyvale-2025.5.3.dist-info/WHEEL +6 -0
- pyvale-2025.5.3.dist-info/licenses/LICENSE +21 -0
- pyvale-2025.5.3.dist-info/top_level.txt +1 -0
- pyvale.libs/libgomp-65f46eca.so.1.0.0 +0 -0
pyvale/sensortools.py
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# ==============================================================================
|
|
2
|
+
# pyvale: the python validation engine
|
|
3
|
+
# License: MIT
|
|
4
|
+
# Copyright (C) 2025 The Computer Aided Validation Team
|
|
5
|
+
# ==============================================================================
|
|
6
|
+
|
|
7
|
+
import numpy as np
|
|
8
|
+
import mooseherder as mh
|
|
9
|
+
from pyvale.sensorarray import ISensorArray
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def create_sensor_pos_array(num_sensors: tuple[int,int,int],
|
|
13
|
+
x_lims: tuple[float, float],
|
|
14
|
+
y_lims: tuple[float, float],
|
|
15
|
+
z_lims: tuple[float, float]) -> np.ndarray:
|
|
16
|
+
"""Function or creating a uniform grid of sensors inside the specified
|
|
17
|
+
bounds and returning the positions in format that can be used to build a
|
|
18
|
+
`SensorData` object.
|
|
19
|
+
|
|
20
|
+
To create a line of sensors along the X axis set the number of sensors to 1
|
|
21
|
+
for all the Y and Z axes and then set the upper and lower limits of the Y
|
|
22
|
+
and Z axis to be the same value.
|
|
23
|
+
|
|
24
|
+
To create a plane of sensors in the X-Y plane set the number of sensors in
|
|
25
|
+
Z to 1 and set the upper and lower coordinates of the Z limit to the desired
|
|
26
|
+
Z location of the plane. Then set the number of sensors in X and Y as
|
|
27
|
+
desired along with the associated limits.
|
|
28
|
+
|
|
29
|
+
Parameters
|
|
30
|
+
----------
|
|
31
|
+
n_sens : tuple[int,int,int]
|
|
32
|
+
Number of sensors to create in the X, Y and Z directions.
|
|
33
|
+
x_lims : tuple[float, float]
|
|
34
|
+
Limits of the X axis sensor locations.
|
|
35
|
+
y_lims : tuple[float, float]
|
|
36
|
+
Limits of the Y axis sensor locations.
|
|
37
|
+
z_lims : tuple[float, float]
|
|
38
|
+
Limits of the Z axis sensor locations.
|
|
39
|
+
|
|
40
|
+
Returns
|
|
41
|
+
-------
|
|
42
|
+
np.ndarray
|
|
43
|
+
Array of sensor positions with shape=(num_sensors,3) where num_sensors
|
|
44
|
+
is the product of integers in the num_sensors tuple. The columns are the
|
|
45
|
+
X, Y and Z locations of the sensors.
|
|
46
|
+
"""
|
|
47
|
+
sens_pos_x = np.linspace(x_lims[0],x_lims[1],num_sensors[0]+2)[1:-1]
|
|
48
|
+
sens_pos_y = np.linspace(y_lims[0],y_lims[1],num_sensors[1]+2)[1:-1]
|
|
49
|
+
sens_pos_z = np.linspace(z_lims[0],z_lims[1],num_sensors[2]+2)[1:-1]
|
|
50
|
+
|
|
51
|
+
(sens_grid_x,sens_grid_y,sens_grid_z) = np.meshgrid(
|
|
52
|
+
sens_pos_x,sens_pos_y,sens_pos_z)
|
|
53
|
+
|
|
54
|
+
sens_pos_x = sens_grid_x.flatten()
|
|
55
|
+
sens_pos_y = sens_grid_y.flatten()
|
|
56
|
+
sens_pos_z = sens_grid_z.flatten()
|
|
57
|
+
|
|
58
|
+
sens_pos = np.vstack((sens_pos_x,sens_pos_y,sens_pos_z)).T
|
|
59
|
+
return sens_pos
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def print_measurements(sens_array: ISensorArray,
|
|
63
|
+
sensors: tuple[int,int],
|
|
64
|
+
components: tuple[int,int],
|
|
65
|
+
time_steps: tuple[int,int]) -> None:
|
|
66
|
+
"""Diagnostic function to print sensor measurements to the console. Also
|
|
67
|
+
prints the ground truth, the random and the systematic errors for the
|
|
68
|
+
specified sensor array. The sensors, components and time steps are specified
|
|
69
|
+
as slices of the measurement array.
|
|
70
|
+
|
|
71
|
+
Parameters
|
|
72
|
+
----------
|
|
73
|
+
sens_array : ISensorArray
|
|
74
|
+
Sensor array to print measurement for.
|
|
75
|
+
sensors : tuple[int,int]
|
|
76
|
+
Range of sensors to print from the measurement array using the slice
|
|
77
|
+
specified by this tuple.
|
|
78
|
+
components : tuple[int,int]
|
|
79
|
+
Range of field components to print based on slicing the measurement
|
|
80
|
+
array with this tuple.
|
|
81
|
+
time_steps : tuple[int,int]
|
|
82
|
+
Range of time steps to print based on slicing the measurement array with
|
|
83
|
+
this tuple.
|
|
84
|
+
"""
|
|
85
|
+
measurement = sens_array.get_measurements()
|
|
86
|
+
truth = sens_array.get_truth()
|
|
87
|
+
rand_errs = sens_array.get_errors_random()
|
|
88
|
+
sys_errs = sens_array.get_errors_systematic()
|
|
89
|
+
tot_errs = sens_array.get_errors_total()
|
|
90
|
+
|
|
91
|
+
print(f"\nmeasurement.shape = \n {measurement.shape}")
|
|
92
|
+
print_meas = measurement[sensors[0]:sensors[1],
|
|
93
|
+
components[0]:components[1],
|
|
94
|
+
time_steps[0]:time_steps[1]]
|
|
95
|
+
print(f"measurement = \n {print_meas}")
|
|
96
|
+
|
|
97
|
+
print_truth = truth[sensors[0]:sensors[1],
|
|
98
|
+
components[0]:components[1],
|
|
99
|
+
time_steps[0]:time_steps[1]]
|
|
100
|
+
print(f"truth = \n {print_truth}")
|
|
101
|
+
|
|
102
|
+
if rand_errs is not None:
|
|
103
|
+
print_randerrs = rand_errs[sensors[0]:sensors[1],
|
|
104
|
+
components[0]:components[1],
|
|
105
|
+
time_steps[0]:time_steps[1]]
|
|
106
|
+
print(f"random errors = \n {print_randerrs}")
|
|
107
|
+
|
|
108
|
+
if sys_errs is not None:
|
|
109
|
+
print_syserrs = sys_errs[sensors[0]:sensors[1],
|
|
110
|
+
components[0]:components[1],
|
|
111
|
+
time_steps[0]:time_steps[1]]
|
|
112
|
+
print(f"systematic errors = \n {print_syserrs}")
|
|
113
|
+
|
|
114
|
+
if tot_errs is not None:
|
|
115
|
+
print_toterrs = tot_errs[sensors[0]:sensors[1],
|
|
116
|
+
components[0]:components[1],
|
|
117
|
+
time_steps[0]:time_steps[1]]
|
|
118
|
+
print(f"total errors = \n {print_toterrs}")
|
|
119
|
+
|
|
120
|
+
print()
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
def print_dimensions(sim_data: mh.SimData) -> None:
|
|
124
|
+
"""Diagnostic function for quickly finding the coordinate limits for from a
|
|
125
|
+
given simulation.
|
|
126
|
+
|
|
127
|
+
Parameters
|
|
128
|
+
----------
|
|
129
|
+
sim_data : mh.SimData
|
|
130
|
+
Simulation data objects containing the nodal coordinates.
|
|
131
|
+
"""
|
|
132
|
+
print(80*"-")
|
|
133
|
+
print("SimData Dimensions:")
|
|
134
|
+
print(f"x [min,max] = [{np.min(sim_data.coords[:,0])}," + \
|
|
135
|
+
f"{np.max(sim_data.coords[:,0])}]")
|
|
136
|
+
print(f"y [min,max] = [{np.min(sim_data.coords[:,1])}," + \
|
|
137
|
+
f"{np.max(sim_data.coords[:,1])}]")
|
|
138
|
+
print(f"z [min,max] = [{np.min(sim_data.coords[:,2])}," + \
|
|
139
|
+
f"{np.max(sim_data.coords[:,2])}]")
|
|
140
|
+
print(f"t [min,max] = [{np.min(sim_data.time)},{np.max(sim_data.time)}]")
|
|
141
|
+
print(80*"-")
|
|
142
|
+
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
#-------------------------------------------------------------------------
|
|
2
|
+
# pyvale: single element test 3D
|
|
3
|
+
#-------------------------------------------------------------------------
|
|
4
|
+
|
|
5
|
+
#-------------------------------------------------------------------------
|
|
6
|
+
#_* MOOSEHERDER VARIABLES - START
|
|
7
|
+
|
|
8
|
+
endTime = 20
|
|
9
|
+
timeStep = 1
|
|
10
|
+
|
|
11
|
+
# Geometric Properties
|
|
12
|
+
lengX = 10e-3 # m
|
|
13
|
+
lengY = 10e-3 # m
|
|
14
|
+
lengZ = 10e-3 # m
|
|
15
|
+
|
|
16
|
+
# Mesh Properties
|
|
17
|
+
nElemX = 2
|
|
18
|
+
nElemY = 2
|
|
19
|
+
nElemZ = 2
|
|
20
|
+
eType = HEX20 # TET10, TET11, HEX20, HEX27
|
|
21
|
+
|
|
22
|
+
# Thermal BCs
|
|
23
|
+
coolantTemp=100.0 # degC
|
|
24
|
+
heatTransCoeff=125.0e3 # W.m^-2.K^-1
|
|
25
|
+
surfHeatFlux=4.67e6 # W.m^-2, taken from Adel's first paper
|
|
26
|
+
timeConst = 1 # s
|
|
27
|
+
|
|
28
|
+
# Mechanical Loads/BCs
|
|
29
|
+
topDispRate = ${fparse 1e-3 / endTime} # m/s
|
|
30
|
+
|
|
31
|
+
# Thermal Props:
|
|
32
|
+
Density = 8829.0 # kg.m^-3
|
|
33
|
+
ThermCond = 384.0 # W.m^-1.K^-1
|
|
34
|
+
SpecHeat = 406.0 # J.kg^-1.K^-1
|
|
35
|
+
|
|
36
|
+
# Material Properties:
|
|
37
|
+
EMod= 100e9 # Pa
|
|
38
|
+
PRatio = 0.33 # -
|
|
39
|
+
|
|
40
|
+
# Thermo-mechanical coupling
|
|
41
|
+
stressFreeTemp = 20 # degC
|
|
42
|
+
ThermExp = 17.8e-6 # 1/degC
|
|
43
|
+
|
|
44
|
+
#** MOOSEHERDER VARIABLES - END
|
|
45
|
+
#-------------------------------------------------------------------------
|
|
46
|
+
|
|
47
|
+
[GlobalParams]
|
|
48
|
+
displacements = 'disp_x disp_y disp_z'
|
|
49
|
+
[]
|
|
50
|
+
|
|
51
|
+
[Mesh]
|
|
52
|
+
[generated]
|
|
53
|
+
type = GeneratedMeshGenerator
|
|
54
|
+
dim = 3
|
|
55
|
+
nx = ${nElemX}
|
|
56
|
+
ny = ${nElemY}
|
|
57
|
+
nz = ${nElemZ}
|
|
58
|
+
xmax = ${lengX}
|
|
59
|
+
ymax = ${lengY}
|
|
60
|
+
zmax = ${lengZ}
|
|
61
|
+
elem_type = ${eType}
|
|
62
|
+
[]
|
|
63
|
+
[]
|
|
64
|
+
|
|
65
|
+
[Variables]
|
|
66
|
+
[temperature]
|
|
67
|
+
family = LAGRANGE
|
|
68
|
+
order = SECOND
|
|
69
|
+
initial_condition = ${coolantTemp}
|
|
70
|
+
[]
|
|
71
|
+
[]
|
|
72
|
+
|
|
73
|
+
[Kernels]
|
|
74
|
+
[heat_conduction]
|
|
75
|
+
type = HeatConduction
|
|
76
|
+
variable = temperature
|
|
77
|
+
[]
|
|
78
|
+
[time_derivative]
|
|
79
|
+
type = HeatConductionTimeDerivative
|
|
80
|
+
variable = temperature
|
|
81
|
+
[]
|
|
82
|
+
[]
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
[Physics/SolidMechanics/QuasiStatic]
|
|
86
|
+
[all]
|
|
87
|
+
strain = SMALL
|
|
88
|
+
incremental = true
|
|
89
|
+
add_variables = true
|
|
90
|
+
material_output_family = MONOMIAL # MONOMIAL, LAGRANGE
|
|
91
|
+
material_output_order = FIRST # CONSTANT, FIRST, SECOND,
|
|
92
|
+
generate_output = 'strain_xx strain_yy strain_zz strain_xy strain_yz strain_xz'
|
|
93
|
+
[]
|
|
94
|
+
[]
|
|
95
|
+
|
|
96
|
+
[BCs]
|
|
97
|
+
[heat_flux_in]
|
|
98
|
+
type = FunctionNeumannBC
|
|
99
|
+
variable = temperature
|
|
100
|
+
boundary = 'top'
|
|
101
|
+
function = '${fparse surfHeatFlux}*(1-exp(-(1/${timeConst})*t))'
|
|
102
|
+
[]
|
|
103
|
+
[heat_flux_out]
|
|
104
|
+
type = ConvectiveHeatFluxBC
|
|
105
|
+
variable = temperature
|
|
106
|
+
boundary = 'bottom'
|
|
107
|
+
T_infinity = ${coolantTemp}
|
|
108
|
+
heat_transfer_coefficient = ${heatTransCoeff}
|
|
109
|
+
[]
|
|
110
|
+
|
|
111
|
+
[bottom_x]
|
|
112
|
+
type = DirichletBC
|
|
113
|
+
variable = disp_x
|
|
114
|
+
boundary = 'bottom'
|
|
115
|
+
value = 0.0
|
|
116
|
+
[]
|
|
117
|
+
[bottom_y]
|
|
118
|
+
type = DirichletBC
|
|
119
|
+
variable = disp_y
|
|
120
|
+
boundary = 'bottom'
|
|
121
|
+
value = 0.0
|
|
122
|
+
[]
|
|
123
|
+
[bottom_z]
|
|
124
|
+
type = DirichletBC
|
|
125
|
+
variable = disp_z
|
|
126
|
+
boundary = 'bottom'
|
|
127
|
+
value = 0.0
|
|
128
|
+
[]
|
|
129
|
+
[top_x]
|
|
130
|
+
type = DirichletBC
|
|
131
|
+
variable = disp_x
|
|
132
|
+
boundary = 'top'
|
|
133
|
+
value = 0.0
|
|
134
|
+
[]
|
|
135
|
+
[top_y]
|
|
136
|
+
type = FunctionDirichletBC
|
|
137
|
+
variable = disp_y
|
|
138
|
+
boundary = 'top'
|
|
139
|
+
function = '${topDispRate}*t'
|
|
140
|
+
[]
|
|
141
|
+
[top_z]
|
|
142
|
+
type = DirichletBC
|
|
143
|
+
variable = disp_z
|
|
144
|
+
boundary = 'top'
|
|
145
|
+
value = 0.0
|
|
146
|
+
[]
|
|
147
|
+
[]
|
|
148
|
+
|
|
149
|
+
[Materials]
|
|
150
|
+
[mat_thermal]
|
|
151
|
+
type = HeatConductionMaterial
|
|
152
|
+
thermal_conductivity = ${ThermCond}
|
|
153
|
+
specific_heat = ${SpecHeat}
|
|
154
|
+
[]
|
|
155
|
+
[mat_density]
|
|
156
|
+
type = GenericConstantMaterial
|
|
157
|
+
prop_names = 'density'
|
|
158
|
+
prop_values = ${Density}
|
|
159
|
+
[]
|
|
160
|
+
[mat_expansion]
|
|
161
|
+
type = ComputeThermalExpansionEigenstrain
|
|
162
|
+
temperature = temperature
|
|
163
|
+
stress_free_temperature = ${stressFreeTemp}
|
|
164
|
+
thermal_expansion_coeff = ${ThermExp}
|
|
165
|
+
eigenstrain_name = thermal_expansion_eigenstrain
|
|
166
|
+
[]
|
|
167
|
+
|
|
168
|
+
[mat_elasticity]
|
|
169
|
+
type = ComputeIsotropicElasticityTensor
|
|
170
|
+
youngs_modulus = ${EMod}
|
|
171
|
+
poissons_ratio = ${PRatio}
|
|
172
|
+
[]
|
|
173
|
+
[stress]
|
|
174
|
+
type = ComputeFiniteStrainElasticStress
|
|
175
|
+
[]
|
|
176
|
+
[]
|
|
177
|
+
|
|
178
|
+
[Preconditioning]
|
|
179
|
+
[SMP]
|
|
180
|
+
type = SMP
|
|
181
|
+
full = true
|
|
182
|
+
[]
|
|
183
|
+
[]
|
|
184
|
+
|
|
185
|
+
[Executioner]
|
|
186
|
+
type = Transient
|
|
187
|
+
|
|
188
|
+
solve_type = 'NEWTON'
|
|
189
|
+
petsc_options = '-snes_converged_reason'
|
|
190
|
+
petsc_options_iname = '-pc_type -pc_hypre_type'
|
|
191
|
+
petsc_options_value = 'hypre boomeramg'
|
|
192
|
+
|
|
193
|
+
l_max_its = 1000
|
|
194
|
+
l_tol = 1e-6
|
|
195
|
+
|
|
196
|
+
nl_max_its = 50
|
|
197
|
+
nl_rel_tol = 1e-6
|
|
198
|
+
nl_abs_tol = 1e-6
|
|
199
|
+
|
|
200
|
+
start_time=0.0
|
|
201
|
+
end_time = ${endTime}
|
|
202
|
+
dt = ${timeStep}
|
|
203
|
+
|
|
204
|
+
[Predictor]
|
|
205
|
+
type = SimplePredictor
|
|
206
|
+
scale = 1
|
|
207
|
+
[]
|
|
208
|
+
[]
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
[Postprocessors]
|
|
212
|
+
[react_y_bot]
|
|
213
|
+
type = SidesetReaction
|
|
214
|
+
direction = '0 1 0'
|
|
215
|
+
stress_tensor = stress
|
|
216
|
+
boundary = 'bottom'
|
|
217
|
+
[]
|
|
218
|
+
[react_y_top]
|
|
219
|
+
type = SidesetReaction
|
|
220
|
+
direction = '0 1 0'
|
|
221
|
+
stress_tensor = stress
|
|
222
|
+
boundary = 'top'
|
|
223
|
+
[]
|
|
224
|
+
|
|
225
|
+
[disp_y_max]
|
|
226
|
+
type = NodalExtremeValue
|
|
227
|
+
variable = disp_y
|
|
228
|
+
[]
|
|
229
|
+
[disp_x_max]
|
|
230
|
+
type = NodalExtremeValue
|
|
231
|
+
variable = disp_x
|
|
232
|
+
[]
|
|
233
|
+
[disp_z_max]
|
|
234
|
+
type = NodalExtremeValue
|
|
235
|
+
variable = disp_z
|
|
236
|
+
[]
|
|
237
|
+
|
|
238
|
+
[]
|
|
239
|
+
|
|
240
|
+
[Outputs]
|
|
241
|
+
exodus = true
|
|
242
|
+
[]
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
#-------------------------------------------------------------------------
|
|
2
|
+
# pyvale: single element test 3D
|
|
3
|
+
#-------------------------------------------------------------------------
|
|
4
|
+
|
|
5
|
+
#-------------------------------------------------------------------------
|
|
6
|
+
#_* MOOSEHERDER VARIABLES - START
|
|
7
|
+
|
|
8
|
+
endTime = 20
|
|
9
|
+
timeStep = 1
|
|
10
|
+
|
|
11
|
+
# Geometric Properties
|
|
12
|
+
lengX = 10e-3 # m
|
|
13
|
+
lengY = 10e-3 # m
|
|
14
|
+
lengZ = 10e-3 # m
|
|
15
|
+
|
|
16
|
+
# Mesh Properties
|
|
17
|
+
nElemX = 2
|
|
18
|
+
nElemY = 2
|
|
19
|
+
nElemZ = 2
|
|
20
|
+
eType = HEX27 # TET10, TET11, HEX20, HEX27
|
|
21
|
+
|
|
22
|
+
# Thermal BCs
|
|
23
|
+
coolantTemp=100.0 # degC
|
|
24
|
+
heatTransCoeff=125.0e3 # W.m^-2.K^-1
|
|
25
|
+
surfHeatFlux=4.67e6 # W.m^-2, taken from Adel's first paper
|
|
26
|
+
timeConst = 1 # s
|
|
27
|
+
|
|
28
|
+
# Mechanical Loads/BCs
|
|
29
|
+
topDispRate = ${fparse 1e-3 / endTime} # m/s
|
|
30
|
+
|
|
31
|
+
# Thermal Props:
|
|
32
|
+
Density = 8829.0 # kg.m^-3
|
|
33
|
+
ThermCond = 384.0 # W.m^-1.K^-1
|
|
34
|
+
SpecHeat = 406.0 # J.kg^-1.K^-1
|
|
35
|
+
|
|
36
|
+
# Material Properties:
|
|
37
|
+
EMod= 100e9 # Pa
|
|
38
|
+
PRatio = 0.33 # -
|
|
39
|
+
|
|
40
|
+
# Thermo-mechanical coupling
|
|
41
|
+
stressFreeTemp = 20 # degC
|
|
42
|
+
ThermExp = 17.8e-6 # 1/degC
|
|
43
|
+
|
|
44
|
+
#** MOOSEHERDER VARIABLES - END
|
|
45
|
+
#-------------------------------------------------------------------------
|
|
46
|
+
|
|
47
|
+
[GlobalParams]
|
|
48
|
+
displacements = 'disp_x disp_y disp_z'
|
|
49
|
+
[]
|
|
50
|
+
|
|
51
|
+
[Mesh]
|
|
52
|
+
[generated]
|
|
53
|
+
type = GeneratedMeshGenerator
|
|
54
|
+
dim = 3
|
|
55
|
+
nx = ${nElemX}
|
|
56
|
+
ny = ${nElemY}
|
|
57
|
+
nz = ${nElemZ}
|
|
58
|
+
xmax = ${lengX}
|
|
59
|
+
ymax = ${lengY}
|
|
60
|
+
zmax = ${lengZ}
|
|
61
|
+
elem_type = ${eType}
|
|
62
|
+
[]
|
|
63
|
+
[]
|
|
64
|
+
|
|
65
|
+
[Variables]
|
|
66
|
+
[temperature]
|
|
67
|
+
family = LAGRANGE
|
|
68
|
+
order = SECOND
|
|
69
|
+
initial_condition = ${coolantTemp}
|
|
70
|
+
[]
|
|
71
|
+
[]
|
|
72
|
+
|
|
73
|
+
[Kernels]
|
|
74
|
+
[heat_conduction]
|
|
75
|
+
type = HeatConduction
|
|
76
|
+
variable = temperature
|
|
77
|
+
[]
|
|
78
|
+
[time_derivative]
|
|
79
|
+
type = HeatConductionTimeDerivative
|
|
80
|
+
variable = temperature
|
|
81
|
+
[]
|
|
82
|
+
[]
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
[Physics/SolidMechanics/QuasiStatic]
|
|
86
|
+
[all]
|
|
87
|
+
strain = SMALL
|
|
88
|
+
incremental = true
|
|
89
|
+
add_variables = true
|
|
90
|
+
material_output_family = MONOMIAL # MONOMIAL, LAGRANGE
|
|
91
|
+
material_output_order = FIRST # CONSTANT, FIRST, SECOND,
|
|
92
|
+
generate_output = 'strain_xx strain_yy strain_zz strain_xy strain_yz strain_xz'
|
|
93
|
+
[]
|
|
94
|
+
[]
|
|
95
|
+
|
|
96
|
+
[BCs]
|
|
97
|
+
[heat_flux_in]
|
|
98
|
+
type = FunctionNeumannBC
|
|
99
|
+
variable = temperature
|
|
100
|
+
boundary = 'top'
|
|
101
|
+
function = '${fparse surfHeatFlux}*(1-exp(-(1/${timeConst})*t))'
|
|
102
|
+
[]
|
|
103
|
+
[heat_flux_out]
|
|
104
|
+
type = ConvectiveHeatFluxBC
|
|
105
|
+
variable = temperature
|
|
106
|
+
boundary = 'bottom'
|
|
107
|
+
T_infinity = ${coolantTemp}
|
|
108
|
+
heat_transfer_coefficient = ${heatTransCoeff}
|
|
109
|
+
[]
|
|
110
|
+
|
|
111
|
+
[bottom_x]
|
|
112
|
+
type = DirichletBC
|
|
113
|
+
variable = disp_x
|
|
114
|
+
boundary = 'bottom'
|
|
115
|
+
value = 0.0
|
|
116
|
+
[]
|
|
117
|
+
[bottom_y]
|
|
118
|
+
type = DirichletBC
|
|
119
|
+
variable = disp_y
|
|
120
|
+
boundary = 'bottom'
|
|
121
|
+
value = 0.0
|
|
122
|
+
[]
|
|
123
|
+
[bottom_z]
|
|
124
|
+
type = DirichletBC
|
|
125
|
+
variable = disp_z
|
|
126
|
+
boundary = 'bottom'
|
|
127
|
+
value = 0.0
|
|
128
|
+
[]
|
|
129
|
+
[top_x]
|
|
130
|
+
type = DirichletBC
|
|
131
|
+
variable = disp_x
|
|
132
|
+
boundary = 'top'
|
|
133
|
+
value = 0.0
|
|
134
|
+
[]
|
|
135
|
+
[top_y]
|
|
136
|
+
type = FunctionDirichletBC
|
|
137
|
+
variable = disp_y
|
|
138
|
+
boundary = 'top'
|
|
139
|
+
function = '${topDispRate}*t'
|
|
140
|
+
[]
|
|
141
|
+
[top_z]
|
|
142
|
+
type = DirichletBC
|
|
143
|
+
variable = disp_z
|
|
144
|
+
boundary = 'top'
|
|
145
|
+
value = 0.0
|
|
146
|
+
[]
|
|
147
|
+
[]
|
|
148
|
+
|
|
149
|
+
[Materials]
|
|
150
|
+
[mat_thermal]
|
|
151
|
+
type = HeatConductionMaterial
|
|
152
|
+
thermal_conductivity = ${ThermCond}
|
|
153
|
+
specific_heat = ${SpecHeat}
|
|
154
|
+
[]
|
|
155
|
+
[mat_density]
|
|
156
|
+
type = GenericConstantMaterial
|
|
157
|
+
prop_names = 'density'
|
|
158
|
+
prop_values = ${Density}
|
|
159
|
+
[]
|
|
160
|
+
[mat_expansion]
|
|
161
|
+
type = ComputeThermalExpansionEigenstrain
|
|
162
|
+
temperature = temperature
|
|
163
|
+
stress_free_temperature = ${stressFreeTemp}
|
|
164
|
+
thermal_expansion_coeff = ${ThermExp}
|
|
165
|
+
eigenstrain_name = thermal_expansion_eigenstrain
|
|
166
|
+
[]
|
|
167
|
+
|
|
168
|
+
[mat_elasticity]
|
|
169
|
+
type = ComputeIsotropicElasticityTensor
|
|
170
|
+
youngs_modulus = ${EMod}
|
|
171
|
+
poissons_ratio = ${PRatio}
|
|
172
|
+
[]
|
|
173
|
+
[stress]
|
|
174
|
+
type = ComputeFiniteStrainElasticStress
|
|
175
|
+
[]
|
|
176
|
+
[]
|
|
177
|
+
|
|
178
|
+
[Preconditioning]
|
|
179
|
+
[SMP]
|
|
180
|
+
type = SMP
|
|
181
|
+
full = true
|
|
182
|
+
[]
|
|
183
|
+
[]
|
|
184
|
+
|
|
185
|
+
[Executioner]
|
|
186
|
+
type = Transient
|
|
187
|
+
|
|
188
|
+
solve_type = 'NEWTON'
|
|
189
|
+
petsc_options = '-snes_converged_reason'
|
|
190
|
+
petsc_options_iname = '-pc_type -pc_hypre_type'
|
|
191
|
+
petsc_options_value = 'hypre boomeramg'
|
|
192
|
+
|
|
193
|
+
l_max_its = 1000
|
|
194
|
+
l_tol = 1e-6
|
|
195
|
+
|
|
196
|
+
nl_max_its = 50
|
|
197
|
+
nl_rel_tol = 1e-6
|
|
198
|
+
nl_abs_tol = 1e-6
|
|
199
|
+
|
|
200
|
+
start_time=0.0
|
|
201
|
+
end_time = ${endTime}
|
|
202
|
+
dt = ${timeStep}
|
|
203
|
+
|
|
204
|
+
[Predictor]
|
|
205
|
+
type = SimplePredictor
|
|
206
|
+
scale = 1
|
|
207
|
+
[]
|
|
208
|
+
[]
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
[Postprocessors]
|
|
212
|
+
[react_y_bot]
|
|
213
|
+
type = SidesetReaction
|
|
214
|
+
direction = '0 1 0'
|
|
215
|
+
stress_tensor = stress
|
|
216
|
+
boundary = 'bottom'
|
|
217
|
+
[]
|
|
218
|
+
[react_y_top]
|
|
219
|
+
type = SidesetReaction
|
|
220
|
+
direction = '0 1 0'
|
|
221
|
+
stress_tensor = stress
|
|
222
|
+
boundary = 'top'
|
|
223
|
+
[]
|
|
224
|
+
|
|
225
|
+
[disp_y_max]
|
|
226
|
+
type = NodalExtremeValue
|
|
227
|
+
variable = disp_y
|
|
228
|
+
[]
|
|
229
|
+
[disp_x_max]
|
|
230
|
+
type = NodalExtremeValue
|
|
231
|
+
variable = disp_x
|
|
232
|
+
[]
|
|
233
|
+
[disp_z_max]
|
|
234
|
+
type = NodalExtremeValue
|
|
235
|
+
variable = disp_z
|
|
236
|
+
[]
|
|
237
|
+
|
|
238
|
+
[]
|
|
239
|
+
|
|
240
|
+
[Outputs]
|
|
241
|
+
exodus = true
|
|
242
|
+
[]
|