sfepy / sfepy

Main SfePy repository
http://sfepy.org
BSD 3-Clause "New" or "Revised" License
749 stars 184 forks source link

Use adaptive time step #822

Open Amirrgrbn opened 2 years ago

Amirrgrbn commented 2 years ago

Hello, I want to have a force, using increments with time steps; it would be the cyclic load so loading and unloading, I wan the unlodqing part takes place much slower also symmetric (starts and ends at 0 value for force). I have already seent the Adaptive example in ball problem, but it wasnt helpful; would you pleased let me know how can i possibily do it?

vlukes commented 2 years ago

Hi @Amirrgrbn, You can use parametric_hook to control your time step. Have a look at e.g. diffusion/poisson_parametric_study.py, where the hook is employed.

rc commented 2 years ago

Or maybe the other way round. If the force is given by a material function, you could make it so that the unloading is slower easily even with a fixed time-step. Are you using only pseudo-time-stepping (quasistatic problem) to gradually change the force, or is it really a time-dependent problem?

Amirrgrbn commented 2 years ago

Thanks for both suggestions, yes it is only pseudo time step, and the force is defined by material function. I was thinking of changing the time step rather than changing the force increment.

rc commented 2 years ago

Note that changing the increment is definitely easier.

Amirrgrbn commented 2 years ago

Yes, seems that would be a better idea; one more thing, is there any way to calculate the force from stress vector in reverse?

rc commented 2 years ago

Yes, you would need to integrate stress * n over the surface with the normal n, see here. Essentially, dw_surface_ltr (or de_surface_ltr) should be usable (use v = 1).

Amirrgrbn commented 2 years ago

Thanks for it, Further still there is a preliminary problem in my code. In attached geometry eventhough there is no force or disp i get some value for stress. and the solution is not precise with residual of 1e-2; the mesh seems to be ok, i have done the optimization image P.s , in simple geometry the code works fine

rc commented 2 years ago

Try attaching a code + mesh demonstrating the problem.