We’re putting the final touches on our new badges platform. Badge issuance remains temporarily paused, but all completions are being recorded and will be fulfilled once the platform is live. Thank you for your patience.
Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

How to add additional species diffusion term in FLUENT

    • Sowmiya
      Subscriber

      I want to include additional species diffusion term through UDF in FLUENT as in formula below.

      The first term on the right can be included in mass diffusivity using DEFINE_DIFFUSIVITY macro in species transport model having unit to be (m^2/s) but the next term have unit to be (kg/m.s) how and where to include it?

    • YasserSelima
      Subscriber
      Add it as a source. When the UDF calculates term and returns it to the solver, the solver assumes it is in SI units. So, you don't have to worry about your term units as long as you know it is physically correct. n
    • Sowmiya
      Subscriber
      Hi nThanks very much for the suggestions.nOn adding it as a source term in the unit of kg/m.s will that be converted to kg/m^3.s by the solver while getting added up in species conservation equation.nnBecause I expanded each term on the right hand side of the equation with respective to four species in the unit of kg/m.s and solving it in UDS source term will that be converted to Kg/m^3.s or I have to use NV_DOT operator while solving it in UDS source term.nPlease kindly give me few suggestions to carry out my work.nAlso please correct me if I am wrongnMany Thanks in advance n n
    • Sowmiya
      Subscriber
      n
    • YasserSelima
      Subscriber
      No, the solver will understand it as generation-rate/volume. nYou have to convert it.I am not a user of species, so I can't suggest specifics here. My suggestions are general to adding term to conservative equation. Probably tomorrow one of the Ansys Experts would give you more specific advice.n
    • Sowmiya
      Subscriber
      Thanks again.nIn order to convert we found to use NV_DOT operator. But unfortunately not with more examples in UDF user manual. nWill that be justifiable to get kg/m^3 s conversion using this operator directly in UDS source term.nPlease kindly give me few suggestions in this regard.nMany thanks in advance. n
    • Sowmiya
      Subscriber

      No, the solver will understand it as generation-rate/volume. You have to convert it. I am not a user of species, so I can't suggest specifics here. My suggestions are general to adding term to conservative equation. Probably tomorrow one of the Ansys Experts would give you more specific advice./forum/discussion/comment/109668#Comment_109668

      Great and thanks for letting me know.n
    • Sowmiya
      Subscriber
      Experts please give me few suggestions to carry out my workn
    • YasserSelima
      Subscriber
      n
    • Amine Ben Hadj Ali
      Ansys Employee
      Source Terms in to mass conservation equations have the dimenion of kg/m?sn
    • Amine Ben Hadj Ali
      Ansys Employee
      NV_DOT(x,y): it does just make a dot product of vector x and vector yn
    • Amine Ben Hadj Ali
      Ansys Employee
      Perhaps you have a look into DEFINE_DIFFUSIVITY Macro and check if it is helpful for your case.n
    • Sowmiya
      Subscriber

      Source Terms in to mass conservation equations have the dimenion of kg/m³s/forum/discussion/comment/109994#Comment_109994

      Thanks very much for the suggestionsnIf we include additional species diffusion term in the source terms of mass conservation equation having the same dimension of kg/m^3.sni.e., In my problem i need to include the terms highlighted below having unit to be kg/m.s. for four species n In case if I divide it with area (m^2) , I will get the unit to be kg/m^3.sn if so by including it in source terms in mass conservation equation will it justify the inclusion of species diffusion term in species conservation equation highlighted belownPlease give me few suggestions and correct me if I am wrong.n
    • Sowmiya
      Subscriber

      Perhaps you have a look into DEFINE_DIFFUSIVITY Macro and check if it is helpful for your case./forum/discussion/comment/109996#Comment_109996

      of course,the Ds term in equation below is calculated in DEFINE_DIFFUSIVITY macro having unit to be m^2/s and included in species transport model under mass diffusivity and FLUENT will include it in species conservation equation by multiplying with density and gradient of mass fraction.nBut in second term highlighted I need to multiply the individual species density in the form of PMs/RT (instead of total density) and mass fraction of 's' species in itnI don't know how and where to include itn
    • YasserSelima
      Subscriber
      The only option to add term to a transport equation without affecting how other terms being calculated is a source term.nSo, I don't think you have other options. I know in multiphase flow, to get all these properties for different phase, you need to recall different domains and threads for every cell which is difficult to program and more difficult to optimise. Also I am not sure if this applies to species model or not.nSearch the forum, I remember there was few posts by the same person and he was defining sources for species. And actually was helping him. That is why I tagged him. n
    • Sowmiya
      Subscriber
      Again Thanks for the reply and suggestions
    • YasserSelima
      Subscriber
      here is one of his posts. Go through the rest of them n/forum/discussion/23429/defining-membrane-property-through-udf#latestn
    • YasserSelima
      Subscriber
      You are welcome!n
    • Sowmiya
      Subscriber

      Perhaps you have a look into DEFINE_DIFFUSIVITY Macro and check if it is helpful for your case./forum/discussion/comment/109996#Comment_109996

      If I use UDS diffusivity having unit to be kg/m-s in species transport model and add second term in DEFINE_DIFFUSIVITY macro and insert it in defined per uds as shown belownwill justify the addition of additional diffusion term in species conservation equation as,nPlease correct me if I am wrongnKindly let me know your thoughts on it.n
    • ChandulaW
      Subscriber
      Hi there,nHow did you get the UDS diffusivity option in the change/edit materials dialog box? It isn't appearing for me when I try and set up a battery model.nThanks,nChan. n
    • Sowmiya
      Subscriber

      Hi there,How did you get the UDS diffusivity option in the "change/edit" materials dialog box? It isn't appearing for me when I try and set up a battery model.Thanks,Chan./forum/discussion/comment/111105#Comment_111105

      Hi, nAt first you have to include the number of UDS that you are going to solve in define -> user-defined-scalars with proper functions in UDS options.nThen fluent will automatically include UDS diffusivity option in the species transport model.nHope this helps younn
    • Sowmiya
      Subscriber

      /forum/discussion/comment/109996#Comment_109996If I use UDS diffusivity having unit to be kg/m-s in species transport model and add second term in DEFINE_DIFFUSIVITY macro and insert it in defined per uds as shown belowhttps://us.v-cdn.net/6032193/uploads/7RFE1JX7R4WN/df2-jpg.jpgwill justify the addition of additional diffusion term in species conservation equation as,https://us.v-cdn.net/6032193/uploads/TWANBRP7JZVA/diffusion-term.pnghttps://us.v-cdn.net/6032193/uploads/0DI447M9DPUR/diffusion3.pngPlease correct me if I am wrongKindly let me know your thoughts on it./forum/discussion/comment/110083#Comment_110083

      Is the way of using UDS diffusivity option in species transport model will help in including additional diffusion term in species transport model ?nPlease experts correct me if I am wrongn
    • Rob
      Forum Moderator
      The UDS diffusivity is for the UDS, and not the species. If there is an influence of one over the other you'll need to write a DEFINE_DIFFUSIVITY for the species too. nDone a bit of pruning in here too as has a separate thread. n
    • Sowmiya
      Subscriber
      Hi Rob,nThanks a lot for your suggestions.nYes I have written DEFINE_DIFFUSIVITY for species too. Actually I want to add additional diffusion term which is highlighted in red below.nnThe first term will be included in mass diffusivity option by giving Ds using DEFINE_DIFFUSIVITY in species transport panel (m^2/s) where rho and gradient of mass fraction will be calculated by fluent automatically. But how and where to include the second term?nIs that using UDS DIFFUSIVITY can be used to include the additional term ? nwhere J used in species conservation equation is shown below. nn Please correct me if I am wrong.nMany thanksnn
    • Aitor
      Subscriber
      You have two options: enable species diffusion or consider a UDS instead of species diffusion. Mass diffusivity/UDS diffusivity would be equal to D_s, and the term highlighted in red could be included by means of a source term in the species conservation equation/UDS equation.nBoth methods are essentially the same, but it is easier (and, in my opinion, more reliable) to consider species diffusion. nIn any case, I would like to mention that I have been recently dealing with a similar problem as this one (species diffusion with source terms proportional to gradients and/or laplacians) and it has been a nightmare. Source terms involving derivatives are delicate.n
    • Amine Ben Hadj Ali
      Ansys Employee
      Thanks Aitor for the feedback.n
    • Amine Ben Hadj Ali
      Ansys Employee
      AS mentioned from the beginning you have two options:nn1/They was with SOURCE Terms: always conservative but delicaten2/DEFINE_DIFFUSIVITY for the Species.n
    • Sowmiya
      Subscriber
      Thanks a lot to Aitor and Dr Amine for your suggestionsnBut I am struck in including the second term as a source term, where it needs to be included as del dot diffusion term as highlighted belownAnd I could not any macro for del dot term in fluent UDF guide. Please suggest me some examples if any,n

      You have two options: enable species diffusion or consider a UDS instead of species diffusion. Mass diffusivity/UDS diffusivity would be equal to D_s, and the term highlighted in red could be included by means of a source term in the species conservation equation/UDS equation.Both methods are essentially the same, but it is easier (and, in my opinion, more reliable) to consider species diffusion. In any case, I would like to mention that I have been recently dealing with a similar problem as this one (species diffusion with source terms proportional to gradients and/or laplacians) and it has been a nightmare. Source terms involving derivatives are delicate./forum/discussion/comment/112510#Comment_112510

      n
    • Rob
      Forum Moderator
      That's the gradient, there are examples of the the macro for certain variables in the manual. n
Viewing 28 reply threads
  • The topic ‘How to add additional species diffusion term in FLUENT’ is closed to new replies.