|
[Sponsors] |
July 2, 2019, 04:15 |
Error with Velocity Profile UFD
|
#1 |
New Member
Will
Join Date: Jun 2019
Posts: 2
Rep Power: 0 |
Hello everyone,
I'm hoping someone will be able to help me with an error on my UFD. I should start by saying that I have no knowledge of C, so a coding error was going to happen. The Problem I have the geometry shown in the image below, I want an fully developed velocity profile at the inlet with an x component. The velocity components for the flow profile are shown below: u/ui = 2(1-r^2), v/ui = 0 and w/ui = 0 My Code As I said previously, I've no knowledge of C and there's an error in here somewhere. I've tried a couple of different things (including Googling), but I just can't seem to get it to work, so any help would be massively appreciated. Code:
#include "udf.r" DEFINE_PROFILE(inlet_x_velocity, thread, position) { real x[ND_ND]; /* this will hold the position vector */ real y; face_t f; r = 0.0127; /* radius in m */ begin_f_loop(f,t) { F_CENTROID(x,f,t); y = x[1]; F_PROFILE(f,t,i) = 2 * (1 - (r * r)) } end_f_loop(f,t) } Thanking you all in advance, Will |
|
July 2, 2019, 08:01 |
|
#2 | |||
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
If you try to compile this code, it does not work. You get errors. What you should do: read those errors!
The first error that I get: Quote:
OK, so I fixed that, and compiled again. Again errors: Quote:
After fixing that, I compile again, and see one error remaining: Quote:
I added the semicolon, and the compilation went perfect. So to conclude: compile, and look at the errors. You might not understand the error, but if you don't try you'll never know. |
||||
July 3, 2019, 19:37 |
|
#3 |
New Member
Will
Join Date: Jun 2019
Posts: 2
Rep Power: 0 |
Thanks pakk, that was really helpful.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Plot velocity profile along longitudinal axis of pipe | jorgelmilan | EnSight | 8 | July 7, 2018 15:30 |
[UDF] Relative coordinates in logarithmic velocity profile | cfdworker | Fluent UDF and Scheme Programming | 25 | July 13, 2017 04:44 |
InterFoam - Validation for velocity profile in simple channel | me.ouda | OpenFOAM Running, Solving & CFD | 0 | October 19, 2015 07:42 |
Logarithmic velocity profile | cfdworker | Fluent UDF and Scheme Programming | 0 | April 23, 2009 20:09 |
[boundary condition] logarithmic velocity profile | cfdworker | FLUENT | 2 | April 18, 2009 00:36 |