Fluids

Fluids

Source Terms

    • isaps1860
      Subscriber

      Is it possible to multiply one source term in another source term? (simple example below)

      mass1 doesn´t work...

      Or more detailed, is it possible to refer in one source term to a source term which was defined before?


    • Karthik R
      Administrator
      Yes, you should be able to do that. But, please store the value of the source in UDMI's and then use these UDMI's for all the subsequent operations (multiplication or division). nPlease take a look at the following section: 2.3.42.4. Example 2 - Degassing Boundary Condition (Fluent Customization Manual)nI hope this helps.nThanks.nKarthikn
    • isaps1860
      Subscriber
      Dear Kremalla,nthanks a lot for your help and your response. nBut unfortunately the second source term (mass1) also does not work with UDMI?s...nWith best regardsnisaps1860n
    • DrAmine
      Ansys Employee
      How are you hooking the sources? HOW are the UDF now looking? about using Fluent expressions?n
    • isaps1860
      Subscriber
      Hello DrAmine,nfirst step I do, is to set the Number of User-Defined Memory Locations to 1.nAfter that, the compiling of the UDF occurs.nThe messages I get from the UDF say that C_UDMI(c,t,0) = 1,nbut fot the second source term the cells of C_UDMI2(c,t,0)=0. So the Values of C_UDMI(c,t,0) doesn´t get transfered to the second DEFINE_SOURCE macro.nWith best regards nisaps1860nn
    • DrAmine
      Ansys Employee
      Because you need two UDMI's: You have only one and it has the value of source 1. It will return the same value in the second UDF.n
    • isaps1860
      Subscriber
      Dear DrAmine,nthank you for your answer. But I don´t understand it exactly.nMy wish for the second UDF is to return the same value like in source1. In the example above, the value 1 and then multiplicate this value.nI don´t know why this values don´t get transferred and also have no idea in which way a second UDMI can solve it...sorry for thatnBest regardsnisaps1860nn
    • DrAmine
      Ansys Employee
      Yes because your are printing a message for UDMI-0 which has the value of 1. You won't see any changes. You should rather printe source2 or assign source 2 to a second UDMI.nAnother point: are you assigning the UDF's to the same same cell zone? If yes it should work if no, it won't work.nBy the way why using an UDF for this simple task. Rely on Expressions in Fluent.n
    • isaps1860
      Subscriber
      Thanks one more time for your respond DrAmine.nI think the point of different cell zones is the problem. The second source term is for an other cell zone than the first one. So for this setup it isn?t possible to rely on another source term?nAn UDF is necessary for the terms I want to handle, the example I printed here is only a simplification.n
    • Rob
      Ansys Employee
      Correct as the first source term hasn't been defined for the second cell zone. In your example use source2 = 0.5*y * 2 rather than reference the other function. If the overall model is more complex review the use of Functions as that may simplify the code. n
    • isaps1860
      Subscriber
      Alright Rob, thanks for the help.nThe overall model should describe a source term for the second source term (second zone) which is depending on the not constant first source term. So the strategy with different source terms will not be promising, when the terms aren?t defined in the different zones...pitynBest regardsnisaps1860nn
    • DrAmine
      Ansys Employee
      Can you describe what you want to do? n
    • isaps1860
      Subscriber
      I want to describe the filter efficiency with the help of a UDF. So the different zones together represent the filter.nLet´s say the first zone has an efficiency of 50% and 100g/h oil gets into the whole filter, the source term for the first zone corresponds 50 g/h (units for source terms disregarded).nNow the second source term needs the information of the first source term how much oil is captured in the first zone, and so on and on. But this efficiency changes with time because of different saturations, velocities etc. So the information of the first source term isn´t constant.
    • Rob
      Ansys Employee
      Does the second filter need to know the amount removed by the first filter? If separation efficiency is related to the saturation etc those values can be taken from the solution to determine what's removed in the second filter. You'll need to work out how to track the filter saturation, I'd suggest reading up on scalars. n
    • isaps1860
      Subscriber
      Yes, the second zone needs to know that.nThank you for your suggestion, i will read it.nOne more question I?ve got. Would it be possible to set a flux over a interior boundary in relation to a flux before?nSo to speak, as a substitution for the source terms.n
    • Rob
      Ansys Employee
      Not really, as the flux is determined by the rest of the flow, in essence you'd be forcing a solution. n
Viewing 15 reply threads
  • You must be logged in to reply to this topic.