Skip to content

Commit

Permalink
push test case
Browse files Browse the repository at this point in the history
  • Loading branch information
helenarichie committed Jan 4, 2024
1 parent ec7e7c3 commit 7f5dd01
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 16 deletions.
18 changes: 11 additions & 7 deletions builds/make.type.hydro
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,27 @@ DFLAGS += -DPPMC
DFLAGS += -DHLLC

# Integrator
DFLAGS += -DSIMPLE
#DFLAGS += -DVL
# DFLAGS += -DSIMPLE
DFLAGS += -DVL

# Apply a density and temperature floor
DFLAGS += -DDENSITY_FLOOR
DFLAGS += -DTEMPERATURE_FLOOR
# DFLAGS += -DDENSITY_FLOOR
# DFLAGS += -DTEMPERATURE_FLOOR

# Solve the Gas Internal Energy usisng a Dual Energy Formalism
#DFLAGS += -DDE
# DFLAGS += -DDE

# Apply cooling on the GPU from precomputed tables
#DFLAGS += -DCOOLING_GPU
# DFLAGS += -DCOOLING_GPU

# Measure the Timing of the different stages
#DFLAGS += -DCPU_TIME
# DFLAGS += -DCPU_TIME

# Select output format
# Can also add -DSLICES and -DPROJECTIONS
OUTPUT ?= -DOUTPUT -DHDF5
DFLAGS += -DSLICES
DFLAGS += -DPROJECTION
DFLAGS += $(OUTPUT)

DFLAGS += -DOUTPUT_ALWAYS
41 changes: 41 additions & 0 deletions cloud-wind.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
################################################
# Parameters required for all problems
################################################
# number of grid cells in the x dimension
nx=256
# number of grid cells in the y dimension
ny=128
# number of grid cells in the z dimension
nz=128
# x direction lower domain boundary
xmin=0.0
# x direction domain length
xlen=3.2
# y direction lower domain boundary
ymin=0.0
# y direction domain length
ylen=1.6
# z direction lower domain boundary
zmin=0
# y direction domain length
zlen=1.6
# final output time
tout=40000
# time interval for output
outstep=50
n_hydro=1
# ratio of specific heats
gamma=1.66666667
# name of initial conditions
init=Clouds
# type of boundary condition, options include 1 (periodic), 2 (reflective), 3 (transmissive), 4 (custom)
xl_bcnd=4
xu_bcnd=3
yl_bcnd=3
yu_bcnd=3
zl_bcnd=3
zu_bcnd=3
# path to output directory
outdir=./hdf5/raw/
# nfile=1e10
custom_bcnd=wind
4 changes: 2 additions & 2 deletions src/grid/cuda_boundaries.cu
Original file line number Diff line number Diff line change
Expand Up @@ -312,13 +312,13 @@ __global__ void Wind_Boundary_kernel(Real *c_device, int nx, int ny, int nz, int
Real vx, vy, vz, d_0, P_0;

n_0 = 1e-2; // same value as n_bg in cloud initial condition function (cm^-3)
T_0 = 3e6; // same value as T_bg in cloud initial condition function (K)
T_0 = 3e7; // same value as T_bg in cloud initial condition function (K)

// same values as rho_bg and p_bg in cloud initial condition function
d_0 = n_0 * mu * MP / DENSITY_UNIT;
P_0 = n_0 * KB * T_0 / PRESSURE_UNIT;

vx = 100 * TIME_UNIT / KPC; // km/s * (cholla unit conversion)
vx = 1000 * TIME_UNIT / KPC; // km/s * (cholla unit conversion)
vy = 0.0;
vz = 0.0;

Expand Down
14 changes: 7 additions & 7 deletions src/grid/initial_conditions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1324,7 +1324,7 @@ void Grid3D::Clouds()
Real p_bg, p_cl; // background and cloud pressure
Real mu = 0.6; // mean atomic weight
int N_cl = 1; // number of clouds
Real R_cl = 2.5; // cloud radius in code units (kpc)
Real R_cl = .1; // cloud radius in code units (kpc)
Real cl_pos[N_cl][3]; // array of cloud positions
Real r;

Expand All @@ -1339,22 +1339,22 @@ void Grid3D::Clouds()

// single centered cloud setup
for (int nn = 0; nn < N_cl; nn++) {
cl_pos[nn][0] = 0.5 * H.xdglobal;
cl_pos[nn][0] = 0.1 * H.xdglobal;
cl_pos[nn][1] = 0.5 * H.ydglobal;
cl_pos[nn][2] = 0.5 * H.zdglobal;
printf("Cloud positions: %f %f %f\n", cl_pos[nn][0], cl_pos[nn][1], cl_pos[nn][2]);
}

n_bg = 1.68e-4;
n_cl = 5.4e-2;
n_bg = 1e-2;
n_cl = 10;
rho_bg = n_bg * mu * MP / DENSITY_UNIT;
rho_cl = n_cl * mu * MP / DENSITY_UNIT;
vx_bg = 0.0;
vx_cl = 0.0;
// vx_c = -200*TIME_UNIT/KPC; // convert from km/s to kpc/kyr
vx_cl = 0.0;
vx_bg = 1000*TIME_UNIT/KPC;
vy_bg = vy_cl = 0.0;
vz_bg = vz_cl = 0.0;
T_bg = 3e6;
T_bg = 3e7;
T_cl = 1e4;
p_bg = n_bg * KB * T_bg / PRESSURE_UNIT;
p_cl = p_bg;
Expand Down

0 comments on commit 7f5dd01

Please sign in to comment.