Example #1
0
  def test_load_materials(self):
    for alloy in alloys:
      thermal, deformation, damage = library.load_material(alloy, "base","base","base")
      deformation.get_neml_model()
      thermal, deformation, damage = library.load_material(alloy, "base","elastic_creep","base")
      deformation.get_neml_model()
      thermal, deformation, damage = library.load_material(alloy, "base","elastic_model","base")
      deformation.get_neml_model()

    def test_load_fluids(self):
      for fluid in fluids:
        library.load_fluid(fluid,"base")
Example #2
0
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
    params[
        'nthreads'] = 4  # Solve will run in multithreaded mode, set to number of available cores
    params['system'][
        'atol'] = 1.0e-4  # During the standby very little happens, lower the atol to accept this result
Example #3
0
  # 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)
  
  for pi, panel in model.panels.items():
    for ti, tube in panel.tubes.items():