Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/ChamberSphere.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ helper_functions: |

residuals:
- rho * thick0 * dvelo_dt + (thick0 / radius0) * (1 + (radius / radius0)) * stress - Pout * CG(radius)
- -stress + tau + 4 * (1 - CG(radius) ** -3) * (W1 + CG(radius) * W2) + 2 * eta * dCG(radius, dradius_dt) * (1 - 2 * CG(radius) ** -6)
- -stress + tau + 4 * (1 - CG(radius) ** (-3)) * (W1 + CG(radius) * W2) + eta * dCG(radius, dradius_dt) * (1 + 2 * CG(radius) ** (-6))
- 4 * pi * radius0 ** 2 * CG(radius) * velo - dvolume_dt
- dtau_dt + act * tau - sigma_max * act_plus
- dradius_dt - velo
Expand Down
20 changes: 10 additions & 10 deletions src/model/ChamberSphere.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ void ChamberSphere::setup_dofs(DOFHandler& dofhandler) {

void ChamberSphere::update_constant(SparseSystem& system,
std::vector<double>& parameters) {
const double thick0 = parameters[global_param_ids[ParamId::thick0]];
const double rho = parameters[global_param_ids[ParamId::rho]];
const double thick0 = parameters[global_param_ids[ParamId::thick0]];

// balance of linear momentum
system.E.coeffRef(global_eqn_ids[0], global_var_ids[5]) = rho * thick0;
Expand Down Expand Up @@ -61,10 +61,10 @@ void ChamberSphere::update_solution(

const double radius0 = parameters[global_param_ids[ParamId::radius0]];
const double velo = y[global_var_ids[5]];
const double dradius_dt = dy[global_var_ids[4]];
const double Pout = y[global_var_ids[2]];
const double radius = y[global_var_ids[4]];
const double stress = y[global_var_ids[6]];
const double dradius_dt = dy[global_var_ids[4]];
const double radius = y[global_var_ids[4]];

// balance of momentum
system.C.coeffRef(global_eqn_ids[0]) =
Expand All @@ -79,20 +79,20 @@ void ChamberSphere::update_solution(

// spherical stress
system.C.coeffRef(global_eqn_ids[1]) =
4 *
(dradius_dt * eta * (-2 * pow(radius0, 12) + pow(radius + radius0, 12)) +
pow(radius + radius0, 5) *
2 *
(dradius_dt * eta * (2 * pow(radius0, 12) + pow(radius + radius0, 12)) +
2 * pow(radius + radius0, 5) *
(-pow(radius0, 6) + pow(radius + radius0, 6)) *
(W1 * pow(radius0, 2) + W2 * pow(radius + radius0, 2))) /
(pow(radius0, 2) * pow(radius + radius0, 11));
system.dC_dy.coeffRef(global_eqn_ids[1], global_var_ids[4]) =
24 * W1 * pow(radius0, 6) / pow(radius + radius0, 7) +
8 * W2 * radius / pow(radius0, 2) +
16 * W2 * pow(radius0, 4) / pow(radius + radius0, 5) + 8 * W2 / radius0 +
88 * dradius_dt * eta * pow(radius0, 10) / pow(radius + radius0, 12) +
4 * dradius_dt * eta / pow(radius0, 2);
16 * W2 * pow(radius0, 4) / pow(radius + radius0, 5) + 8 * W2 / radius0 -
44 * dradius_dt * eta * pow(radius0, 10) / pow(radius + radius0, 12) +
2 * dradius_dt * eta / pow(radius0, 2);
system.dC_dydot.coeffRef(global_eqn_ids[1], global_var_ids[4]) =
-4 * eta * (2 * pow(radius0, 12) - pow(radius + radius0, 12)) /
2 * eta * (2 * pow(radius0, 12) + pow(radius + radius0, 12)) /
(pow(radius0, 2) * pow(radius + radius0, 11));

// volume change
Expand Down
4 changes: 2 additions & 2 deletions src/model/ChamberSphere.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
*
* 2. Spherical stress:
* \f[
* -S + \tau + 4 (1 - C^{-3}) (W_1 + C W_2) + 2 \eta \dot{C}
* (1 - 2 C^{-6}) = 0
* -S + \tau + 4 (1 - C^{-3}) (W_1 + C W_2) + \eta \dot{C}
* (1 + 2 C^{-6}) = 0
* \f]
*
* 3. Volume change:
Expand Down
Loading
Loading