Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
cdfa6c5
fix: update skfem version spec to avoid issue with default mutable da…
brycepm2 Apr 16, 2025
e6ad154
feat: Added initial guess to flowpath solver
brycepm2 Apr 16, 2025
faa7d7a
fix: updated deprecated np.trapz to np.trapezoid
brycepm2 Apr 16, 2025
de1e2e6
feat: Added script interface to srlife to allow full analysis
brycepm2 Apr 16, 2025
5437378
fix: small fixes and updates to interface.py
brycepm2 Jul 10, 2025
001f743
fix: error in SiC.xml data
brycepm2 Jul 10, 2025
087bcba
fix: formatting fixes to test file
brycepm2 Jul 10, 2025
53a7cfa
feat: added interface to moose for THM solver
brycepm2 Jun 10, 2025
53e56c5
Updates for srlife-MOOSE interface
brycepm2 Jul 10, 2025
9a49fff
fix: formatiing for receiver.py
brycepm2 Jul 10, 2025
2921090
fix: Cleaning up srlife-moose code
brycepm2 Jul 11, 2025
c86eb99
added moose as a submodule
sagarbhatt0904 Oct 2, 2025
01712a9
added installation script to build srlife with and without moose
sagarbhatt0904 Oct 2, 2025
8aaa226
sic data file with 2p and 3p model parameters
sagarbhatt0904 Oct 2, 2025
fb5c037
fixed large variable name issue
sagarbhatt0904 Oct 2, 2025
783b6e5
using env variables for moose executable
sagarbhatt0904 Oct 2, 2025
06bac6b
some inconcistencies in moose i/p.
sagarbhatt0904 Oct 2, 2025
f6b3756
included solid Mech module build and ensuring conda shell fucntions …
sagarbhatt0904 Nov 11, 2025
a762b52
renamed boundary names
sagarbhatt0904 Nov 11, 2025
11df306
automatic look up moose paths in the submodule
sagarbhatt0904 Nov 11, 2025
f425c8c
made conda env auto detectable, no need to change seacas path
sagarbhatt0904 Apr 30, 2026
e36cf79
The previous implementation added a space at the end which broke moos…
sagarbhatt0904 Apr 30, 2026
a215e50
added moose solid mechanics interface which reads THM o/p and builds …
sagarbhatt0904 Apr 30, 2026
15605f3
added a small nemlm app for structural solve with moose
sagarbhatt0904 Apr 30, 2026
5a4a343
modified install script to build nemlapp
sagarbhatt0904 Apr 30, 2026
c7cdf20
modified run_moose_sm_model to use nemlapp instead of deer
sagarbhatt0904 Apr 30, 2026
84bede9
changes so the funciton returns moose input files and filenames for o…
sagarbhatt0904 Apr 30, 2026
8de0c0c
added functions to compute reliability from moose solution files
sagarbhatt0904 Apr 30, 2026
3f6af6e
added a function to extract pressures from THM outputs
sagarbhatt0904 Apr 30, 2026
0edcd84
moose submodule update
sagarbhatt0904 Apr 30, 2026
9849ae8
added missing environment variables to install script
sagarbhatt0904 Apr 30, 2026
6fbe749
redid the indentation
sagarbhatt0904 May 1, 2026
8cadd87
removed nemlapp code. Replacing it with nemlapp submodule
sagarbhatt0904 May 1, 2026
81dba34
added nemlapp as a submodule
sagarbhatt0904 May 1, 2026
d320fab
added function docstrings
sagarbhatt0904 May 4, 2026
009f3cb
rearranged module order and disabled import error for pyhit and exodus
sagarbhatt0904 May 4, 2026
f7ce4bd
rearranged module order and disabled import error for pyhit and exodus
sagarbhatt0904 May 4, 2026
f0ceee2
suppressed some linting errors for pyhit, removed unused variable, st…
sagarbhatt0904 May 5, 2026
a384638
fixed some variable name conflicts
sagarbhatt0904 May 5, 2026
93b5759
removed netcdf dependency. Replaced with exodus operations, since its…
sagarbhatt0904 May 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/formatting.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Check code formatting
on: [push, pull_request]
on: [push, pull_request, workflow_dispatch]
jobs:
check-formatting:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: tests
on: [push, pull_request]
on: [push, pull_request, workflow_dispatch]
jobs:
test-linux:
runs-on: ubuntu-latest
Expand Down
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "moose"]
path = moose
url = https://github.com/idaholab/moose.git
[submodule "nemlapp"]
path = nemlapp
url = https://github.com/sagarbhatt0904/nemlapp.git
81 changes: 81 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
#!/bin/bash
set -e

# Parse arguments
BUILD_MOOSE=false
if [[ "$1" == "--with-moose" ]]; then
BUILD_MOOSE=true
echo "Installing srlife with MOOSE..."
# Initialize MOOSE submodule
git submodule update --init moose
cd moose
git checkout master
cd ../
else
echo "Installing srlife only..."
fi

# Get repo root
SRLIFE_DIR="$(pwd)"
ENV_NAME="srlifeMoose"
MOOSE_JOBS=32

# Create conda environment
echo "Creating conda environment..."
# ensure conda shell functions are available in this script
eval "$(conda shell.bash hook)"

# Create the environment only if it doesn't already exist
if conda env list | awk '!/^#/ && NF>0 {print $1}' | grep -Fxq "$ENV_NAME"; then
echo "Conda environment '$ENV_NAME' already exists; skipping creation."
else
conda create -n "$ENV_NAME" moose-dev=2025.09.18=mpich
#TODO:install seacas --- maybe add this to requirements.txt later
conda install moose-seacas
fi


# Activate environment
conda activate $ENV_NAME

# Install Python dependencies
echo "Installing Python dependencies..."
pip3 install --user wheel
pip3 install -r requirements.txt




# Build MOOSE (if specified)
if [[ "$BUILD_MOOSE" == "true" ]]; then
echo "Building MOOSE..."
cd $SRLIFE_DIR/moose/test
make -j$MOOSE_JOBS

# Set environment variables
echo "Installing Thermohydraylics module..."
cd $SRLIFE_DIR/moose/modules/thermal_hydraulics/
make -j$MOOSE_JOBS

echo "Installing nemlapp for solid mechanics..."
cd $SRLIFE_DIR/nemlapp
make -j$MOOSE_JOBS
fi

echo "Installation complete!"
echo ""
if [[ "$BUILD_MOOSE" == "true" ]]; then
echo "To use add the following to your rc file:"
echo " conda activate $ENV_NAME"
echo " export PYTHONPATH=$SRLIFE_DIR/"
echo " export NEML_DIR=<PATH_TO_NEML>/neml"
echo " export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:<PATH_TO_NEML>/neml/lib"
echo " export MOOSE_DIR=$SRLIFE_DIR/moose/"
echo " export MOOSE_THM=$SRLIFE_DIR/moose/modules/thermal_hydraulics/thermal_hydraulics-opt"
echo " export NEMLAPP=$SRLIFE_DIR/nemlapp/nemlapp-opt"
echo " export MOOSE_MPI=$(which mpirun)"
echo " export MOOSE_NPROCS=<SET NUM OF MOOSE JOBS>"
else
echo "To use:"
echo " conda activate $ENV_NAME"
fi
1 change: 1 addition & 0 deletions moose
Submodule moose added at 296c9e
1 change: 1 addition & 0 deletions nemlapp
Submodule nemlapp added at edcf5c
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
numpy
scipy==1.9.2
scipy>=1.9.2
h5py
vtk
pytest
Expand Down
12 changes: 6 additions & 6 deletions srlife/damage.py
Original file line number Diff line number Diff line change
Expand Up @@ -1033,7 +1033,7 @@ def calculate_volume_flaw_flattened_eq_stress(
else:
sigma_e[sigma_e < 0] = 0
g = (
np.trapz(
np.trapezoid(
(sigma_e / (sigma_e_max + self.tolerance)) ** Navg[..., None, None],
time,
axis=0,
Expand Down Expand Up @@ -1196,7 +1196,7 @@ def calculate_surface_flaw_flattened_eq_stress(
else:
sigma_e[sigma_e < 0] = 0
g = (
np.trapz(
np.trapezoid(
(sigma_e / (sigma_e_max + self.tolerance))
** Navg[..., None, None, None],
time,
Expand Down Expand Up @@ -1474,7 +1474,7 @@ def calculate_volume_flaw_element_log_reliability(
# Calculating ratio of cyclic stress to max cyclic stress (in one cycle)
# for time-independent and time-dependent cases
g = (
np.trapz(
np.trapezoid(
(pstress / (pstress_max + 1.0e-14)) ** Navg[..., None],
time,
axis=0,
Expand Down Expand Up @@ -1556,7 +1556,7 @@ def calculate_surface_time_dep_pstress(
# Calculating ratio of cyclic stress to max cyclic stress (in one cycle)
# for time-independent and time-dependent cases
g = (
np.trapz(
np.trapezoid(
(surf_pstress / (surf_pstress_max + 1.0e-14)) ** Navg[..., None, None],
time,
axis=0,
Expand Down Expand Up @@ -1743,7 +1743,7 @@ def calculate_volume_flaw_avg_normal_stress(
sigma_n_0 = sigma_n
else:
g = (
np.trapz(
np.trapezoid(
(sigma_n / (sigma_n_max + self.tolerance)) ** Navg[..., None, None],
time,
axis=0,
Expand Down Expand Up @@ -1890,7 +1890,7 @@ def calculate_surface_flaw_time_dep_normal_stress(
sigma_n_0 = sigma_n
else:
g = (
np.trapz(
np.trapezoid(
(sigma_n / (sigma_n_max + self.tolerance))
** Navg[..., None, None, None],
time,
Expand Down
104 changes: 100 additions & 4 deletions srlife/data/damage/SiC.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@
</base>
<cares type="StandardModel">
<threshold_vol>
<temperatures>298.15 1073.15 1273.15 1473.15 1673.15 1773.15</temperatures>
<values>0.0 0.0 0.0 0.0 0.0 0.0</values>
<temperatures>298.15 811.15 1089.15 1366.15 1566.15</temperatures>
<values>0.0 0.0 0.0 0.0 0.0</values>
</threshold_vol>
<threshold_surf>
<temperatures>298.15 1073.15 1273.15 1473.15 1673.15 1773.15</temperatures>
<values>0.0 0.0 0.0 0.0 0.0 0.0</values>
<temperatures>298.15 811.15 1089.15 1366.15 1566.15</temperatures>
<values>0.0 0.0 0.0 0.0 0.0</values>
</threshold_surf>
<strength_vol>
<temperatures>298.15 811.15 1089.15 1366.15 1566.15</temperatures>
Expand Down Expand Up @@ -88,4 +88,100 @@
<values>520 520 750 210 210</values>
</fatigue_Bs>
</cares>
<tested_2P type="StandardModel">
<threshold_vol>
<temperatures>298.15 873.15 1073.15 1273.15</temperatures>
<values>0.0 0.0 0.0 0.0</values>
</threshold_vol>
<threshold_surf>
<temperatures>298.15 873.15 1073.15 1273.15</temperatures>
<values>0.0 0.0 0.0 0.0</values>
</threshold_surf>
<strength_vol>
<temperatures>298.15 873.15 1073.15 1273.15</temperatures>
<values>515.3 515.3 515.3 515.3</values>
</strength_vol>
<strength_surf>
<temperatures>298.15 873.15 1073.15 1273.15</temperatures>
<values>711.8 711.8 711.8 711.8</values>
</strength_surf>
<modulus_vol>
<temperatures>298.15 873.15 1073.15 1273.15</temperatures>
<values>8.29 8.29 8.29 8.29</values>
</modulus_vol>
<modulus_surf>
<temperatures>298.15 873.15 1073.15 1273.15</temperatures>
<values>6.75 6.75 6.75 6.75</values>
</modulus_surf>
<c_bar>0.82</c_bar>
<nu>0.16</nu>
<fatigue_Nv>
<temperatures>298.15 873.15 1073.15 1273.15</temperatures>
<values>63.65 63.65 63.65 63.65</values>
<!--values>60.93 60.93 60.93 60.93</values-->
</fatigue_Nv>
<fatigue_Ns>
<temperatures>298.15 873.15 1073.15 1273.15</temperatures>
<values>63.65 63.65 63.65 63.65</values>
<!--values>60.93 60.93 60.93 60.93</values-->
</fatigue_Ns>
<fatigue_Bv>
<temperatures>298.15 873.15 1073.15 1273.15</temperatures>
<values>14.29 2.84 2.84 2.84</values>
<!--values>11.38 1.21 8.93 8.93</values-->
</fatigue_Bv>
<fatigue_Bs>
<temperatures>298.15 873.15 1073.15 1273.15</temperatures>
<values>14.29 2.84 2.84 2.84</values>
<!--values>11.38 1.21 8.93 8.93</values-->
</fatigue_Bs>
</tested_2P>
<tested_3P type="StandardModel">
<threshold_vol>
<temperatures>298.15 873.15 1073.15 1273.15</temperatures>
<values>252.2 252.2 252.2 252.2</values>
</threshold_vol>
<threshold_surf>
<temperatures>298.15 873.15 1073.15 1273.15</temperatures>
<values>191.9 191.9 191.9 191.9</values>
</threshold_surf>
<strength_vol>
<temperatures>298.15 873.15 1073.15 1273.15</temperatures>
<values>1690.2 1690.2 1690.2 1690.2</values>
</strength_vol>
<strength_surf>
<temperatures>298.15 873.15 1073.15 1273.15</temperatures>
<values>1291.6 1291.6 1291.6 1291.6</values>
</strength_surf>
<modulus_vol>
<temperatures>298.15 873.15 1073.15 1273.15</temperatures>
<values>1.11 1.11 1.11 1.11</values>
</modulus_vol>
<modulus_surf>
<temperatures>298.15 873.15 1073.15 1273.15</temperatures>
<values>2.02 2.02 2.02 2.02</values>
</modulus_surf>
<c_bar>0.82</c_bar>
<nu>0.16</nu>
<fatigue_Nv>
<temperatures>298.15 873.15 1073.15 1273.15</temperatures>
<values>63.65 63.65 63.65 63.65</values>
<!--values>60.93 60.93 60.93 60.93</values-->
</fatigue_Nv>
<fatigue_Ns>
<temperatures>298.15 873.15 1073.15 1273.15</temperatures>
<values>63.65 63.65 63.65 63.65</values>
<!--values>60.93 60.93 60.93 60.93</values-->
</fatigue_Ns>
<fatigue_Bv>
<temperatures>298.15 873.15 1073.15 1273.15</temperatures>
<values>14.29 2.84 2.84 2.84</values>
<!--values>11.38 1.21 8.93 8.93</values-->
</fatigue_Bv>
<fatigue_Bs>
<temperatures>298.15 873.15 1073.15 1273.15</temperatures>
<values>14.29 2.84 2.84 2.84</values>
<!--values>11.38 1.21 8.93 8.93</values-->
</fatigue_Bs>
</tested_3P>
</models>
Loading
Loading