Stirling motor CFD simulation

MiguelGuerraMiguelGuerra Member Posts: 4

Hello everybody,

I am trying to study the behaviour of the air inside a stirling engine but I'm having some struggles with fluent. I have already checked some discussions in this forum that helped me but I still have some questions.

This stirling motor has two pistons, these two pistons have a swinging movement, when one piston is moving to top dead center, the other is moving to bottom dead center and are both connected with a pipe. So I know that I have to use UDF for simulating the movement and also moving mesh, the question here is: I have to use two different UDF files?, one for each piston? Is it possible to use just one UDF file that could coordinate the pistons' movement? Also, it is a 3D simulation, will the UDF file work for all the faces of the piston inside the cylinder?

Also, the pistons and the pipe are three diferent files that I desgined and later put it together in assembly, so how should I put the boundary conditions at the extremes of the pipe and the inlet/oulet of the pistons? Because it is a compact motor, there aren't any inlet or outlet with the exterior, it is always the same air moving inside.

I insert some images so you can see the geometry.

Please could you give me any advide or some help?

Thanks for your attention.


Best Answers

  • RobRob UKForum Coordinator Posts: 8,371
    Accepted Answer

    You'll need two DEFINE_whatever-motion sections but they can be defined in one UDF file.

    For a sealed system (no inlet or outlet) you will need to carefully initialise the temperature & pressure in each fluid volume. That defines the mass of fluid in the domain.

  • RobRob UKForum Coordinator Posts: 8,371
    Accepted Answer

    It could be, what happens when you compile? Use the included compiler in 2020R2 as it saves all the faffing with Microsoft.

Answers

  • RobRob UKForum Coordinator Posts: 8,371
    Accepted Answer

    You'll need two DEFINE_whatever-motion sections but they can be defined in one UDF file.

    For a sealed system (no inlet or outlet) you will need to carefully initialise the temperature & pressure in each fluid volume. That defines the mass of fluid in the domain.

  • MiguelGuerraMiguelGuerra Member Posts: 4

    Hi Rob, thank you very much for your answer, it really helped me but I'm having problems with the motion. I interpreted the UDF file and it went good, but when I create the dynamic mesh zone for the piston inside (rigid body, and cg macro in the Motion UDF/Profile) I get this warning:

    Warning: incorrect cg motion UDF desplazador400_prueba1 on zone 6 (assuming no motion)

    And when I run the simulation the piston doesn't move, nothing moves.

    Is this and error of my udf or and error with the boundary conditions and dynamic mesh?

    Here I leave you the code if anyone see any error:

    #include "udf.h"

    #include "dynamesh_tools.h"

    #include "unsteady.h"

    DEFINE_CG_MOTION(desplazador400_prueba1, dt, vel, omega, time, dtime)

    {

    real A= 0.013;

    real H= 6.666667;

    real angular= 2. * 3.14159265 * H;

    real v;


    NV_S (vel, =, 0.0);

    NV_S (omega, =, 0.0);

    v = -1*A*angular*sin(angular*time);

    vel[0]= v;

    Thanks for your attention.

  • MiguelGuerraMiguelGuerra Member Posts: 4

    Sorry, I have reread the UDF Fluent Manual and I have noticed that in the  DEFINE CG MOTION description it says: "Note that UDFs that are defined using DEFINE CG MOTION can only be executed as compiled UDFs". I did not compiled the code, I used the "Interpreted" function, may this be the error why I get the "assuming no motion" problem?

    Thanks for you attention.

  • RobRob UKForum Coordinator Posts: 8,371
    Accepted Answer

    It could be, what happens when you compile? Use the included compiler in 2020R2 as it saves all the faffing with Microsoft.

  • MiguelGuerraMiguelGuerra Member Posts: 4

    Hi Rob, I had some problems with "nmake" or something like that and later the library didn´t create. But I searched this errors and read some posts in this forum and after rewrite the code and solve these errors I could compile the code and the two pistons move correctly. Now I have to try to make the sealed system as you told.

    Thank you very much for your attention and your help.

    If I have any problem with the sealed system I will ask around here I guess.

    Also, I would like to read and learn something about the dynamic mesh methods, how they work and how should I use them, do you know where can I search for it?

    See you.

  • RobRob UKForum Coordinator Posts: 8,371

    nmake tends to be the compiler not being installed/set up, we'd usually get a load of other errors if the code is wrong. Having said that, if the code is grammatically correct then you can get some odd errors if it's not using syntax that Fluent is expecting.

    The dynamic mesh methods are covered in the documentation (manuals, videos & tutorials) and in (paid for) courses that we offer. Try the former first as they're free.

  • YasserSelimaYasserSelima Member Posts: 417

    Nice work. But why are you forcing the pistons to move? Shouldn't the pistons move under the gas pressure?

    You can modify your CG_MOTION and calculate the forces on the pistons, then apply the equation of motion.

    You can calculate the force using a function Compute_Force_And_Moment(d, t_object, cg, force, moment, TRUE) , or you can integrate the pressure on the piston area .. there is a similar example in the UDF manual. I am just throwing my idea, Good Luck!

Sign In or Register to comment.