Skip to content

Commit f86a3c3

Browse files
committed
Fixes to assemblers and test.
1 parent 5846ad9 commit f86a3c3

File tree

3 files changed

+21
-35
lines changed

3 files changed

+21
-35
lines changed

source/simulator/assemblers/newton_stokes.cc

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -464,31 +464,13 @@ namespace aspect
464464
if (enable_prescribed_dilation)
465465
{
466466
const unsigned int index_direction=fe.system_to_component_index(i).first;
467-
// Only want the velocity components and not the pressure one (which is the last one), so add 1
468-
if (introspection.is_stokes_component(index_direction+1))
469-
data.local_rhs(i) += (
470-
// RHS of - (div u,q) = - (R,q)
471-
- pressure_scaling
472-
* (prescribed_dilation->dilation_rhs_term[index_direction][q] -
473-
prescribed_dilation->dilation_lhs_term[q] *
474-
scratch.material_model_inputs.pressure[q])
475-
* scratch.phi_p[i]
476-
) * JxW;
477-
}
478-
479-
// Only assemble this term if we are running incompressible, otherwise this term
480-
// is already included on the LHS of the equation.
481-
if (enable_prescribed_dilation && !material_model_is_compressible)
482-
{
483-
const unsigned int index_direction=fe.system_to_component_index(i).first;
484-
// Only want the velocity components and not the pressure one (which is the last one), so add 1
485-
if (introspection.is_stokes_component(index_direction+1))
486-
data.local_rhs(i) += (
487-
// RHS of momentum eqn: - \int 2/3 eta R, div v
488-
- 2.0 / 3.0 * eta
489-
* prescribed_dilation->dilation_rhs_term[index_direction][q]
490-
* scratch.div_phi_u[i]
491-
) * JxW;
467+
data.local_rhs(i) += (
468+
- pressure_scaling
469+
* (prescribed_dilation->dilation_rhs_term[index_direction][q] -
470+
prescribed_dilation->dilation_lhs_term[q] *
471+
scratch.material_model_inputs.pressure[q])
472+
* scratch.phi_p[i]
473+
) * JxW;
492474
}
493475
}
494476

source/simulator/assemblers/stokes.cc

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -456,12 +456,16 @@ namespace aspect
456456
const unsigned int index_direction=fe.system_to_component_index(i).first;
457457
// Only want the velocity components and not the pressure one (which is the last one), so add 1
458458
if (introspection.is_stokes_component(index_direction+1))
459-
data.local_rhs(i) += (
460-
// RHS of - (div u,q) = - (R,q)
461-
- pressure_scaling
462-
* prescribed_dilation->dilation_rhs_term[index_direction][q]
463-
* scratch.phi_p[i]
464-
) * JxW;
459+
{
460+
const unsigned int index_direction=fe.system_to_component_index(i).first;
461+
data.local_rhs(i) += (
462+
- pressure_scaling
463+
* (prescribed_dilation->dilation_rhs_term[index_direction][q] -
464+
prescribed_dilation->dilation_lhs_term[q] *
465+
scratch.material_model_inputs.pressure[q])
466+
* scratch.phi_p[i]
467+
) * JxW;
468+
}
465469
}
466470

467471
// Only assemble this term if we are running incompressible, otherwise this term

tests/prescribed_dilation.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,11 +207,11 @@ namespace aspect
207207
}
208208
if (prescribed_dilation)
209209
{
210-
prescribed_dilation->dilation_rhs_term[i] = x;
211-
prescribed_dilation->dilation_lhs_term[0][i] = 0.;
212-
prescribed_dilation->dilation_lhs_term[1][i] = 0.;
210+
prescribed_dilation->dilation_lhs_term[i] = 0;
211+
prescribed_dilation->dilation_rhs_term[0][i] = x;
212+
prescribed_dilation->dilation_rhs_term[1][i] = x;
213213
if (dim == 3)
214-
prescribed_dilation->dilation_lhs_term[2][i] = 0.;
214+
prescribed_dilation->dilation_rhs_term[2][i] = x;
215215
}
216216

217217
}

0 commit comments

Comments
 (0)