CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   Flux of UDS (https://www.cfd-online.com/Forums/fluent-udf/226328-flux-uds.html)

PierceH April 23, 2020 15:47

Flux of UDS
 
I have created a UDS which runs nicely, however I want to specify the flux at the walls of the aircraft wing to be the same as pressure flux. I used the following code:


DEFINE_PROFILE(UDSP, t, i)
{
real x[ND_ND]; /* this will hold the position vector */
real y, h;
face_t f;
real A[ND_ND];

begin_f_loop(f,t)
{
F_CENTROID(x, f, t);
F_AREA(A,f,t);
F_PROFILE(f, t, i) = A[0]*C_P_G(f,t)[0]+A[1]*C_P_G(f,t)[1]+A[2]*C_P_G(f,t)[2];
}
end_f_loop(f, t)
}



however I keep getting an error. Any help would be appreciated

vinerm April 23, 2020 15:56

Error
 
What error do you get? If it's related to segmentation violation, then that's because pressure gradient is unavailable. You need to issue following command

sol set exp

And then answer yes to the question regarding keeping the memory from being freed.

PierceH April 23, 2020 17:44

Quote:

Originally Posted by vinerm (Post 767084)
What error do you get? If it's related to segmentation violation, then that's because pressure gradient is unavailable. You need to issue following command

sol set exp

And then answer yes to the question regarding keeping the memory from being freed.




As soon as I choose it as the flux BC and select okay I receive the following error



Node 0: Process 28373: Received signal SIGSEGV.

vinerm April 24, 2020 03:44

Segmentation Violation
 
SIGSEGV implies segmentation violation. Most likely, pressure gradient is unavailable. The solution was mentioned in the previous post.

PierceH April 24, 2020 14:56

I appreciate the suggestion but still no success! The same error persists

vinerm April 24, 2020 15:32

Gradient
 
I just noticed the bug. You are using C_P_G with f as its argument. That won't work. You have to use it like as follows

cell_t c;
Thread *ct;

ct = THREAD_T0(t);

And within the loop

c = F_C0(f, t);
C_P_G(c, ct)[0];

Chris2337 April 30, 2020 01:25

Watch your task manager when you do it, do you run out of RAM?


All times are GMT -4. The time now is 07:32.