Share/communicate calculations results via _ip and material_state_variables
Description
Dear OGS developers, I would like to comunicate some values between coupled processes.
I would like to store a scalar (the normal stress acting on a certain direction when first plasticity takes place) and I would like to read this scalar in the hydraulic process (because I will have a parametrization of the permeability depending on the difference between the stored stress and the current normal stress).
I developed an elasto-plastic model (PlaneWeakness.h and PlaneWeakness.cpp), where plastic failure can happen in an internal plane of weakness (localized Mohr Coulomb failure along a predefined direction) and a simple "cubic-law" permeability (PlaneWeaknessPermeability.cpp) .
I have issues with the communication of values from one process to the other. I tried to follow the Ehlers and its getEquivalentPlasticStrain as a template, writing values into _ip_data[ip].material_state_variables
Steps to Reproduce the Problem
-
In MechanicsBase.h I define the followings:
virtual double getEquivalentPlasticStrain() const { return 0.0; } virtual double getRuptureHappened() const { return 5.75; }
-
getRuptureHappened is defined as:
double StateVariables<DisplacementDim>::getRuptureHappened() const
{
return rupt_flag;
}
-
In Planeweakness.cpp I set
state.rupt_flag=100
(always, just to check if it is working). -
In PlaneWeakness.h I override the value state.rupt_flag
double getEquivalentPlasticStrain() const override;
double getRuptureHappened() const override;
- Then, in ThermoHydroMechanicsFEM-impl.h I have
vars.normal_stress_at_rupture =
_ip_data[ip].material_state_variables->getRuptureHappened();
- And in my permeability model PlaneWeaknessPermeability I output to screen what is in vars.normal_stress_at_rupture
double const norm_stress_r = variable_array.normal_stress_at_rupture;
//std::cout << "Read vars array? \n normal_stress_at_rupture " << norm_stress_r <<"\n"
Expected behavior:
Since in my rheological model I set always rupt_flag to 100, I expect the screen output of vars.normal_stress_at_rupture to be always 100
Actual behavior:
-
At timesteps 0 and 1, the content from vars.normal_stress_at_rupture is 0 , not 100 as I define with state.rupt_flag = 100 in my constitutive model.
-
After timestep 1, when the function getRuptureHappened is called by the assembler it gives back the value 5.75, not the value from override
Specifications
- Version: https://gitlab.opengeosys.org/lurpi/ogsPW/-/tree/PW_nov22 (my fork ogsPW, branch PW_nov22)
- a test input project for the THM process and the rheology+permeability model can be found here: https://gitlab.opengeosys.org/lurpi/1-element-input/-/tree/main
- Platform: Unix