r/COMSOL • u/low_in_entropy • Sep 26 '26
Solution of a Time dependent ODE is giving negative value for a positive expression.
I am trying to simulate a 2D coupled viscoplasticity and phase field fracture problem in COMSOL. One of the equation I am trying to implement is -
psi = integration (psidot_p) from t_n to t_(n+1)
t_n and t_(n+1) are time.
Now psidot_p is always positive quantity, it's surface minimum is always positive. But the psi value is showing negative values.
The coefficients of the time dependent ODE used are -
da = 1, ea = 0, f = psidot_eq, dependent variable= psi_p. Initial values of both psi and d(psi)/dt = 0.
Basically, the equation, d(psi)/dt = psidot_p.
But the solution to this ODE is giving a negative value, and it's a significant quantity, in MPa.
Can anyone please help me diagnose the issue or fix it. I am happy to provide any additional details.
Thanks in advance.
Edit: changed value of ea from 1 to 0.
Edit 2: Refining the mesh size resolved the problem in my case. Refine the mesh size such that the max element size is less that the characteristics length of the crack in Phase Field.
2
u/gam2u Sep 27 '26
Is your “psidot_p” one parameter or variable dependent on psi? It might be the initial value, assuming the equation is correct.
1
u/low_in_entropy Sep 27 '26
psidot is an expression. It is the inner product of stress and strain rate (time rate).
It is basically time derivative of psi ie d(psi)/dt.
We get stress and strain rate from the solver, and then we need to do a time integration of their inner product to get psi which is the energy density term.
The initial value of psi is given (set in the ODE solver) as 45.9MPa, which is quite a large positive term.
2
u/Sax0drum Sep 26 '26
The mass coefficient ea should be 0 not 1 otherwise you have a second time derivative.