Version 6 (modified by 11 years ago) ( diff ) | ,
---|
Initialization
To test the operator splitting, I initialized the grid with the same conditions as the Jeans test I did with astrobear (see that wiki page under the self-gravity section of my user page). Namely, I computed the Jeans length (in cm) for a gas of density rho = 3.34d-21 g/cc, temperature T = 100 K, and gamma = 1.0001. I then seeded the grid (that was 50x Jeans length long) with the prescribed density, velocity, and pressure perturbations as derived before. The density form was straightforward,
where rscale = rho_0, and k is the wavenumber of the Jeans mode.
The background pressure (P0) and pressure perturbation (P1) was given by the ideal gas law,
The velocity formula was a little more involved, looking like
where the growthrate is given by,
In order to keep the velocity perturbation dimensionless, the factor out in front of the Sin(kx) needed to be scaled to computational units. This involved a factor of lscale for k, rhoscale for rho_0 in the growthrate, and a term for scaled gravity in the growthrate.
Scaling gravitational constant
To get a form for 'scalegrav', I noted I needed a scale factor for time, given the units of G are
To derive a scale for time, I needed to use the 3 scales I had already defined: lscale, rhoscale, pscale. I did this with the following equations,
which gives an expression for the relationship between the scales. Rearranging and solving for timescale, we have
Thus, the scaled version of the gravitational constant is given by,
With all quantities properly scaled, the initial condition (in computational units) looks like,
density:
velocity:
and pressure:
With these initial conditions for the primitive variables of the hydro solver, I then began time-stepping through the solution, using periodic boundaries on both my box and poisson solver (see).
Results
To get the final time (in computational units), I had the code print out tfinal=5/growthrate, and used this in my problem.data for the simulation time. I then compared this output to that astrobear gave me.
Attachments (3)
- rhohydroinit.png (35.1 KB ) - added by 11 years ago.
- phydroinit.png (9.2 KB ) - added by 11 years ago.
- uhydroinit.png (66.6 KB ) - added by 11 years ago.
Download all attachments as: .zip