Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

Orszag Tang in ANSYS Fluent

    • zoelle.wong
      Subscriber

      Hello!

      I want to replicate the Orszag Tang Model in ANSYS Fluent. I have flow in a 1x1x1 m box, each side with a periodic boundary condition. However, I need to prescribe initial periodic velocity and magnetic fields. 

      Is there a way to use the GUI to prescribe a periodic field profile? Alternatively, one can use a UDF however I'm struggling with identifying where to find UDF starter code for such a problem. Thank you!

    • Rob
      Forum Moderator

      In Fluent you can only have one pair of periodic boundaries, others can be symmetry or slip wall if that helps. 

    • zoelle.wong
      Subscriber

      Ok good to know

      If one were to prescribe symmetry/slip walls on the remaining faces, how can one prescribe an initial periodic velocity or magnetic field (see image of set up below). After creating a periodic boundary condition, I don't see a way to insert a velocity profile at the interface. 

    • Rob
      Forum Moderator

      You don't, you add a mass flow or dP for the zone and the solver will figure out what the profile is. It's in the Periodic options, button is in the central Task Page when you have the Boundary Conditions open. 

    • zoelle.wong
      Subscriber

      Ok. I see that you can add a constant mass flow rate or dP. I don't think adding a constant mdot or dP will result in a periodic profile which is required for the Orzag-Tang test. 

      If one cannot input a periodic profile at the peridodic BC, could one use a UDF to input a periodic magnetic and velocity field at the boundary? Is this compatible with ANSYS' backend processes?

    • Rob
      Forum Moderator

      The periodic works by mapping the "outlet" profile back to the "inlet" end, so you just initialise the flow and wait. Not sure about the magnetic field as you need to be careful with source terms etc for an "infinite" flow. 

    • zoelle.wong
      Subscriber

      Couple of follow up questions:

      Per my previous post I changed the initial and boundary conditions to be the following:

      I inputted the velocity profile via patching during initialization and cross compared the initialized flow field when using a INIT_DEFINE() UDF. When comparing the initialized velocity contour plots, they looked the same. I ran this as a transient simulation for roughly 50 timesteps, with each timestep being 1e-3 without a magnetic field, and the results looked ok. 

      However, when turning the MHD module on, initializing the MHD solver, and patching the expression for the magnetic field, the turbulent viscosity ratio is limted to 1e5. The contour plot for turbulent viscosity ratio is shown below. The mesh is a structured and isotropic. If FLUENT is limiting the turbulent viscosity, does this imply the mesh needs a higher refinement? Or is there something in the MHD module that was not turned on? Finally, is there a UDF macro one can use for initailizing a Force (e.g electric and magnetic) besides using the patching option for Bx, By etc? 

       

      Thank you so much for your time! 

       

    • zoelle.wong
      Subscriber

      Couple of follow up questions:

      Per my previous post I changed the initial and boundary conditions to be the following:

      I inputted the velocity profile via patching during initialization and cross compared the initialized flow field when using a INIT_DEFINE() UDF. When comparing the initialized velocity contour plots, they looked the same. I ran this as a transient simulation for roughly 50 timesteps, with each timestep being 1e-3 without a magnetic field, and the results looked ok. 

      However, when turning the MHD module on, initializing the MHD solver, and patching the expression for the magnetic field, the turbulent viscosity ratio is limted to 1e5. The contour plot for turbulent viscosity ratio is shown below. The mesh is a structured and isotropic. If FLUENT is limiting the turbulent viscosity, does this imply the mesh needs a higher refinement? Or is there something in the MHD module that was not turned on? Finally, is ther a UDF macro one can use for initailizing the electric and magnetic field besides using the patching option? 

       

      Thank you so much for your time!

       

    • zoelle.wong
      Subscriber

      For recording purposes and future users, I figured out the diverging turbulent viscosity ratio was due to erroneous fluid transport properties. 

      After enabling the MHD Module in ANSYS, one will need to account for the magnetic permeability and electrical conductivity in the fluid properties under "create/edit materials". For the Orszag-Tang case, these values along with viscosity need to be set to 1. Density, Ratio of Specific Heats (cp/cv) and Pressure need to be set judiciously such that the fluid's speed of sound is equal to 1.0 through the relation: c^2 = gamma*P/rho = 1 where c is the speed of sound, gamma the ratio of specific heats, P the pressure, and rho the density. More information can be found here for boundary and initial conditions.

       

       

      For the case of 1 set of periodic boundary conditions, the velocity gradient field looked like the following during initialization (when using patch utility). However, these results are still under development - note that the current results are no longer diverging. 

    • zoelle.wong
      Subscriber

      As a follow up to this discussion, I have a question regarding how ANSYS computes the speed of sound for a non-ideal gas. I'm hoping to compare Mach and velocity contour plots for literature, and I couldn't find from the manual how speed of sound is calculated for non-ideal gases. So in this case, speed of sound cannot be calculated through the relation. ..c = sqrt(gamma*R*T)

    • Rob
      Forum Moderator

      I'm not sure it is - it'll be in the Velocity reports. You may need to add in a Custom Field Function or Expression. 

Viewing 10 reply threads
  • The topic ‘Orszag Tang in ANSYS Fluent’ is closed to new replies.