[MBDyn-users] Time step control and coupling to external solver

Yoann Robert yoann.robert at ec-nantes.fr
Tue Nov 22 21:36:27 CET 2016


Ankit,

as Richard said, my coupling problem was to impose the time step from a fortran-written CFD code, where the time step is adapted to the CFL number. 
I have just investigated if this problem could be solved. With this minimal example, it appears so. I haven’t had the time to go further for now (I will in a few weeks).

Richard,

I don’t know if you can control the time step with a Matlab/Octave script. I remember that there is a Python interface for the mbc library but I haven’t used it.
I will let the MBDyn developers give you a more complete answer.

Regards,

Yoann



> Le 22 nov. 2016 à 20:43, Richard Crozier <r.crozier at ed.ac.uk> a écrit :
> 
> I can't answer for Yoann, but in my case the point is that there is some other system has to be solved which cannot run at a fixed time step, but which I want to couple with my MBDyn simulation. Actually the first problem I have is that I need one initial small step, and can then probably go to larger time steps to avoid unnecessary computation.
> 
> If I had a feature request it would be to have an option for the timestep to be set externally, and a way of setting it through the mbc library, so something like:
> 
> -------------------
> 
> begin: initial value;
>    initial time: external;
>    final time: external;
> 
>    timestep: external;
> 
> end: initial value;
> 
> -------------------
> 
> and then in the MBCNodal class from mbcxx.h a methods like
> 
> SetNextTime (double time)
> 
> or maybe
> 
> SetNextTime (double dT)
> 
> and you would be able to set different times or step sizes and examine the solution with that step size before accepting the solution and moving on to the next time step.
> 
> Richard
> 
> 
> On 22/11/16 18:02, Ankit Aggarwal wrote:
>> Hi
>> 
>> I was going through the implementation of external time step in the
>> attachment.bin .
>> 
>> Can you please tell me if the writing of this Fortran file for time step
>> control can be avoided if you were able to define your time step control
>> in input file only or writing the value through socket was a necessity
>> of external simulation?
>> 
>> Ankit Aggarwal
>> 
>> On Tue, Nov 22, 2016 at 11:03 PM, Yoann Robert
>> <yoann.robert at ec-nantes.fr <mailto:yoann.robert at ec-nantes.fr>> wrote:
>> 
>>    Hi Richard,
>> 
>>    I was the one asking the question in the thread you've mentionned.
>> 
>>    Have a look atmy last reply :
>> 
>>    http://mail.mbdyn.org/pipermail/mbdyn-users/2015-February/001521.html <http://mail.mbdyn.org/pipermail/mbdyn-users/2015-February/001521.html>
>> 
>>    I gave an simple example of the coupling you're looking for.
>> 
>>    You can find the files here (originally the file was named
>>    ext_var_ts.tar.gz, so rename it like this and extract) :
>> 
>>    http://mail.mbdyn.org/pipermail/mbdyn-users/attachments/20150209/2e324539/attachment.bin
>>    <http://mail.mbdyn.org/pipermail/mbdyn-users/attachments/20150209/2e324539/attachment.bin>
>> 
>>    See the 'compile_and_run.sh' file to understand what is done.
>> 
>> 
>>    Regards,
>> 
>>    Yoann
>> 
>> 
>> 
>>    Le 22/11/2016 à 17:27, Richard Crozier a écrit :
>> 
>>        Dear List,
>> 
>>        Ihe manual describes the possibility to use the 'change'
>>        strategy for time stepping. I would like to use such a strategy
>>        with an external solver (I need small initial steps followed by
>>        larger ones), I think I could use the 'factor' method for this,
>>        but I have no way of knowing what time step is chosen by MBDyn
>>        in my external solver. Is there a way to discover this? It would
>>        be great if this information was able to be supplied by MBDyn
>>        through the mbc library, but I gather it isn't. This would be
>>        useful in general, otherwise I have to be careful about making
>>        sure the times in my external code match the times in my MBDyn
>>        input file rather than just specifying them once.
>> 
>>        I also saw a post about setting the time step from an external
>>        code using a postponed driver:
>> 
>>        http://mail.mbdyn.org/pipermail/mbdyn-users/2015-January/001518.html
>>        <http://mail.mbdyn.org/pipermail/mbdyn-users/2015-January/001518.html>
>> 
>>        Which is what I'd really like to do. I've attempted to implement
>>        this, with no luck so far, but this could just be my
>>        inexperience with sockets. Is there any full example available
>>        of doing this?
>> 
>>        I also noticed the GSoC 2016 project "Step Size Control"
>> 
>>        https://www.mbdyn.org/?News&id=28
>>        <https://www.mbdyn.org/?News&id=28>
>> 
>>        The final patch of the project is shown here:
>> 
>>        https://gist.github.com/AnkitAggarwalPEC/7f5cd8b566c935e4c312083daa0ac1bf
>>        <https://gist.github.com/AnkitAggarwalPEC/7f5cd8b566c935e4c312083daa0ac1bf>
>> 
>>        Does this offer any opportunities to help with what I'm trying
>>        to do here, and is there any example available of using the new
>>        code which I could try out? I'm happy to apply the patch and
>>        build a copy of MBDyn to try it out, but there's not much
>>        explanation of what's been changed or how one might make use of it.
>> 
>>        Regards,
>> 
>>        Richard
>> 
>> 
>> 
>>    _______________________________________________
>>    MBDyn-users mailing list
>>    MBDyn-users at mbdyn.org <mailto:MBDyn-users at mbdyn.org>
>>    https://mail.mbdyn.org/cgi-bin/mailman/listinfo/mbdyn-users
>>    <https://mail.mbdyn.org/cgi-bin/mailman/listinfo/mbdyn-users>
>> 
>> 
> 
> -- 
> The University of Edinburgh is a charitable body, registered in
> Scotland, with registration number SC005336.
> 



More information about the MBDyn-users mailing list