moisture over a surface

Abbasraza20000220Abbasraza20000220 Member Posts: 59

Hi

I am here to define moisture over a surface. I am writing a UDF for this. Please help me out.

#include "udf.h"


DEFINE_PROFILE(mass,t,i)

face_t f;

cell_t c;

Thread *t;

real x[ND_ND];

real A[ND_ND],At;

real x_H2O;

begin_f_loop(f,t)

{

F_AREA(A,f,t);

At=NV_MAG(A);

F_CENTROID(x,f,t);

C_YI(c,ti);

x_H2O=C_YI(c,t,i);

}

end_f_loop(f,t)

}


I am getting segmentation fault error.


Regards,

Abbas

Comments

  • DrAmineDrAmine GermanyForum Coordinator Posts: 6,642

    What do you want to do? I do not want to comment on the UDF which is wrong and tells me that you are beginner and you need first to check the whole documentation and make some exercises.

  • Abbasraza20000220Abbasraza20000220 Member Posts: 59

    I need to introduce moisture in the cells just over the surface. I have two fluids parallel stacked to each other and a wall(coupled) between two fluids, in one fluid(Air) inlet in which i have introduced moisture content through mixture template, Now I wan this moisture on the wall (coupled wall). How I can introduce through udf which i am trying to write. and i want to know that should I have load in the udf in the wall species option?

    Please find the attached picture.


    Regards,

    Abbas

  • DrAmineDrAmine GermanyForum Coordinator Posts: 6,642

    You can add a Volumetric source term in near wall cells or provide a Flux of it. Your UDF is not correct as mentioned in top.

  • Abbasraza20000220Abbasraza20000220 Member Posts: 59

    Thanks a lot for your response. How I can add volumetric source terms in near walls? I could not be able to find in the boundary conditions.

    I rewrote a UDF. Please have a look.

    #include "udf.h"

    #define m 0.28

    DEFINE_PROFILE(mass_H2O,t,i)

    {

    face_t f;

    real x[ND_ND];

    real A[ND_ND];

    real y;

    begin_f_loop(f,t)

    {

    F_AREA(A,f,t);

    F_CENTROID(x,f,t);

    F_YI(x,f,t);

    y=m*F_YI(x,f,t);

    }

    End_f_loop(f,t)

    }


    I loaded on wall but in contours its showing nothing. but in vectors contours the mass fraction H20 of the same wall is showing. Can you explain it why its happening?

    Thanks in advance.

    Regards,

    Abbas


  • DrAmineDrAmine GermanyForum Coordinator Posts: 6,642

    Source to be provided via DEFINE_SOURCE or as result of surface reaction. What you are doing is just providing BC for species at the wall.

  • Abbasraza20000220Abbasraza20000220 Member Posts: 59

    Thanks a lot for your response.

    One more thing, when I made a UDF by using DEFINE_SOURCE. I want moisture content on the wall. For this, where I will be loading UDF? In my case, I have two inlets and two outlets of two different fluids and in between there is a sandwiched (Coupled wall). In inlets of both fluids I am introducing velocity of fluids along with temperature while both outlets are set for pressure outlets. And in this coupled wall option I have option in species where you are saying its a boundary condition. I am confused where I will introduce / define source in term of UDF.

    Please clarify me.

    Thanks in advance.

    Regards,

    Abbas

  • DrAmineDrAmine GermanyForum Coordinator Posts: 6,642

    You load the udf in cell zone and just assign the source to the near wall cells. There is no "Wall" source in Fluent. The other way could via surface reaction which can add that moisture content.

  • Abbasraza20000220Abbasraza20000220 Member Posts: 59

    Thanks a lot for your response.

    I used air zone and load the udf in species term in mass section. Now this specific UDF I want to see its contour. I select the species terms in the contours section. here there are default terms. My point is that I want to see this mass flux which i loaded in term of UDF in the contour section. The desired udf is not showing in the contour section. I hope you get my point. How I can see the contours of loaded UDF.

    Thanks in advance.

    Please see the attached screenshots.


  • DrAmineDrAmine GermanyForum Coordinator Posts: 6,642

    You can not see it. You will need to store it as Cell Memory and post-process it then in Fluent. In newer Fluent version it is somehow possible to post-process user sources.

  • Abbasraza20000220Abbasraza20000220 Member Posts: 59

    Thanks a lot sir.

    I have tried the same UDF in ANSYS 2020 R2, but unfortunately, there FLUENT Window is turning off on compiling the udf. Previously, I was doing on ANSYS 16.1 but id not face this issue.

    Can you please tell me why its happening ?on ANSYS 2020 R2?

    Furthermore, for making cell memory units, I have to use UDMI command? Please help me in this matter.

    Thanks in Advance.

    Regards,

    Abbas Raza

  • DrAmineDrAmine GermanyForum Coordinator Posts: 6,642

    No I cannot tell you what is going on. In 20R2 you might use the built-in compiler if running on Windows.

    Regarding Cell Memory: Have you looked in the Customization Manual?

  • Abbasraza20000220Abbasraza20000220 Member Posts: 59

    If I am not wrong, You are talking about UDF manual available free online? If yes, I have.

    Regards,

    Abbas Raza

  • DrAmineDrAmine GermanyForum Coordinator Posts: 6,642

    Then you will find examples and lot of instructions how to store something in a cell memory.

  • Abbasraza20000220Abbasraza20000220 Member Posts: 59

    Thanks a lot sir.

    I used this sample as given in UDF Manual. I loaded in the source term as mentioned in screenshot. Can you please help me that I have created UDM but in contour it showing nothing. Can you aid me? Where I am missing anything?

    Thanks in advance.

    Regards,

    Abbas



    #include "udf.h"

    #define C2 100.0

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

    {

    real x[ND_ND];

    real con, source;

    C_CENTROID(x,c,t);

    con = C2*0.5*C_R(c,t)*x[1];

    source = -con*fabs(C_U(c, t))*C_U(c,t);

    dS[eqn] = -2.*con*fabs(C_U(c,t));

    return source;

    }

  • RobRob UKForum Coordinator Posts: 8,371

    You've not told Fluent what to put in the UDM: it's blank.

Sign In or Register to comment.