Skip to content

Commit

Permalink
[PL/TH2M] Replace eps initialization, no ip data
Browse files Browse the repository at this point in the history
Since eps became stateless, the initialization is also using
current displacement to compute the strains.
With this the epsilon_ip data is no longer necessary and does
not have to be reset for certain restart simulations.
  • Loading branch information
endJunction committed Jan 16, 2024
1 parent 2eb4317 commit 4d55379
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ProcessLib/TH2M/IntegrationPointData.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ struct IntegrationPointData final
MathLib::KelvinVector::kelvin_vector_dimensions(DisplacementDim);
sigma_eff.setZero(kelvin_vector_size);
sigma_sw.setZero(kelvin_vector_size);
eps.setZero(kelvin_vector_size);
eps.resize(
kelvin_vector_size); // Later initialization from displacement
eps_m.setZero(kelvin_vector_size);
eps_m_prev.resize(kelvin_vector_size);
sigma_eff_prev.resize(kelvin_vector_size);
Expand Down
16 changes: 16 additions & 0 deletions ProcessLib/TH2M/TH2MFEM-impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -947,6 +947,9 @@ void TH2MLocalAssembler<ShapeFunctionDisplacement, ShapeFunctionPressure,
auto const temperature =
local_x.template segment<temperature_size>(temperature_index);

auto const displacement =
local_x.template segment<displacement_size>(displacement_index);

constexpr double dt = std::numeric_limits<double>::quiet_NaN();
auto const& medium = *_process_data.media_map.getMedium(_element.getID());
auto const& solid_phase = medium.phase("Solid");
Expand All @@ -961,6 +964,12 @@ void TH2MLocalAssembler<ShapeFunctionDisplacement, ShapeFunctionPressure,
auto& ip_data = _ip_data[ip];
auto const& Np = ip_data.N_p;
auto const& NT = Np;
auto const& Nu = ip_data.N_u;
auto const& gradNu = ip_data.dNdx_u;
auto const x_coord =
NumLib::interpolateXCoordinate<ShapeFunctionDisplacement,
ShapeMatricesTypeDisplacement>(
_element, Nu);
ParameterLib::SpatialPosition const pos{
std::nullopt, _element.getID(), ip,
MathLib::Point3d(
Expand All @@ -974,7 +983,14 @@ void TH2MLocalAssembler<ShapeFunctionDisplacement, ShapeFunctionPressure,
double const T = NT.dot(temperature);
vars.temperature = T;

auto const Bu =
LinearBMatrix::computeBMatrix<DisplacementDim,
ShapeFunctionDisplacement::NPOINTS,
typename BMatricesType::BMatrixType>(
gradNu, Nu, x_coord, _is_axially_symmetric);

auto& eps = ip_data.eps;
eps.noalias() = Bu * displacement;

// Set volumetric strain rate for the general case without swelling.
vars.volumetric_strain = Invariants::trace(eps);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<FieldData>
<DataArray type="Int8" Name="IntegrationPointMetaData" NumberOfTuples="1002" format="appended" RangeMin="34" RangeMax="125" offset="0" />
<DataArray type="Int8" Name="OGS_VERSION" NumberOfTuples="25" format="appended" RangeMin="45" RangeMax="121" offset="312" />
<DataArray type="Float64" Name="epsilon_ip" NumberOfComponents="4" NumberOfTuples="48" format="appended" RangeMin="0.00049497474683" RangeMax="0.00049497474683" offset="400" />
<DataArray type="Float64" Name="material_state_variable_ElasticStrain_ip" NumberOfComponents="4" NumberOfTuples="24" format="appended" RangeMin="0.00043074710448" RangeMax="0.00043074710448" offset="1000" />
<DataArray type="Float64" Name="material_state_variable_EquivalentPlasticStrain_ip" NumberOfTuples="24" format="appended" RangeMin="9.19908e-05" RangeMax="9.19908e-05" offset="1576" />
<DataArray type="Float64" Name="material_state_variable_damage.kappa_d_ip" NumberOfTuples="24" format="appended" RangeMin="0" RangeMax="0" offset="1728" />
Expand Down

0 comments on commit 4d55379

Please sign in to comment.