Fluids

Fluids

Topics relate to Fluent, CFX, Turbogrid and more

UDM not storing correctly

    • Khodor Sleiman
      Subscriber

      Hello, 

      I am creating an SLM simulation in which I am melting powder which then resolidifies into a solid. I wrote a UDF to specify the density in powder form, liquid form, and solid form because the solid and powder are the same temperatures, so I didn't think doing a piecewise equation was wise. However, the simulation will register places that haven't melted as melted. I was wondering what is wrong with my UDF? 

    • Rob
      Forum Moderator

      To clarify. Powder is 1810kg/m3 which melts to a liquid at 2760kg/3 and then solidifies to a solid at 2704kg/m3? 

      What material sits in the gaps in the powder?

      You may need to move the UDM checks outside of the DEFINE_PROPERTY macro, and then be more careful with the IF statements. 

      What are you trying to model?

    • Khodor Sleiman
      Subscriber

      Yes, an there is supposed to be air in the gaps of the powder but for now the material is just approximated as a solid block. I am trying to simulate basalt being melted by a laser 

    • Rob
      Forum Moderator

      Sounds fun. Any links to the various ideas about melting Moon/Mars rock to 3d print buildings? 

      If you need to use air later on then you may need to be a bit careful with the multiphase models. For now, single phase with solidification/melting should be OK. So, I think my comment re splitting the code sections and being more careful with the IF statements will stand. 

      I don't know if == means a more accurate check than = but remember computers will have some numerical rounding, 0.99999999999999 and 1.000000000001 could easily creep into REAL definitions of 1.0

    • Khodor Sleiman
      Subscriber

      Yeah, that's the exact idea that I am trying to model, and I thought about using a VOF model, but my deadline is this week so I won't be able to execute that in time. 

      In the loop I am assigning 1 to C_UDMI (and I assume that it is 0 before that), and then later I verify that  C_UDMI is equal to 1, so I don't think there should be any rounding errors. If i move the UDM checks outside the DEFINE_PROPERTY macro, how should I call it within DEFINE_PROPERTY later on? 

    • Rob
      Forum Moderator

      If you didn't initialise the UDM when you initialised the model it could be anything.

      You should be able to call the UDM inside the DEFINE_PROPERTY - once set it's just a value in the cell of interest like temp(erature) is in the documentation example. 

Viewing 5 reply threads
  • The topic ‘UDM not storing correctly’ is closed to new replies.