Skip to content

Hands on example with domain walls

Eugene Lim edited this page Nov 17, 2021 · 2 revisions

This is a small tutorial to show how to change an already existing example. The prequisites for this are

  • You already compiled Chombo
  • Able to run and submit code on your computer/cluster
  • Know how to visualize data using visIT or other applications

In this example, we implement a topological domain wall on a Black Hole. This example is only here to show how to modify the code and should not be used as an example for any science since Hamiltonian constraints are not fulfilled. For reference, we implement domain walls as described in "Cosmic Strings and other topological defects." by Vilenkin and Shellard in equation (3.1.2) and (3.1.3). All needed equations can be found in this tutorial.

  • Clone a new GRChombo repository

    git clone https://github.com/GRChombo/GRChombo.git
    cd GRChombo/Examples/ScalarField
    git checkout b0606e8912e3b49e02962840e5c1c3ea50595735
    

NOTE: We use a specific version of the code, to make sure this tutorial is up-to date. However, it should also work with newer versions of the code (if it doesn't please let us know).

  • Open InitialScalarData.hpp with your favourite text editor and change line 47 :

    data_t phi = m_params.amplitude * (1.0 + 0.01 * rr2 * exp(-pow(rr / m_params.width, 2.0)));
    

    to the profile of a domain wall

    data_t x = coords.x;
    data_t lambda = 10000;
    data_t eta = 0.01;
    data_t phi = eta * tanh( pow(lambda/2.0, 0.5) * eta * x  );
    

    The first line gets the x - coordinate from the coordinate class, and the 2nd and 3rd lines define the parameters of the domain wall.

    NOTE: We write data_t instead of double since that allows us to speed our code up using vector registers.

  • For domain walls, we also have to change the potential of the scalar field, which can be found in the file Potential.hpp. Here we change line 33

    V_of_phi = 0.5 * pow(m_params.scalar_mass * vars.phi, 2.0);
    

    and line 37

    dVdphi = pow(m_params.scalar_mass, 2.0) * vars.phi;
    

    to reflect the new potential Mexican hat potential to :

    V_of_phi = lambda / 4.0 * pow((vars.phi * vars.phi - eta*eta) , 2 );
    dVdphi = lambda * vars.phi * (vars.phi * vars.phi - eta*eta);
    
  • We change some of the parameters in params.txt to be able to run in with few resources

    L_full = 32
    

    this reduces the physical size of the box

    max_level = 2
    

    which allows the code use at most two levels of refinement, which makes our code faster to evaluate

    hi_boundary = 0 0 0
    lo_boundary = 0 0 0
    

    we change the boundaries to be static, simplifying our problem

    stop_time = 20
    

    to make sure our simulation does only go on for a short amount of time

    kerr_spin = 0.7
    

    which increases the spin of the black hole, making the dynamics of the problem more visually interesting. Lastly, we add

    kerr_center = 16 16 16
    

    which sets the position (x y z) of the Black Hole. In this case, in the center of the grid. NOTE: We choose all of these parameters to make it feasible to run in a short time-frame. We recommend to play around and see the effect of different variables in the params.txt to see the effect on the simulation.

  • Run the code (best use interactive nodes or run it locally)

    mpirun -n <NUMBER OF MPI-TASKS> ./*.ex params.txt
    
  • We recommend to check out the outputs and compare with https://youtu.be/Uf4gyWxhzlU

Clone this wiki locally