Skip to content

Commit

Permalink
Small corrections/typos
Browse files Browse the repository at this point in the history
  • Loading branch information
dinatraykova committed Jul 27, 2023
1 parent 24e62e9 commit d01133c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 19 deletions.
32 changes: 16 additions & 16 deletions Examples/PerfectFluid/InitialFluidData.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,33 +49,33 @@ class InitialFluidData
data_t rr = coords.get_radius();
data_t rr2 = rr * rr;
data_t x = coords.x;
data_t y = coords.y;
data_t z = coords.z;
double y = coords.y;
double z = coords.z;

double xx, yy;
double vx, vy, nn;
double gamma_fac;
double ux, uy;
data_t vx, vy, vz, eps;
data_t gamma_fac;
data_t ux, uy, uz;

//DT: What is L? also ycenter?
const double L[2] = {1.,2.};
//double uflow = 1./(4.*sqrt(3));
double ycenter[2] = {-0.5,0.5};
//KevinHelmholtz(1.,1./(4.*sqrt(3)),0.01,0.05,0.2,ycenter);

vx = uflow*(tanh((y-ycenter[0])/awidth)
- tanh((y-ycenter[1])/awidth) - 1.);
vy = amp * sin(2.*M_PI*x/L[0])*(exp(-pow((y-ycenter[0])/sigma,2))
+ exp(-pow((y-ycenter[1])/sigma,2)));
vx = m_params.uflow*(tanh((y-ycenter[0])/m_params.awidth)
- tanh((y-ycenter[1])/m_params.awidth) - 1.);
vy = m_params.amp * sin(2.*M_PI*x/L[0])
*(exp(-pow((y-ycenter[0])/m_params.sigma,2))
+ exp(-pow((y-ycenter[1])/m_params.sigma,2)));
vz = 0.;
//DT: Thought eps was meant to be 0?
esp = 1. + 0.5*(tanh((y-ycenter[0])/awidth) - tanh((y-ycenter[1])/awidth));
gamma_fac = 1./sqrt(1-vx*vx-vy*vy - vz*vz);
eps = 1. + 0.5*(tanh((y-ycenter[0])/m_params.awidth) - tanh((y-ycenter[1])/m_params.awidth));
gamma_fac = 1./sqrt(1. - vx*vx - vy*vy - vz*vz);
ux = gamma_fac * vx;
uy = gamma_fac * vy;
uz = gamma_fac * vz;

data_t rho = rho0;
data_t rho = m_params.rho0;
data_t v2 = ux*ux + uy*uy + uz*uz;
data_t P = rho * (1. + eps) / 3.;
data_t WW = 1./(1. - v2);
Expand All @@ -89,9 +89,9 @@ class InitialFluidData

// store the vars
current_cell.store_vars(rho, c_rho);
current_cell.store_vars(u1, c_vi1);
current_cell.store_vars(u2, c_vi2);
current_cell.store_vars(u3, c_vi3);
current_cell.store_vars(ux, c_vi1);
current_cell.store_vars(uy, c_vi2);
current_cell.store_vars(uz, c_vi3);
current_cell.store_vars(eps, c_eps);
current_cell.store_vars(D, c_D);
current_cell.store_vars(Sj3, c_Sj1);
Expand Down
9 changes: 6 additions & 3 deletions Examples/PerfectFluid/WENODerivatives.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ class WENODerivatives
RIGHT_PLUS,
};

public:
WENODerivatives(double a_eW=1.0): m_eW(a_eW){}
// public:
WENODerivatives(double a_eW): m_eW(a_eW){}

template <class data_t>
ALWAYS_INLINE data_t get_Pface(const double *in_ptr, const int idx,
Expand Down Expand Up @@ -203,7 +203,7 @@ class WENODerivatives
}

template <class data_t>
void get_Pface(Tensor<1, <data_t> &diff_value, const Cell<data_t> &current_cell,
void get_Pface(Tensor<1, data_t> &diff_value, const Cell<data_t> &current_cell,
int direction, int ivar, int dir_switch) const
{
const int stride =
Expand All @@ -213,6 +213,9 @@ class WENODerivatives
current_cell.get_box_pointers().m_in_ptr[ivar], in_index, stride, dir_switch);
}

protected:
double m_eW;

};

#endif /* WENODERIVATIVES_HPP_ */

0 comments on commit d01133c

Please sign in to comment.