Skip to content

Commit

Permalink
Merge branch 'PhaseField' into 'master'
Browse files Browse the repository at this point in the history
[PhaseField] Return C_tensile and C_compressive

See merge request ogs/ogs!4682
  • Loading branch information
endJunction committed Jul 19, 2023
2 parents 4f90a75 + 6944f11 commit 4bfda59
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 29 deletions.
27 changes: 21 additions & 6 deletions MaterialLib/SolidModels/LinearElasticIsotropicPhaseField.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@ std::tuple<MathLib::KelvinVector::KelvinVectorType<
MathLib::KelvinVector::KelvinVectorType<
DisplacementDim> /* sigma_tensile */,
MathLib::KelvinVector::KelvinMatrixType<DisplacementDim> /* D */,
double /* strain_energy_tensile */, double /* elastic_energy */
double /* strain_energy_tensile */, double /* elastic_energy */,
MathLib::KelvinVector::KelvinMatrixType<
DisplacementDim> /* C_tensile */,
MathLib::KelvinVector::KelvinMatrixType<
DisplacementDim> /* C_compressive
*/
>
calculateVolDevDegradedStress(
double const degradation, double const bulk_modulus, double const mu,
Expand Down Expand Up @@ -114,7 +119,7 @@ calculateVolDevDegradedStress(
KelvinMatrix const D = degradation * C_tensile + C_compressive;

return std::make_tuple(sigma_real, sigma_tensile, D, strain_energy_tensile,
elastic_energy);
elastic_energy, C_tensile, C_compressive);
}

template <int DisplacementDim>
Expand All @@ -123,7 +128,12 @@ std::tuple<MathLib::KelvinVector::KelvinVectorType<
MathLib::KelvinVector::KelvinVectorType<
DisplacementDim> /* sigma_tensile */,
MathLib::KelvinVector::KelvinMatrixType<DisplacementDim> /* D */,
double /* strain_energy_tensile */, double /* elastic_energy */
double /* strain_energy_tensile */, double /* elastic_energy */,
MathLib::KelvinVector::KelvinMatrixType<
DisplacementDim> /* C_tensile */,
MathLib::KelvinVector::KelvinMatrixType<
DisplacementDim> /* C_compressive
*/
>
calculateIsotropicDegradedStress(
double const degradation,
Expand Down Expand Up @@ -162,7 +172,7 @@ calculateIsotropicDegradedStress(
KelvinMatrix const D = degradation * C_tensile + C_compressive;

return std::make_tuple(sigma_real, sigma_tensile, D, strain_energy_tensile,
elastic_energy);
elastic_energy, C_tensile, C_compressive);
}

template <int DisplacementDim>
Expand All @@ -171,7 +181,12 @@ std::tuple<MathLib::KelvinVector::KelvinVectorType<
MathLib::KelvinVector::KelvinVectorType<
DisplacementDim> /* sigma_tensile */,
MathLib::KelvinVector::KelvinMatrixType<DisplacementDim> /* D */,
double /* strain_energy_tensile */, double /* elastic_energy */
double /* strain_energy_tensile */, double /* elastic_energy */,
MathLib::KelvinVector::KelvinMatrixType<
DisplacementDim> /* C_tensile */,
MathLib::KelvinVector::KelvinMatrixType<
DisplacementDim> /* C_compressive
*/
>
calculateIsotropicDegradedStressWithRankineEnergy(
double const degradation,
Expand Down Expand Up @@ -225,7 +240,7 @@ calculateIsotropicDegradedStressWithRankineEnergy(

KelvinMatrix const D = degradation * C_tensile + C_compressive;
return std::make_tuple(sigma_real, sigma_tensile, D, strain_energy_tensile,
elastic_energy);
elastic_energy, C_tensile, C_compressive);
}

} // namespace Phasefield
Expand Down
19 changes: 15 additions & 4 deletions MaterialLib/SolidModels/LinearElasticOrthotropicPhaseField.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ std::tuple<MathLib::KelvinVector::KelvinVectorType<
MathLib::KelvinVector::KelvinVectorType<
DisplacementDim> /* sigma_compressive */,
MathLib::KelvinVector::KelvinMatrixType<DisplacementDim> /* D */,
double /* strain_energy_tensile */, double /* elastic_energy */
double /* strain_energy_tensile */, double /* elastic_energy */,
MathLib::KelvinVector::KelvinMatrixType<
DisplacementDim> /* C_tensile */,
MathLib::KelvinVector::KelvinMatrixType<
DisplacementDim> /* C_compressive
*/
>
calculateOrthoVolDevDegradedStress(
double const degradation,
Expand Down Expand Up @@ -101,7 +106,7 @@ calculateOrthoVolDevDegradedStress(

return std::make_tuple(eps_tensile, sigma_real, sigma_tensile,
sigma_compressive, D, strain_energy_tensile,
elastic_energy);
elastic_energy, C_tensile, C_compressive);
}

template <int DisplacementDim>
Expand All @@ -112,7 +117,12 @@ std::tuple<MathLib::KelvinVector::KelvinVectorType<
MathLib::KelvinVector::KelvinVectorType<
DisplacementDim> /* sigma_tensile */,
MathLib::KelvinVector::KelvinMatrixType<DisplacementDim> /* D */,
double /* strain_energy_tensile */, double /* elastic_energy */
double /* strain_energy_tensile */, double /* elastic_energy */,
MathLib::KelvinVector::KelvinMatrixType<
DisplacementDim> /* C_tensile */,
MathLib::KelvinVector::KelvinMatrixType<
DisplacementDim> /* C_compressive
*/
>
calculateOrthoMasonryDegradedStress(
double const degradation,
Expand Down Expand Up @@ -213,7 +223,8 @@ calculateOrthoMasonryDegradedStress(
KelvinMatrix const D = degradation * C_tensile + C_compressive;

return std::make_tuple(eps_tensile, sigma_real, sigma_tensile, D,
strain_energy_tensile, elastic_energy);
strain_energy_tensile, elastic_energy, C_tensile,
C_compressive);
}

} // namespace Phasefield
Expand Down
35 changes: 19 additions & 16 deletions ProcessLib/PhaseField/PhaseFieldFEM.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ struct IntegrationPointData final
DisplacementDim>::MaterialStateVariables>
material_state_variables;

typename BMatricesType::KelvinMatrixType D;
typename BMatricesType::KelvinMatrixType D, C_tensile, C_compressive;

double integration_weight;
double history_variable, history_variable_prev;
Expand Down Expand Up @@ -95,23 +95,26 @@ struct IntegrationPointData final
case EnergySplitModel::Isotropic:
{
std::tie(sigma, sigma_tensile, D, strain_energy_tensile,
elastic_energy) = MaterialLib::Solids::Phasefield::
calculateIsotropicDegradedStress<DisplacementDim>(
degradation, bulk_modulus, mu, eps);
elastic_energy, C_tensile, C_compressive) =
MaterialLib::Solids::Phasefield::
calculateIsotropicDegradedStress<DisplacementDim>(
degradation, bulk_modulus, mu, eps);
break;
}
case EnergySplitModel::VolDev:
{
std::tie(sigma, sigma_tensile, D, strain_energy_tensile,
elastic_energy) = MaterialLib::Solids::Phasefield::
calculateVolDevDegradedStress<DisplacementDim>(
degradation, bulk_modulus, mu, eps);
elastic_energy, C_tensile, C_compressive) =
MaterialLib::Solids::Phasefield::
calculateVolDevDegradedStress<DisplacementDim>(
degradation, bulk_modulus, mu, eps);
break;
}
case EnergySplitModel::EffectiveStress:
{
std::tie(sigma, sigma_tensile, D, strain_energy_tensile,
elastic_energy) = MaterialLib::Solids::Phasefield::
elastic_energy, C_tensile,
C_compressive) = MaterialLib::Solids::Phasefield::
calculateIsotropicDegradedStressWithRankineEnergy<
DisplacementDim>(degradation, bulk_modulus, mu, eps);
break;
Expand All @@ -126,10 +129,10 @@ struct IntegrationPointData final
.getElasticTensor(t, x, temperature);

std::tie(eps_tensile, sigma, sigma_tensile, sigma_compressive,
D, strain_energy_tensile, elastic_energy) =
MaterialLib::Solids::Phasefield::
calculateOrthoVolDevDegradedStress<DisplacementDim>(
degradation, eps, C_ortho);
D, strain_energy_tensile, elastic_energy, C_tensile,
C_compressive) = MaterialLib::Solids::Phasefield::
calculateOrthoVolDevDegradedStress<DisplacementDim>(
degradation, eps, C_ortho);
break;
}
case EnergySplitModel::OrthoMasonry:
Expand All @@ -142,10 +145,10 @@ struct IntegrationPointData final
.getElasticTensor(t, x, temperature);

std::tie(eps_tensile, sigma, sigma_tensile, D,
strain_energy_tensile, elastic_energy) =
MaterialLib::Solids::Phasefield::
calculateOrthoMasonryDegradedStress<DisplacementDim>(
degradation, eps, C_ortho);
strain_energy_tensile, elastic_energy, C_tensile,
C_compressive) = MaterialLib::Solids::Phasefield::
calculateOrthoMasonryDegradedStress<DisplacementDim>(
degradation, eps, C_ortho);
break;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ struct IntegrationPointData final
DisplacementDim>::MaterialStateVariables>
material_state_variables;

typename BMatricesType::KelvinMatrixType D;
typename BMatricesType::KelvinMatrixType D, C_tensile, C_compressive;
double integration_weight;

void pushBackState()
Expand Down Expand Up @@ -91,8 +91,8 @@ struct IntegrationPointData final
auto const bulk_modulus = linear_elastic_mp.bulk_modulus(t, x);
auto const mu = linear_elastic_mp.mu(t, x);

std::tie(sigma, sigma_tensile, D, strain_energy_tensile,
elastic_energy) =
std::tie(sigma, sigma_tensile, D, strain_energy_tensile, elastic_energy,
C_tensile, C_compressive) =
MaterialLib::Solids::Phasefield::calculateVolDevDegradedStress<
DisplacementDim>(degradation, bulk_modulus, mu, eps_m);
}
Expand Down

0 comments on commit 4bfda59

Please sign in to comment.