Skip to content

Commit

Permalink
updating files with .hdf changed to .hdf5
Browse files Browse the repository at this point in the history
  • Loading branch information
pschaugule committed Sep 22, 2023
1 parent beb88d0 commit a1e39ee
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 40 deletions.
8 changes: 4 additions & 4 deletions examples/ceramic-receiver/calculate_reliability.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ def sample_parameters():


if __name__ == "__main__":
# model = receiver.Receiver.load("SiC_1pt00mm_spath_Sresults.hdf")
model = receiver.Receiver.load("example-structural-thermal.hdf")
# model = receiver.Receiver.load("SiC_1pt00mm_spath_Sresults.hdf5")
model = receiver.Receiver.load("example-structural-thermal.hdf5")

# Load some customized solution parameters
# These are all optional, all the solvers have default values
Expand Down Expand Up @@ -118,8 +118,8 @@ def sample_parameters():

# Report the best-estimate life of the receiver
reliability = solver.calculate_reliability(time=100.0)
model.save("example_with_Rresults.hdf")
# model.save("SiC_1pt00mm_spath_Rresults.hdf")
model.save("example_with_Rresults.hdf5")
# model.save("SiC_1pt00mm_spath_Rresults.hdf5")

# for pi, panel in model.panels.items():
# for ti, tube in panel.tubes.items():
Expand Down
24 changes: 15 additions & 9 deletions examples/ceramic-receiver/run_example_variable_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ def sample_parameters():
inlet_temp = inlet_temp * np.ones_like(times)

model.add_flowpath(flowpath, times, mass_flow, inlet_temp)
model.save("example-with-flowpath-variable_flow.hdf")
model = receiver.Receiver.load("example-with-flowpath-variable_flow.hdf")
model.save("example-with-flowpath-variable_flow.hdf5")
model = receiver.Receiver.load("example-with-flowpath-variable_flow.hdf5")

# Load some customized solution parameters
# These are all optional, all the solvers have default values
Expand All @@ -98,7 +98,7 @@ def sample_parameters():
structural_solver = structural.PythonTubeSolver(params["structural"])
# Define the system solver to use in solving the coupled structural system
system_solver = system.SpringSystemSolver(params["system"])

# Damage model to use in calculating reliability
# damage_model = damage.TimeFractionInteractionDamage(params["damage"])
damage_model = damage.PIAModel(params["damage"])
Expand Down Expand Up @@ -132,17 +132,23 @@ def sample_parameters():

# Heuristics
solver.add_heuristic(managers.CycleResetHeuristic())
# solver.solve_heat_transfer()
# solver.solve_structural()
# model.save("example-structural-thermal.hdf5")

# Report tube reliability
reliability = solver.solve_reliability()
# reliability = solver.solve_reliability()
reliability_volume = solver.calculate_reliability_volume_flaw(time=100.0)
reliability_surface = solver.calculate_reliability_surface_flaw(time=100.0)
reliability_combined = solver.calculate_reliability_combined(time=100.0)

print("Individual tube reliabilities:")
print(reliability["tube_reliability"])
# print("Individual tube reliabilities:")
# print(reliability["tube_reliability"])

print("Overall structure reliability:")
print(reliability["overall_reliability"])
# print("Overall structure reliability:")
# print(reliability["overall_reliability"])

model.save("example-with-results-variable_flow.hdf")
model.save("example-with-results-variable_flow.hdf5")

for pi, panel in model.panels.items():
for ti, tube in panel.tubes.items():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

flow_type = sys.argv[1] #'constant' or 'variable'

results_fname = os.path.join("example-with-results-"+str(flow_type)+"_flow.hdf")
results_fname = os.path.join("example-with-results-"+str(flow_type)+"_flow.hdf5")
model = receiver.Receiver.load(results_fname)

for pi, panel in model.panels.items():
Expand Down
6 changes: 3 additions & 3 deletions examples/metallic-receiver/run_example_constant_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ def sample_parameters():
inlet_temp = inlet_temp * np.ones_like(times)

model.add_flowpath(flowpath, times, mass_flow, inlet_temp)
model.save("example-with-flowpath-constant_flow.hdf")
model = receiver.Receiver.load("example-with-flowpath-constant_flow.hdf")
model.save("example-with-flowpath-constant_flow.hdf5")
model = receiver.Receiver.load("example-with-flowpath-constant_flow.hdf5")

# Cut down on run time for now
# for panel in model.panels.values():
Expand Down Expand Up @@ -137,7 +137,7 @@ def sample_parameters():

print("Best estimate life: %f daily cycles" % life)

model.save("example-with-results-constant_flow.hdf")
model.save("example-with-results-constant_flow.hdf5")

for pi, panel in model.panels.items():
for ti, tube in panel.tubes.items():
Expand Down
6 changes: 3 additions & 3 deletions examples/metallic-receiver/run_example_variable_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ def sample_parameters():
inlet_temp = inlet_temp * np.ones_like(times)

model.add_flowpath(flowpath, times, mass_flow, inlet_temp)
model.save("example-with-flowpath-variable_flow.hdf")
model = receiver.Receiver.load("example-with-flowpath-variable_flow.hdf")
model.save("example-with-flowpath-variable_flow.hdf5")
model = receiver.Receiver.load("example-with-flowpath-variable_flow.hdf5")

# Load some customized solution parameters
# These are all optional, all the solvers have default values
Expand Down Expand Up @@ -135,7 +135,7 @@ def sample_parameters():

print("Best estimate life: %f daily cycles" % life)

model.save("example-with-results-variable_flow.hdf")
model.save("example-with-results-variable_flow.hdf5")

for pi, panel in model.panels.items():
for ti, tube in panel.tubes.items():
Expand Down
32 changes: 16 additions & 16 deletions srlife/data/damage/SiC.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,38 +38,38 @@
</base>
<cares type="StandardModel">
<strength_vol>
<temperatures>298.15 811.15 1089.15 1366.15</temperatures>
<values>552.94 552.94 552.94 552.94</values>
<temperatures>298.15 811.15 1089.15 1366.15 1566.15</temperatures>
<values>552.94 552.94 552.94 552.94 552.94</values>
</strength_vol>
<strength_surf>
<temperatures>298.15 811.15 1089.15 1366.15</temperatures>
<values>669.78 669.78 669.78 669.78</values>
<temperatures>298.15 811.15 1089.15 1366.15 1566.15</temperatures>
<values>669.78 669.78 669.78 669.78 669.78</values>
</strength_surf>
<modulus_vol>
<temperatures>298.15 811.15 1089.15 1366.15</temperatures>
<values>8.6 8.6 8.6 8.6</values>
<temperatures>298.15 811.15 1089.15 1366.15 1566.15</temperatures>
<values>8.6 8.6 8.6 8.6 8.6</values>
</modulus_vol>
<modulus_surf>
<temperatures>298.15 811.15 1089.15 1366.15</temperatures>
<values>8.6 8.6 8.6 8.6</values>
<temperatures>298.15 811.15 1089.15 1366.15 1566.15</temperatures>
<values>8.6 8.6 8.6 8.6 8.6</values>
</modulus_surf>
<c_bar>0.82</c_bar>
<nu>0.16</nu>
<fatigue_Nv>
<temperatures>298.15 811.15 1089.15 1366.15</temperatures>
<values>56 56 47 38</values>
<temperatures>298.15 811.15 1089.15 1366.15 1566.15</temperatures>
<values>56 56 47 38 38</values>
</fatigue_Nv>
<fatigue_Ns>
<temperatures>298.15 811.15 1089.15 1366.15</temperatures>
<values>56 56 47 38</values>
<temperatures>298.15 811.15 1089.15 1366.15 1566.15</temperatures>
<values>56 56 47 38 38</values>
</fatigue_Ns>
<fatigue_Bv>
<temperatures>298.15 811.15 1089.15 1366.15</temperatures>
<values>1275 1275 1850 520</values>
<temperatures>298.15 811.15 1089.15 1366.15 1566.15</temperatures>
<values>1275 1275 1850 520 520</values>
</fatigue_Bv>
<fatigue_Bs>
<temperatures>298.15 811.15 1089.15 1366.15</temperatures>
<values>520 520 750 210</values>
<temperatures>298.15 811.15 1089.15 1366.15 1566.15</temperatures>
<values>520 520 750 210 210</values>
</fatigue_Bs>
</cares>
</models>
8 changes: 4 additions & 4 deletions srlife/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def solve_reliability_combined(self, time):

return self.calculate_reliability_combined(time)

def calculate_reliability_volume(self, time):
def calculate_reliability_volume_flaw(self, time):
"""Calculate reliability from the results
Args:
Expand All @@ -199,15 +199,15 @@ def calculate_reliability_volume(self, time):
"""
if self.progress:
print("Calculating reliability (volume):")
return self.damage_model.determine_reliability_volume(
return self.damage_model.determine_reliability_volume_flaw(
self.receiver,
self.damage_material,
time,
nthreads=self.nthreads,
decorator=self.progress_decorator,
)

def calculate_reliability_surface(self, time):
def calculate_reliability_surface_flaw(self, time):
"""Calculate reliability from the results
Args:
Expand All @@ -218,7 +218,7 @@ def calculate_reliability_surface(self, time):
"""
if self.progress:
print("Calculating reliability (surface):")
return self.damage_model.determine_reliability_surface(
return self.damage_model.determine_reliability_surface_flaw(
self.receiver,
self.damage_material,
time,
Expand Down

0 comments on commit a1e39ee

Please sign in to comment.