Skip to content

Commit

Permalink
Reduce beta to 1.0 for boundary cells.
Browse files Browse the repository at this point in the history
  • Loading branch information
cpraveen committed Oct 16, 2014
1 parent 95ebbd8 commit e839af6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
5 changes: 1 addition & 4 deletions src_gll/claw.cc
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,8 @@ void ConservationLaw<dim>::setup_system ()
cell_data[c].tcell = neighbor;
else
{
std::cout << "Did not find all neighbours\n";
std::cout << "dx, dy = " << dr(0) << " " << dr(1) << std::endl;
exit(0);
AssertThrow(false, ExcMessage("Did not find all neighbours"));
}
}
else
Expand All @@ -387,8 +386,6 @@ void ConservationLaw<dim>::setup_system ()
{
AssertThrow(false, ExcMessage("Error in getting boundary condition"));
}


}
}

Expand Down
14 changes: 9 additions & 5 deletions src_gll/limiter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,16 @@ void ConservationLaw<dim>::apply_limiter_TVB_Qk ()
cell = dof_handler.begin_active(),
endc = dof_handler.end(),
endc0 = dh_cell.end();

const double beta = parameters.beta;


for(; cell != endc; ++cell)
{
const unsigned int c = cell_number(cell);
if(shock_indicator[c] > 1.0)
{
const double dx = cell->diameter() / std::sqrt(1.0*dim);
const double Mdx2 = parameters.M * dx * dx;
double betax = parameters.beta;
double betay = parameters.beta;

// Compute average gradient in cell
fe_values_grad.reinit(cell);
Expand Down Expand Up @@ -123,6 +123,7 @@ void ConservationLaw<dim>::apply_limiter_TVB_Qk ()
{
dbx = 0.0;
dbx(0) = 2.0*cell_average[c][0];
betax = 1.0;
}

// Forward difference of cell averages
Expand All @@ -137,6 +138,7 @@ void ConservationLaw<dim>::apply_limiter_TVB_Qk ()
{
dfx = 0.0;
dfx(0) = -2.0*cell_average[c][0];
betax = 1.0;
}

// Backward difference of cell averages
Expand All @@ -151,6 +153,7 @@ void ConservationLaw<dim>::apply_limiter_TVB_Qk ()
{
dby = 0.0;
dby(1) = 2.0*cell_average[c][1];
betay = 1.0;
}

// Forward difference of cell averages
Expand All @@ -165,6 +168,7 @@ void ConservationLaw<dim>::apply_limiter_TVB_Qk ()
{
dfy = 0.0;
dfy(1) = -2.0*cell_average[c][1];
betay = 1.0;
}

// Transform to characteristic variables
Expand All @@ -186,8 +190,8 @@ void ConservationLaw<dim>::apply_limiter_TVB_Qk ()
double change_y = 0;
for(unsigned int i=0; i<n_components; ++i)
{
Dx_new(i) = minmod(Dx(i), beta*dbx(i), beta*dfx(i), Mdx2);
Dy_new(i) = minmod(Dy(i), beta*dby(i), beta*dfy(i), Mdx2);
Dx_new(i) = minmod(Dx(i), betax*dbx(i), betax*dfx(i), Mdx2);
Dy_new(i) = minmod(Dy(i), betay*dby(i), betay*dfy(i), Mdx2);
change_x += std::fabs(Dx_new(i) - Dx(i));
change_y += std::fabs(Dy_new(i) - Dy(i));
}
Expand Down

0 comments on commit e839af6

Please sign in to comment.