Help with dynamic mesh events

aCVPaCVP Member

Hello ANSYS Learning Forum,

I am working with dynamic mesh events. I have 20 predefined meshes. I need to replace the mesh and interpolate results across mesh every time step.

Let's say I have 200 time steps in total.

I do not want to have to define the dynamic mesh events 200 times, just repeat the same 20 events over and over again. How can I do this?

Please advise if possible. Thanks.

Best Answers

  • aCVPaCVP Member
    Accepted Answer

    I can't get it to work with Execute Commands, but it works if I write my event file, then copy/paste to put more events at different times, and then read it in through the events GUI. Hopefully having so many events won't be a problem, but it seems to be working for now, so I will close this ticket.


    Thanks again for all of your help!

Answers

  • DrAmineDrAmine GermanyForum Coordinator

    Does the event occur every 20 time steps? Do you want to code N Events which are similar. Event can be defined at time. Same can be done with Caclulation Activities if you know what to do.

  • aCVPaCVP Member
    edited October 14

    Thank you for your reply. To clarify: one event occurs EVERY timestep and the cycle repeats after 20 timesteps.

    Event1 - at timestep 1

    Event 2 - at timestep 2

    [...]

    Event 20 - at timestep 20

    How do I get Event 1 to happen again at timestep 21? and then Event 2 at timestep 22, etc?

  • aCVPaCVP Member

    It might be more helpful to ask: What are the TUI commands I can use to make a dynamic mesh event occur or execute?

  • RobRob UKForum Coordinator

    You may be better off defining the actions based on "crank angle" to get the cyclic behaviour - look at the options available in the GUI. Re the TUI commands, click into the TUI window and explore and/or read the TUI manual.

  • aCVPaCVP Member

    Hi and thank you for your response!

    I'm having a bit of difficulty understanding how the "crank angle" GUI can be used for this application. I need to replace an entire mesh every X time steps.

    As for the TUI commands, I do not see one for executing a dynamic mesh event. I can, however, find a TUI command for reading/writing the event file. I have provided an image of what's in the file after writing.

    Can this command be used in the Execute Commands tab under Calculation Activities in Fluent? My confusion comes from differences in syntax and if it is compatible with the Execute Commands language. Additionally, I need the event to repeat every X time steps, whereas the event in the picture below only occurs at one time.

    Any advice would be helpful - and I would be happy to provide more information if needed. Thanks in advance!



  • aCVPaCVP Member
    edited October 19

    Specifically, let's say I have the following event file:

    (

    ((active . #t) (name . "event-0") (start . 0.01) (action 16 "Y:/Desktop/EVENTS - test/ap1.msh" #t))

    ((active . #t) (name . "event-1") (start . 0.02) (action 16 "Y:/Desktop/EVENTS - test/ap2.msh" #t))

    ((active . #t) (name . "event-2") (start . 0.03) (action 16 "Y:/Desktop/EVENTS - test/ap3.msh" #t))

    )


    I need to execute this file again at 0.04s, but now the time has changed so event-0 should occur at 0.04, event-1 at 0.05, and event-2 at 0.06.


    How can I do this with Execute Commands?

  • aCVPaCVP Member

    Sorry for all the posts, I am updating as I am working through the issues and debugging.

    My question now is with syntax and executing the dynamic mesh event within a scheme file.

    Here is what I've done:

    1. Turn on dynamic mesh, and add an event through the GUI at time 0. I then write the event to a journal file. The journal file reads: ((active . #t) (name . "event-0") (start . 0.00) (action 16 "Y:/Desktop/EVENTS - test/ap1.msh" #t))
    2. Now, I want to be able to change the start time of this event. In my scheme file, can I insert a variable for time (k) into the event file command...for example (start . k)? How do I do this?
    3. If I use the code from the event journal file, do I still need dynamic mesh checked and the events checked on in the GUI? Will results be interpolated across meshes if I use the scheme route rather than the GUI? My interpretation is that the scheme file with the TUI command takes over the function of the GUI so I do not need to have dynamic mesh checked in the GUI. I am not sure if this correct, though.

    Again, thank you for your continued help.

  • RobRob UKForum Coordinator

    In the GUI we have:

    It may be easier to set up everything here and avoid the TUI.

  • aCVPaCVP Member

    With the GUI, I can set event-0, event-1, event-2 etc. at a certain time, but I need to repeat these events every X time steps.

    For example:

    Event-0 @ 0.01s = replace mesh-0 with mesh-1 (interpolate data across zones)

    Event-1 @ 0.02s = replace mesh-1 with mesh-2 (interpolate data across zones)

    Event-2 @ 0.03s = replace mesh-2 with mesh-0 (interpolate data across zones)

    and then at 0.04s I need to do Event-0 again, at 0.05s I need to do Event-1 again, and at 0.06s I need to do Event-2 again and so on. Let's say I need to do this until we reach 2s. I can manually put all these events into the GUI, but this would be hundreds of events I would have to manually type in.


    Is there an easier way to do this? Possibly with a scheme file, Execute Commands, and Calculation Activities? Alternatively, in the GUI or scheme file, is there a way to specify multiple times for an event to occur? For example, in the "At time (s)" box, is there a way to input a list of times [0.01s, 0.04s, 0.07s...etc.] so I can avoid having to make separate events for all these times because they are doing all the same action?


    Please let me know if you can. Thanks!

  • RobRob UKForum Coordinator

    Having opened the file you get when you write out an event you'll see the format. Copying the command part of the file:


    (

    ((active . #t) (name . "event-2") (start . 20.) (action 16 "D:/Scratch/pipe_r18p2.msh" #t))

    ((active . #t) (name . "event-3") (start . 30.) (action 16 "D:/Scratch/pipe2_r18p2.msh" #t))

    )


    It looks like you can generate the text file that needs reading in once with all of the commands. All you need to update is the time & filename.


  • aCVPaCVP Member

    This sounds good. I will use this. To clarify: I define event-0, event-1, and event-2 in the GUI and write the file. It will generate the code. I can then go into the text file and put different times.


    When I go to execute the code with "Execute Commands," do I still need to have the dynamic mesh events GUI checked and activated? Or is that only for generating the file initially? I am assuming not because the journal file now takes over.


    Please let me know if you can. Thanks again for all the help.

  • aCVPaCVP Member
    Accepted Answer

    I can't get it to work with Execute Commands, but it works if I write my event file, then copy/paste to put more events at different times, and then read it in through the events GUI. Hopefully having so many events won't be a problem, but it seems to be working for now, so I will close this ticket.


    Thanks again for all of your help!

Sign In or Register to comment.