## Fluids

#### UDF problem—the expected wall controlled by an external force do not move

• Excited
Subscriber

Background:

Hello everyone:

I have encountered a problem when I was trying to use UDF to impose a force on the target wall to make it move along y axis, which is shown in Figure 1, Actually, the case is to simulate process of piston compression.

Since the force consists of a number of points which are shown in Figure 2, I cannot use a function to describe them, thus, first, I need to read them in UDF, and then set them as the force input, my UDF code is presented in Figure 3 and also uploaded as an attachment.

The question is:

During previewing mesh motion, the expected moving wall had no action at all, in my opinion, there must be something wrong with my code, but I am not sure, if it is so, how to fix this bug?

Regards,

Excited

• Karthik R
Hello,nInstead of a UDF, you should be able to use a profile file to describe the motion of this wall. Have you tried this?nKarthikn
• YasserSelima
Subscriber
Hello,nI agree with that you are able to do this motion from the boundary condition. You just need to convert your force table into velocity table. Also as you have a clear sine wave, you don't need to use the table, just use an equation.nHowever, your UDF should still work and I can't recognise an obvious mistake. My question is, how did you find out it is not moving? you will not actually see the wall motion but you can simply monitor the velocity at the wall and see if it oscillates as intended or notnYasser n
• Excited
Subscriber
Hi, thx for your reply, actually, I considered converting force into velocity by equation v = v0 + a*dt, and then adopting profile to realize this motion, however, I think this method will bring some error(in other words, I want to get an fully accurate result), furthermore, I also want to make a comparison between this two method, thus, I need to get this skill. Besides, for profile method, I knew it can describe the relationship between time-velocity, time-temperature, time-omega, but I am not sure whether it includes time-force or time-pressure ?(cause I have never seen this so far)nRegardsn
• Excited
Subscriber
Hi, , thx for your reply, actually, I considered converting force into velocity by equation v = v0 + a*dt, and then adopting profile to realize this motion, however, I think this method will bring some error(in other words, I want to get an fully accurate result), furthermore, I also want to make a comparison between this two method, thus, I need to get this skill. And in some cases, the force cannot be expressed by function, it consists of a number of points.nFor your question, in previewing mesh motion, once I have finished the dynamic mesh settings, if the UDF or Profile is correct, I can preview the motion of assigned moving wall.nRegardsnn
• YasserSelima
Subscriber
Not in your case .. in your case, the wall is moving parallel to the domain. So, what will the solver do is to give the same velocity for the fluid at the wall, No slip condition. So, you can actually test if it is working or not by monitoring the fluid velocity near the wall and it should have oscillating velocity similar to the force with a time lag.nnRegarding converting the force into velocity, the results will be more accurate only in one case; if you want to consider the fluid forces on the wall ... SDOF_PROPERTIES will take this into consideration. n