## Fluids

#### DEFINE_SOURCE UDF usage requirements??

• chupacabra
Subscriber

Hey all,

My prof asked me to write a UDF for a body force term and simulate it for a flow over a flat plate at a certain location of the domain.

This code doesn't seem to have any effect on the solution.

Here are the steps I followed:

1. Interpreted the UDF
2. Hooked the UDF in the cell zone conditions as X_Momentume Source term
3. Used SIMPLE method (I am not sure if this has something to do with the solution being the same, I am a noob in this field) and nearly 6000 iterations.

After doing all these steps, there was no difference in the solution I obtained.

I am attaching the UDF below.

I begin to suspect if the solution scheme I used has to something with the working of the UDF.

• Karthik R
Hello Can you share a screenshot of the UDF instead of attaching the files to your post? Ansys employees are not able to download attachments.
What effect do you expect when you add this source term to your flat plate case? Can you please provide some more context to your question?
Karthik
• chupacabra
Subscriber
Hey Karthik, thanks for commenting.
Here is the screenshot of the UDF.

I was just trying to simulate the lift force experienced by the flat plate due to asymmetric velocity distribution above and below the plate. So, instead of diving straight into the problem, I was simulating flow over a flat plate with this UDF and tried to observe changes in the velocity field. But, no luck.
• Rob
Ansys Employee
How large is the domain, and how well resolved is the mesh? Use an adaption register to mark the cells according to the constraints in your code.
• Karthik R
Hello Just to add to 's comment - these sources are volumetric in nature. Please make sure that you are adding these right. In your UDF, you seem to be specifying a constant number of 0.02. The total volumetric integral of this force might be pretty small depending on the overall volume of your domain. Just something to ponder about.
Karthik
• chupacabra
Subscriber
The domain is 200 cm x 100 cm. There are nearly 50K elements with a good resolution near the plate.
• chupacabra
Subscriber
Thank you so much!!!!!
I just changed the CON value to 2000 and there are significant changes in the contours.
But I have one doubt left. The units of CON are N/m3 right? And if we are doing a 2D problem, Z direction is 1m by default and CON units are N/m2. Right?

• Rob
Ansys Employee
Wrong. It's still N/m3 but the third dimension is 1m when you work out the volume.
• Karthik R