urgent! Help! Define mass source on boundary cells used UDF
1 Attachment(s)
Hi, friends
I am using UDF to define a mass source on the boundary cells,here's my code. My case is this: particles and water flow in a pipe, and I want to define a mass source for the particle phase in the pipe wall cells. When I compile this UDF, it works normally, but the volume fraction of particles at the wall has not changed. According to my UDF, the volume fraction of the particle phase in the pipe wall cells should be reduced. I don't know where the error is, but the UDF can work well after compilation. Can anyone help me? Any suggestions will be appreciated! code: Code:
//* You are storing source in User defined memory under DEFINE_ON_DEMAND. Then you are using UDMI(c0,t0,0) in DEFINE_SOURCE *// |
"According to my UDF, the volume fraction of the particle phase in the pipe wall cells should be reduced."
I don't see that. According to your UDF, UDM 0 should be zero everywhere, except at the wall where it is one. Does that part work? Why that should mean that the volume fraction changes: that depends on how you use UDM 0... Not part of this UDF, but elsewhere in your model. |
Thanks for your suggestion, and sorry for my late reply.
"I don't see that. According to your UDF, UDM 0 should be zero everywhere, except at the wall where it is one. Does that part work?" To be honest, I want to use UDM0 to distinguish wall cells. As you just said, UDM0 is 1 in the wall cells and 0 in other cells; In this way, I can specify the source in the wall cell in the following if statement (if (C_UDMI(c, t, 0)> 0.)). Is there anything wrong with this? please give me some advice. "Why that should mean that the volume fraction changes: that depends on how you use UDM 0... Not part of this UDF, but elsewhere in your model." I'm sorry I didn't understand you. I am a UDF rookie... Do you mean there is a problem with my UDF0 usage method? Any suggestions will be appreciated. best wishes |
I hadn't noticed the second UDF.
|
you code seems to be correct,
do you see what you want, when making contour of C_UDMI_0 ? are you sure, that -1000 is value which you want? check units |
Thanks Reply! Now it works great because I forgot to load it...
|
All times are GMT -4. The time now is 10:42. |