CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

problem with mixed/Robin boundary condition for Temperature

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 8, 2015, 14:03
Default problem with mixed/Robin boundary condition for Temperature
  #1
New Member
 
Jing
Join Date: Feb 2013
Posts: 25
Rep Power: 13
serene6390 is on a distinguished road
Hi, all

I'm trying to build a mixed boundary condition for temperature profile, the boundary condition is an expression related to both Temperature and Temperature gradient, but there's some error come out after I initialize.

My code is:
DEFINE_PROFILE(Temperature_profile,t,i)
{
face_t f;
cell_t c;
Thread*t0;
real x[ND_ND];
real y;

begin_f_loop(f,t)
{
t0=THREAD_T0(t);
c=F_C0(f,t);
F_CENTROID(x,f,t);
y=x[1];
F_PROFILE(f,t,i)=(200-20*(1-y)+C_T_G(c,t0)[0]/0.002)/(100+9.8*(1-y);
}
end_f_loop(f,t)
}

My current physical model is very simple, just a 2D rectangular area.
Thank you so much.

PS: I don't know why but the program sometimes works and sometimes not, but even if it could run successfully, the result seems not correct.

The error looks like this:
MPI Application rank 0 exited before MPI_Finalize() with status 2
The f1 process could not started
serene6390 is offline   Reply With Quote

Old   March 8, 2015, 14:46
Default
  #2
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
Here's a relevant thread and have you tried running Fluent in serial instead of parallel?
`e` is offline   Reply With Quote

Old   March 8, 2015, 15:23
Default
  #3
New Member
 
Jing
Join Date: Feb 2013
Posts: 25
Rep Power: 13
serene6390 is on a distinguished road
Quote:
Originally Posted by `e` View Post
Here's a relevant thread and have you tried running Fluent in serial instead of parallel?
Hi,

Thanks for your reply, but when I try to use serial instead of parallel, there's another error comes out:

Error: received a fatal signal (segmentation fault)
serene6390 is offline   Reply With Quote

Old   March 8, 2015, 18:20
Default
  #4
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
Have you interpreted or compiled the UDF? Try compiling the UDF.

Ensure the RHS for F_PROFILE is correct and use trailing periods to evaluate 200, etc, as real data types.

Lastly, try setting the RHS of F_PROFILE to a constant value and if this run still fails, then perhaps there's something wrong with the mesh (maybe Fluent is trying to access a cell face that doesn't exist).
`e` is offline   Reply With Quote

Old   March 8, 2015, 22:17
Default
  #5
New Member
 
Jing
Join Date: Feb 2013
Posts: 25
Rep Power: 13
serene6390 is on a distinguished road
I interpreted the UDF, is compiling going to make a difference?
I'm thinking the error might caused by the index, do you think it's correct that on the LHS I have F_PROFILE(f,t,i) and on the RHS I have C_T_G(c,to)[0]?

Thank you.
serene6390 is offline   Reply With Quote

Old   March 8, 2015, 23:04
Default
  #6
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
When troubleshooting code it's important to first isolate what the problem exactly; you can achieve this task by building the program step by step (or removing/simplifying your code step by step). I've suggested a method of trying to isolate the problem code above.
`e` is offline   Reply With Quote

Old   March 8, 2015, 23:19
Default
  #7
New Member
 
Jing
Join Date: Feb 2013
Posts: 25
Rep Power: 13
serene6390 is on a distinguished road
Sorry that I didn't mention that I've tried setting the RHS as constant and it works. I also tried making the RHS as 1-y, it also works well.
serene6390 is offline   Reply With Quote

Old   March 8, 2015, 23:26
Default
  #8
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
It appears that gradient data may or may not be defined in the first iteration according to HenrikS in this post (try his suggestion).
`e` is offline   Reply With Quote

Reply

Tags
gradient, mixed boundary condition, temperature profile, udf


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Low Mixing time Problem Mavier CFX 5 April 29, 2013 00:00
CFX fails to calculate a diffuser pipe flow shenying0710 CFX 7 March 26, 2013 04:13
problem about periodic boundary condition in Fluent winnawinna FLUENT 0 December 28, 2010 23:32
How to use a solution as an inlet boundary condition in another problem in fluent geryes FLUENT 0 February 25, 2010 16:32
a problem with Boundary condition M Rad Main CFD Forum 12 November 27, 1998 12:49


All times are GMT -4. The time now is 15:36.