Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

Modelling porous material

    • Jai
      Subscriber
      HellonI am currently doing a project on metal foam - phase change material system. Any guide to designing a porous material in phase change material will be very appreciated. nThank you,
    • Karthik Remella
      Administrator
      Hello,nThere are no limitations on using the porous media with the solidification and melting model is Ansys Fluent. You should be able to set-up your problem without any issues. nThere is an example on how to set-up a solidification model in the Fluent tutorial on Ansys help. Please look into Chapter 21. Here is the link. Look into Fluent Tutorials.nKarthikn
    • Jai
      Subscriber
      Thank You Kremella.nCan you suggest any guide in designing heat pipe? nThank You,nJain
    • Rob
      Forum Moderator
      Have a look at the Corey model, but you may find you need UDFs to handle the wicking effect. n
    • Jai
      Subscriber
      Thank You.nn
    • Jai
      Subscriber
      Hi,nI'm facing some problems in assigning both metal foam and pcm in a 2D model.nHow to assign two different materials in the same area and mesh it?nCan I add the function of source term for materials using function?nHow to assign interfacial heat transfer coefficient between both? nThank Younn
    • Rob
      Forum Moderator
      The PCM is the fluid, and the metal foam is assigned as the material solid in the porous media panel. n
    • Jai
      Subscriber
      Thank you Rob, I manage to model MF-PCM model using porous media non equilibrium thermal approach in FLUENT and wickless HP using Corey Method (Eulerian Multiphase). Can you guide me on how to combine both the system together. I tried modelling both together but I cant access both melting & solidification modelling and multiphase modelling at once. Thank You.n
    • Rob
      Forum Moderator
      If the porous foam remains as a solid then the fluid phase should allow the solidification/melting model. Check in the limitations to make sure you're not falling foul of one of those. n
    • Jai
      Subscriber
      Hi Rob,nI manage to model porous zone for metal foam pcm using melting/ solidification modeling and heat pipe using Eulerian Multiphase (Corey Method) in cell zone boundary separately. However when I designed the system with both Heat Pipe and Metal foam-PCM together and I couldn't choose both melting & solidification modeling and multiphase modelling at once. Please advise me on how to proceed.n Thank You,nJainn
    • Robbie Crosby
      Subscriber
      Hi, Did you manage to do this?
    • Rob
      Forum Moderator

      Heat pipes tend not to get warm enough to melt the metal foam. You may need to explain what you're after in more detail. 

      • Robbie Crosby
        Subscriber

        Hi Rob,

        I am just facing some difficulties in understanding for my model what equations ANSYS Fluent natively follows, and what ones would require a UDF, specifically for the S F and Sl terms in the above equations. Are these added as source terms. Thank you

    • Rob
      Forum Moderator

      They should be covered in the Theory Guide. Single letter terms like that tend to be built in Fluent source terms from other models: I don't know the specifics from the equations shown. 

    • Robbie Crosby
      Subscriber

       

      Hi Rob, yes thank you for the continuity equilibrium it has the energy source term. So this is just calculated in the model and no manual source term UDF is required?

      Added to this, I cant find anything in the theory guide about the S term in the energy equation, for the definition I am after, which is seen below. In this equation Lambda is used instead of Beta for the liquid fraction value. Will this therefore need a UDF and to be added as an energy source term in the porous properties. Thank you

    • Rob
      Forum Moderator

      If you're wanting to add something to the zone you may need a UDF, otherwise Fluent should take care of all the heat transfer from fluid to solid or vice-versa. 

    • Robbie Crosby
      Subscriber

      Thank you Rob, I am modelling Paraffin wax in a porous carbonous structure. Is the paraffin wax what you mean by adding something to the zone, or should I be fine with fluent natively taking care of all the heat transfer, thank you

    • Rob
      Forum Moderator

      You need to set the fluid materials. Is the wax melting, and does the wax fill the whole domain? Ie is the wax in a sealed volume or will it drip out?

    • Robbie Crosby
      Subscriber

      Hi Sir, yes the wax will melt and fill the whole domain within the porous structure.

    • Rob
      Forum Moderator

      And the porous media is the whole domain?  Have a look at solidification and melting too. You will need to check it's compatible with non-equilibrium porous media though if you want that.  

    • Robbie Crosby
      Subscriber

      Thank you sir, yes it is a basic model of the porous material filled with paraffix wax that will melt and solidify. It has 5 adiabatic walls and one constant temperature wall to see how the liquid fraction changes over time. I am trying to compare it to an experiment but I am unable to currently get matching results. I am able to have solidifaction and melting enabled.

    • Rob
      Forum Moderator

      OK, so single phase too - that's the bit I was checking. I assume the liquid paraffin has Bousinesq density? And that gravity is on? 

    • Robbie Crosby
      Subscriber

      Yes sir, Thank you. Bousinesq density is set and gravity is on. I believe my confusion is from the paper which has modelled this from 2019 mentions UDFs being required but doesnt explicitly say what ones. Is it possible that due to updates in ANSYS Fluents UDFs are no longer required?

    • Rob
      Forum Moderator

      More likely they added "something" to the model. Without knowing all of the details I can't comment, and if I know all of the details I am probably not allowed to comment! 

      • Robbie Crosby
        Subscriber

        Hi Rob, I completely understand that. Thank you for all your help so far. Would you be able to help with my code for an individual UDF for this energy source above. I have been stuck on this for the past week, and tried multiple methods but to no avail, with ANSYS crashing each time I run this as an energy source term in the porous material. 

        I have attached the equation I am modelling for reference.

         

        #include "udf.h"


         

        #define Tsolidus 300.0

        #define Tliquidus 304.0

        #define L_f 250 //Latent heat of fusion


         

        #define UDM_RHO_F_PREV 0  // UDM index for storing previous rho_f

        #define UDM_LAMBDA_PREV 1  // UDM index for storing previous lambda


         

        DEFINE_EXECUTE_ON_LOADING(init_values, udf_name)

        {

            Thread *t;

            cell_t c;

            Domain *d = Get_Domain(1); // Get domain using Fluent API, assuming single-phase flow

           

            /* Loop over all cells to initialize UDM values */

            thread_loop_c(t, d)

            {

                begin_c_loop_all(c, t)

                {

                    C_UDMI(c,t,UDM_RHO_F_PREV) = 1000.0;  //initializing previous rho_f

                    C_UDMI(c,t,UDM_LAMBDA_PREV) = 0.0;  //initializing previous lambda

                }

                end_c_loop_all(c, t)

            }

        }


         

        DEFINE_SOURCE(energy_sourceN, c, t, dS, eqn)

        {

          real lambda, lambda_prev, V[ND_ND], rho_f, Sl, d_lambda_dt, grad_lambda_dot_V, T, rho_f_prev;

         

          T = C_T(c, t);

          rho_f = C_R(c, t);

          C_CENTROID(V, c, t);

         

          rho_f_prev = C_UDMI(c, t, UDM_RHO_F_PREV);  // Fetch the previous value of rho_f from UDM

          lambda_prev = C_UDMI(c, t, UDM_LAMBDA_PREV);  // Fetch the previous value of lambda from UDM


         

          // Calculate lambda

          if (T < Tsolidus)

            lambda = 0.0;

          else if (T > Tliquidus)

            lambda = 1.0;

          else

            lambda = (T - Tsolidus) / (Tliquidus - Tsolidus);


         

          // Calculate d(lambda*rho_f*L_f)/dt

          d_lambda_dt = ((rho_f * lambda * L_f * 0.85) - (rho_f_prev * lambda_prev * L_f * 0.85)) / CURRENT_TIMESTEP;


         

          // The gradient calculation requires more attention. Below is just a placeholder, and you need to implement the correct gradient calculation.

          grad_lambda_dot_V = (C_R_G(c,t)[0] * V[0] + C_R_G(c,t)[1] * V[1]) * lambda * L_f;


         

          Sl = d_lambda_dt + grad_lambda_dot_V;


         

          dS[eqn] = 0; // Adjust the source term linearization if necessary


         

          // Store the current time step values of rho_f and lambda to UDM

          C_UDMI(c, t, UDM_RHO_F_PREV) = rho_f;

          C_UDMI(c, t, UDM_LAMBDA_PREV) = lambda;


         

          return Sl;

        }

    • Rob
      Forum Moderator

      What errors are you seeing? Remove sections of code until it works, ie set any/all values as constants & test, then one equation at a time. 

      Common mistake - did you assign UDM in the solver?

    • Robbie Crosby
      Subscriber

      Hi Rob, I am getting the error "999999: mpt_accept: error: accept failed: no such file or directory" before crashing. To assign UDM in the solver is that simply increasing the UDM locations to 2, or are more steps required than this. Sorry

    • Rob
      Forum Moderator

      No, that's all that's needed.  

      Turn off the execute on loading and see what happens. Then manually initialise the UDM, slowly work though. 

Viewing 25 reply threads
  • The topic ‘Modelling porous material’ is closed to new replies.