Closed AdrienWehrle closed 6 months ago
It looks like it's actually coming from the declaration of the viscosity, that I need to call to evaluate it at timestep t-1.
I thought it might be because I'm trying to access an object that doesn't exist yet, so I added:
ADReal eta = 0;
// Get viscosity
if (_dt <= 1)
{
ADReal eta = 1e10;
}
else
{
Moose::StateArg previous_time(1, Moose::SolutionIterationType::Time);
ADReal eta = _viscosity(r, previous_time);
}
but the segmentation fault persists.
seg faults are a good problem to have they are easy to find with a debugger use this https://mooseframework.inl.gov/application_development/debugging.html
Yes so it's definitely linked to the state at t = 0:
Assertion `state.state == 0' failed
getDirichletBoundaryFaceValue currently only supports evaluating at the current time/iteration state
at /home/adrien/UZH/projects/moose/framework/src/variables/MooseVariableFV.C, line 526
yeah you wont be able to do that then. You d have to take great care to prevent the boundary temperature from being evaluated at the previous iteration if you want to still use the previous iteration in the rest of the domain
I see. I'm accessing the viscosity at time t-1 to compute the strain rates, e.g.:
ADReal sxx = 2 * eta * u_x + sig_m;
to be able to compute the new viscosity as the viscosity depends on the second invariant of the strain rate tensor. Instead of this, do you think I could compute the strain rate out of this object with an action, and call those variables? Most of the objects I see I could use are from the tensor mechanics module and I don't think that would work with FV...
Can you compute it with current data instead of lagged-by-an-iteration data?
Yes so it's definitely linked to the state at t = 0:
Assertion `state.state == 0' failed getDirichletBoundaryFaceValue currently only supports evaluating at the current time/iteration state at /home/adrien/UZH/projects/moose/framework/src/variables/MooseVariableFV.C, line 526
It looks like that wasn't the origin of the segmentation fault.
If I use the current data, such as:
// Get viscosity
if (_dt <= 1)
{
ADReal eta = 1e10;
}
else
{
ADReal eta = _viscosity(r, t);
}
then the state error I got above indeed disappears but the segmentation fault persists, and I don't get much more even in debug mode. I'll dig into it.
But if replace _viscosity(r, t)
for a constant, then I don't get a segmentation fault anymore, so it definitely comes from this.
Everything's ok when I evaluate other variables like _pressure(r, t)
. It's really because I'm calling the very variable that is being computed in the property.
I feel like I'm doing circular reasoning here. It feels like I should add mu_sediment
as a coupledvar, but then I'm being asked to feed it into the Sediment object although it comes from it...
Do you use mu_sediment to compute mu_sediment? this would fail for sure
Apologies, this segmentation fault is not a problem anymore since I had a mistake in my implementation of Drucker-Prager for the sediments. I was computing the second invariant of the stress tensor instead of the strain rate tensor, I hence don't need to evaluate the current viscosity in there anymore.
Every time I've been using
FVSedimentMaterialSI
(variable viscosity) e.g. in https://github.com/AdrienWehrle/diuca/blob/PR_sedimentbase/problems/icestream_fv_3d_SI_ru_sediment.i I've been getting a segmentation fault that I find very hard to debug. I thought it could come from the viscosity evaluated at time t-1 but getting rid of it doesn't fix the segmentation fault.any idea @GiudGiud?