Skip to content

Esther Hydrocode Tutorial

Richard Briggs edited this page Dec 8, 2017 · 37 revisions

Esther Hydrocode Tutorial

Overview

User tutorial / information for the hydrocode simulations package of Simex, currently utilising the Esther 1-D hydrocode program (that can be obtained upon request).

Input data and output data can be found at https://doi.org/10.5281/zenodo.883106

Tutorial assumes the use of an interactive iPython notebook, though writing a simple python script to call each module would also work.

Table of contents

  1. Introduction
  2. Parameters
  3. How to create a new experiment
  4. Example - Plastic ablator with Fe foil
  5. Run Esther
  6. Utilities

Introduction

The Esther hydrocode SIMEX package consists of the following python scripts:

  • PhotonExperimentSimulation/EstherExperiment.py
  • Calculators/EstherPhotonMatterInteractor.py
  • Parameters/EstherPhotonMatterInteractorParameters.py
  • Utilities/RadHydroAnalysis.py
  • Utilities/hydro_txt_to_opmd.py

1st, import modules relevant for creating parameters

In[1]: import SimEx

In[2]: from SimEx.Parameters.EstherPhotonMatterInteractorParameters import EstherPhotonMatterInteractorParameters

Parameters

The current version allows the creation of a complex target configuration with up to 5 layers. The materials currently available are listed below with their long name; the long name must be used when setting the material choice (e.g. sample="Iron"). Material names are currently case sensitive

  • Aluminium
  • Berylium
  • CH
  • Chromium
  • Cobalt
  • Copper
  • Diamond
  • Gold
  • Iron
  • Iron2*
  • Kapton
  • Lead
  • LiF
  • Magnesium
  • Molybdenum
  • Mylar
  • Nickel
  • Quartz
  • Silicon
  • SiliconOxide
  • Silver
  • Tantalum
  • Tin
  • Titanium
  • Tungsten
  • Vanadium
  • Water

*2 sesame EOS tables exist for iron.

Laser pulse options are:

  • "flat"
  • "quasiflat"
  • "ramp"

Set parameters:

In[3]: esther_parameters = EstherPhotonMatterInteractorParameters(
                                     number_of_layers=4,
                                     ablator="Kapton",
                                     ablator_thickness=50.0,
                                     sample="Iron",
                                     sample_thickness=5.0,
                                     window="LiF",
                                     window_thickness=50.0,
                                     layer1="Copper",
                                     layer1_thickness=1.0,
                                     layer2="Copper",
                                     layer2_thickness=1.0,
                                     laser_wavelength=1064.0,
                                     laser_pulse='quasiflat',
                                     laser_pulse_duration=6.0,
                                     laser_intensity=0.1,
                                     run_time=10.0,
                                     delta_time=0.05,
                                     sample_eos_type="sesame"
                                                     )

In this example, we utilize all of the 'expert' features of the parameters for illustration. To simplify to a 2 layer target (ablator + sample), set layer1, layer2 and Window parameters to None. Make sure to change number_of_layers to 2 (ValueError alerts will be raised if you trying using incorrect combination of layers).

How to create a new experiment

An experiment constructor class EstherExperiment.py exists to store parameters for reuse in iterations of code. This allows quick changes to certain parameters and each input file is saved to user folder.

In[4]: from SimEx.PhotonExperimentSimulation.EstherExperiment import EstherExperiment

In[5]: simName = "Fe-example"

In[6]: experiment = EstherExperimentConstruction(parameters=parameters,
    esther_sims_path=self._simdir,sim_name=simName)

The self._simdir must be set at the start and should contain the root folder for simulation storage.

The EstherExperiment.py then calls the EstherPhotonMatterInteractor.py class, which serializes and saves all the relevant input files.

Example for Python module

    # Create parameters.
    parameters = EstherPhotonMatterInteractorParameters(
                                    number_of_layers=2,
                                     ablator="CH",
                                     ablator_thickness=50.0,
                                     sample="Iron",
                                     sample_thickness=5.0,
                                     window=None,
                                     window_thickness=0.0,
                                     laser_wavelength=1064.0,
                                     laser_pulse='flat',
                                     laser_pulse_duration=6.0,
                                     laser_intensity=0.33,
                                     run_time=12.0,
                                     delta_time=0.05
                                     )

    # Create experiment.
    simName = "Fe-example"
    experiment = EstherExperiment(parameters=parameters,
                                              esther_sims_path=self._simdir,
                                              sim_name=simName)

This creates a folder /Fe-Example/ in the root directory that user selected to store input files. The input files are saved in /Fe-Example/1/.

New iteration with same parameters

    experiment = EstherExperimentConstruction(parameters=parameters,
                                              esther_sims_path=self._simdir,
                                              sim_name=simName)

With the folder /Fe-Example/ already existing in the root directory, the new input files are saved in /Fe-Example/2/.

New iteration with a parameter change

    # Change the sample thickness to 4.0
    new_parameters = EstherPhotonMatterInteractorParameters(sample_thickness=4.0,
            read_from_file="/Users/richardbriggs/OneDrive/Data/Hydrocode/tmp/HPLF-Fe/2/")
    
    experiment = EstherExperimentConstruction(parameters=new_parameters,
                                              esther_sims_path=self._simdir,
                                              sim_name=simName)

With the folder /Fe-Example/3/ will contain the input files with the sample thickness now adjusted to 4.0 microns.

Run Esther

From the Esther GUI, the input file can be loaded and the simulation launched. The input files must be stored in Esther's local storage folder /ESTHER/ESTHER_entrees/

Output files will be saved to /ESTHER/ESTHER_sorties/

Convert output txt files to opmd.h5 format

The hydro_txt_to_opmd.py function converts the following .txt files, that are saved in /ESTHER/ESTHER_sorties/SimName/stock_t_m/ folder, to a single h5 format file.

  • densite_massique.txt
  • position_externe_relative.txt
  • pression_hydrostatique.txt
  • temperature_du_milieu.txt
  • vitesse_moyenne.txt

The function simply takes the directory where the 5 files are stored.

convertTxtToOPMD(esther_dirname="/root/to/ESTHER_sorties/SimName/stock_t_m/")

Data visualization

Achieved with the RadHydroAnalysis.py script radHydroAnalysis(filename) where filename is the output.opmd.h5 filename in the simulation directory.

Utilities

How to calculate the laser intensity for any laser energy and focal spot size.

import SimEx    
from SimEx.Utilities.IntensityCalc import calculateLaserIntensity
calculateLaserIntensity()

Creates dialogues for entering the Energy, laser spot diameter, and laser pulse length to obtain the laser intensity in TW/cm^2

Energy (J) : 15
Spot size (diameter in um) : 300
Pulse length (ns) : 6
Intensity =  3.53677651315 TW/cm^2

Translations of frequently encountered French messages in the Esther GUI

Edition du cas

Affichage fichier log - Display log file - Recommended that this box should remained checked


Fichiers Associes


Fichier Log

Mise a jour du fichier log en cours de calcul - Update the log file during calculation.