Skip to content

Modifying the initial conditions

Exoclimes Simulation Platform edited this page Mar 15, 2019 · 4 revisions

Initial conditions can be set in config file, however, there are some limitations to the properties that can be set here. Namely,

  • the initial temperature/pressure/density structure is isothermal and the same at every horizontal location on the grid
  • the initial wind speed is zero everywhere (a state of rest)

The initial isothermal profile is chosen for ease of modelling: the atmosphere must be at or near hydrostatic equilibrium and for an isothermal atmosphere the structure can be determined analytically from a few specified parameters (temperature, reference pressure, and the vertical grid). Note that even though THOR is a "Non-hydrostatic" model, significant departures from hydrostatic equilibrium are not handled well numerically, thus the constraint on the initial conditions.

However, THOR does have the capability to read in the atmospheric state from an h5 file (this is how simulations are restarted, in fact), which overrides many of the initial conditions set in the config file. We can also use this the implement an arbitrary set of initial conditions.

A rudimentary engine for constructing initial conditions has been included in v2.1 (tools/thor_ic_gen.py). As of v2.1, this only edits the vertical profiles, i.e., every grid location begins with identical conditions, though the thermal properties can take any functional form in the vertical direction.

Along with thor_ic_gen.py, there is also an example script, tools/gen_init_example.py that demonstrates how thor_ic_gen.py can be used. Here's the basic idea:

  • a python dictionary is created that contains information about the simulation and the desired initial conditions
  • this dictionary is passed to two functions gen_h5_files and edit_init_file, which are the primary functions of thor_ic_gen.py
  • gen_h5_files takes a specified config file ('base_ifile' in the dictionary), runs THOR on that file for a single iteration (with settings designated in 'override') to generate an h5 file with the appropriate grid and various other settings
  • edit_init_file takes the h5 file generated in the previous step and manually edits it. Again, currently this only edits the vertical profiles of the thermal variables (pressure and density). The desired properties are contained in a separate text file (specified as 'vertical_file' in the python dictionary). The code reads in this text file and interpolates the variables contained within onto the grid contained in the h5 files (generated in the previous step).
  • now, the user has an h5 containing the desired thermodynamic state that can be used by setting rest = false and initial = <name of the h5 file> in original config file

It is up to the user to calculate the desired thermodynamic initial state and output this as a text file (containing 'Height', 'Pressure', and 'Rho').

This relieves the constraint of having an isothermal initial state. The basic ideas here could certainly be extended to allow initial conditions with horizontal structure, including, for example, an initial wind profile. This is an item on this author's to do list, but in the meantime, feel free to try experimenting yourself... perhaps this author will get to it once he gets a paper or two submitted.