Skip to content

Commit

Permalink
Merge branch 'circ_det' of github.com:zingale/Castro into circ_det
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale committed May 30, 2024
2 parents 868eac5 + ce20082 commit 30406fa
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
9 changes: 6 additions & 3 deletions Exec/science/circular_det/_prob_params
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@ nfrac real 0.0_rt y

ofrac real 0.0_rt y

# dimensionless width of transition between hot and cold
w_T real 5.e-4_rt y

center_T real 0.3_rt y
# dimensionless semi-major axis
a_T real 0.3_rt y

smallx real 1.e-12_rt y
# eccentricity
ecc_T real 0.0 y

idir integer 1 y
smallx real 1.e-12_rt y

ihe4 integer -1

Expand Down
7 changes: 4 additions & 3 deletions Exec/science/circular_det/inputs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ castro.use_flattening = 1
castro.riemann_solver = 1

# TIME STEP CONTROL
castro.cfl = 0.5 # cfl number for hyperbolic system
castro.cfl = 0.4 # cfl number for hyperbolic system
castro.init_shrink = 0.1 # scale back initial timestep
castro.change_max = 1.05 # scale back initial timestep

Expand Down Expand Up @@ -82,8 +82,9 @@ problem.smallx = 1.e-10

problem.idir = 1

problem.w_T = 1.e-3
problem.center_T = 0.1
problem.w_T = 1.e-2
problem.a_T = 0.15
problem.ecc_T = 0.7

# refinement

Expand Down
12 changes: 8 additions & 4 deletions Exec/science/circular_det/problem_initialize_state_data.H
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,22 @@ void problem_initialize_state_data (int i, int j, int k,
const Real* problo = geomdata.ProbLo();
const Real* probhi = geomdata.ProbHi();

Real width = problem::w_T * (probhi[0] - problo[0]);
Real c_T = problem::center_T * (probhi[0] - problo[0]);
// semi-major axis
Real a = problem::a_T * (probhi[0] - problo[0]);

// semi-minor axis
Real b = a * std::sqrt(1.0 - problem::ecc_T * problem::ecc_T);

// compute distance from the center
Real xx = problo[0] + dx[0] * (static_cast<Real>(i) + 0.5_rt) - problem::center[0];
Real yy = problo[1] + dx[1] * (static_cast<Real>(j) + 0.5_rt) - problem::center[1];

Real r = std::sqrt(xx * xx + yy * yy);
Real r = std::sqrt((xx / a) * (xx / a) +
(yy / b) * (yy / b));

state(i,j,k,URHO) = problem::dens;

Real sigma = 1.0_rt / (1.0_rt + std::exp(-(c_T - r)/ width));
Real sigma = 1.0_rt / (1.0_rt + std::exp(-(1.0_rt - r)/ problem::w_T));

state(i,j,k,UTEMP) = problem::T_l + (problem::T_r - problem::T_l) * (1.0_rt - sigma);

Expand Down

0 comments on commit 30406fa

Please sign in to comment.