# These are all optional, all the solvers have default values # for parameters not provided by the user params = sample_parameters() # Define the thermal solver to use in solving the heat transfer problem thermal_solver = thermal.FiniteDifferenceImplicitThermalSolver( params["thermal"]) # Define the structural solver to use in solving the individual tube problems 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 life damage_model = damage.TimeFractionInteractionDamage() # Load the materials fluid = library.load_fluid("salt", "base") thermal, deformation, damage = library.load_material("740H", "base", "elastic_model", "base") # The solution manager solver = managers.SolutionManager(model, thermal_solver, thermal, fluid, structural_solver, deformation, damage, system_solver, damage_model, pset = params) # Heuristics would go here # Report the best-estimate life of the receiver life = solver.solve_life() print("Best estimate life: %f daily cycles" % life)
#!/usr/bin/env python3 import numpy as np import sys sys.path.append('../..') from srlife import receiver, solverparams, library, thermal, structural, system, damage, managers if __name__ == "__main__": # Load the receiver we previously saved model = receiver.Receiver.load("model.hdf5") # Choose the material models fluid_mat = library.load_fluid("salt", "base") # Generic chloride salt model # Base 316H thermal and damage models, a simplified deformation model to # cut down on the run time of the 3D analysis thermal_mat, deformation_mat, damage_mat = library.load_material( "316H", "base", "base", "base") # Cut down on run time for now by making the tube analyses 1D # This is not recommended for actual design evaluation for panel in model.panels.values(): for tube in panel.tubes.values(): tube.make_1D(tube.h / 2, 0) # Setup some solver parameters params = solverparams.ParameterSet() params[ 'progress_bars'] = True # Print a progress bar to the screen as we solve
def test_load_fluids(self): for fluid in fluids: library.load_fluid(fluid, "base")