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

imposing 'Robin' or 'Mixed' BC

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree3Likes
  • 1 Post By MASOUD
  • 2 Post By Amir

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 22, 2011, 12:46
Default imposing 'Robin' or 'Mixed' BC
  #1
Senior Member
 
MASOUD
Join Date: Mar 2009
Posts: 102
Rep Power: 17
MASOUD is on a distinguished road
Hi folks,

I've got a quick question; here it is:

How can I impose a Robin (or maybe Mixed) boundary condition in internal or external boundaries, for a gas species in?

If writing a UDF is a solution, then where can we hook it up?

Any feedback is highly appreciated.

Masoud
serene6390 likes this.
MASOUD is offline   Reply With Quote

Old   June 23, 2011, 02:53
Default
  #2
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 22
Amir is on a distinguished road
Hi,
first separate the value term from the others, write a UDF for other terms, then hook it in the value boundary condition:
e.g. u+du/dn=cte ---> u=cte-du/dn ---> .....
Amir is offline   Reply With Quote

Old   June 23, 2011, 10:28
Default
  #3
Senior Member
 
MASOUD
Join Date: Mar 2009
Posts: 102
Rep Power: 17
MASOUD is on a distinguished road
Thanks Amir.

First off, I would assume this is possible for 'external' boundaries. How about for internals?

Next, I wrote the following UDF which works fine. But as soon as I change

'0.72'

to

F_PROFILE(f,t,i)=((0.1*F_YI_G(f,t,i))+0.48);

and re-compile it, get this error:

UDFsconv.obj : error LNK2019: unresolved external symbol _F_YI_G referenced in function _AGC_MASS_TRAN
libudf.dll : fatal error LNK1120: 1 unresolved externals

Any idea why this is happening?

======

DEFINE_PROFILE(AGC_MASS_TRAN,t,i)
{
face_t f;
begin_f_loop(f,t)
{
F_PROFILE(f,t,i)=0.72;
}
end_f_loop(f,t)
}
=======
MASOUD is offline   Reply With Quote

Old   June 23, 2011, 11:25
Default
  #4
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 22
Amir is on a distinguished road
Hi,
if you mean internal walls (which need boundary conditions) it doesn't have any differences with this procedure!!
about your code, there are many problems in it, I provide a template for you; change that for your cases:
Quote:
#include "udf.h"
DEFINE_PROFILE(AGC_MASS_TRAN,t,i)
{
face_t f;
cell_t c;
Thread *t0;
begin_f_loop(f,t)
{
t0=THREAD_T0(t);
c=F_C0(f,t);
F_PROFILE(f,t,i)=((0.1*C_YI_G(c,t0,i)[0])+0.48);;
}
end_f_loop(f,t)
}
MASOUD and jyuan21 like this.
Amir is offline   Reply With Quote

Old   June 24, 2011, 00:28
Default
  #5
Senior Member
 
MASOUD
Join Date: Mar 2009
Posts: 102
Rep Power: 17
MASOUD is on a distinguished road
Thanks. But what is the purpose of

t0=THREAD_T0(t);

and

c=F_C0(f,t);
MASOUD is offline   Reply With Quote

Old   June 24, 2011, 02:56
Default
  #6
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 22
Amir is on a distinguished road
Quote:
Originally Posted by MASOUD View Post
Thanks. But what is the purpose of

t0=THREAD_T0(t);

and

c=F_C0(f,t);
As you know, some commands are not described in UDF manual; instead, you may find them in src folder, but we don't have F_YI_G(f,t,i) , at least I couldn't find that, so we have to use cell gradients instead. For more information about these functions take look at UDF manual.

Regards,

Amir
Amir is offline   Reply With Quote

Old   June 24, 2011, 13:52
Default
  #7
Senior Member
 
MASOUD
Join Date: Mar 2009
Posts: 102
Rep Power: 17
MASOUD is on a distinguished road
I can admit the fact that I'm totally confused with this feedback from Ansys customer support! Does this make sense to you at all? Here it is:

-------------------

A convective boundary condition cannot be imposed on internal or external boundary (wall boundary). For a wall either a zero diffusive flux or a constant value (which can be modified using a UDF) can be specified.

You need to use source terms on either sides of the interior surface to model the convective boundary condition.

Another note, the Robin condition might come out of the flow solution itself as the differences in concentrations between the electrode surface and bulk can drive diffusion in the domain.

DEFINE_SOURCE is hooked to the fluid zones. Inside the macro you need to check for the cells that are next to the interior boundary and impose the sources or sinks there. For the rest of the domain zero sources can be specified.

The sources should be added to one side and the negative value of it should be added to the other side to conserve mass. The unit of mass sources are in kg/m3-sec. The flux needs to be converted to that unit to be specified to the cells adjacent to the boundary.
MASOUD is offline   Reply With Quote

Old   June 24, 2011, 15:54
Default
  #8
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 22
Amir is on a distinguished road
Quote:
Originally Posted by MASOUD View Post
I can admit the fact that I'm totally confused with this feedback from Ansys customer support! Does this make sense to you at all? Here it is:

-------------------

A convective boundary condition cannot be imposed on internal or external boundary (wall boundary). For a wall either a zero diffusive flux or a constant value (which can be modified using a UDF) can be specified.

You need to use source terms on either sides of the interior surface to model the convective boundary condition.

Another note, the Robin condition might come out of the flow solution itself as the differences in concentrations between the electrode surface and bulk can drive diffusion in the domain.

DEFINE_SOURCE is hooked to the fluid zones. Inside the macro you need to check for the cells that are next to the interior boundary and impose the sources or sinks there. For the rest of the domain zero sources can be specified.

The sources should be added to one side and the negative value of it should be added to the other side to conserve mass. The unit of mass sources are in kg/m3-sec. The flux needs to be converted to that unit to be specified to the cells adjacent to the boundary.
I think that these notes generally concern about modeling convecting b.c which certainly cannot perform on walls. for example, these BCs can use for simply modeling a fan, but I believe that there is easier procedure for this purpose which is using fixed values in domain! Actually, using these procedures depends on cases' nature.
Amir is offline   Reply With Quote

Old   June 24, 2011, 16:19
Default
  #9
Senior Member
 
MASOUD
Join Date: Mar 2009
Posts: 102
Rep Power: 17
MASOUD is on a distinguished road
Well, my case is a Fuel Cell. Attached shows the geometry. The boundary which needs convective mass transfer b.c. is the interface between chanel and electrode which is highlighted.

Unfortunately, I couldn't understand from your reply that I should stick to what Ansys says, or I can use what I have been doing (specified mass fraction derived from the convective b.c.). Please clarify.
Attached Images
File Type: gif 2D fuel cell.gif (58.3 KB, 20 views)
MASOUD is offline   Reply With Quote

Old   June 24, 2011, 16:23
Default
  #10
Senior Member
 
MASOUD
Join Date: Mar 2009
Posts: 102
Rep Power: 17
MASOUD is on a distinguished road
Also, how can fixing the mass fraction turn in to convective b.c?
MASOUD is offline   Reply With Quote

Old   June 25, 2011, 08:09
Default
  #11
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 22
Amir is on a distinguished road
Hi,
Maybe it's better that you clearly specify what you you want to do (the analytic relations or governing eq.s), then I'll try to help you handling it.

PS. : fluent have some capabilities and modules in fuel cell modelling.
Amir is offline   Reply With Quote

Old   June 27, 2011, 09:24
Default
  #12
Senior Member
 
MASOUD
Join Date: Mar 2009
Posts: 102
Rep Power: 17
MASOUD is on a distinguished road
Amir,

Could you send me your email address? I'll drop you a descriptive email then.
MASOUD is offline   Reply With Quote

Old   June 27, 2011, 11:36
Default
  #13
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 22
Amir is on a distinguished road
Quote:
Originally Posted by MASOUD View Post
Amir,

Could you send me your email address? I'll drop you a descriptive email then.
you can do that in this forum; both private and E-mail massages !!!
Amir is offline   Reply With Quote

Old   October 30, 2014, 13:52
Default
  #14
New Member
 
Jing
Join Date: Feb 2013
Posts: 25
Rep Power: 13
serene6390 is on a distinguished road
Quote:
Originally Posted by Amir View Post
Hi,
if you mean internal walls (which need boundary conditions) it doesn't have any differences with this procedure!!
about your code, there are many problems in it, I provide a template for you; change that for your cases:
Can anyone tell me what does the C_YI_G mean? Is it applied to indicate the gradient of u? I'm also working on a problem with mixed boundary condition. I'm still confused after reading these.
serene6390 is offline   Reply With Quote

Old   October 30, 2014, 15:33
Default
  #15
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 22
Amir is on a distinguished road
Quote:
Originally Posted by serene6390 View Post
Can anyone tell me what does the C_YI_G mean? Is it applied to indicate the gradient of u? I'm also working on a problem with mixed boundary condition. I'm still confused after reading these.
This is gradient of species mass fraction!
Please take a look at the UDF manual for more info...

Bests,
__________________
Amir
Amir is offline   Reply With Quote

Old   March 7, 2015, 20:21
Default
  #16
New Member
 
Jing
Join Date: Feb 2013
Posts: 25
Rep Power: 13
serene6390 is on a distinguished road
Quote:
Originally Posted by Amir View Post
Hi,
if you mean internal walls (which need boundary conditions) it doesn't have any differences with this procedure!!
about your code, there are many problems in it, I provide a template for you; change that for your cases:
Hi, Amir,

I'm trying to build a mixed boundary condition for temperature profile, I used the same code you provided except changing the C_YI_G(c,t0,i) to C_T_G(c,t0),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

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
mixed inflow/outflow downstream boundary condition question peob OpenFOAM Running, Solving & CFD 3 February 3, 2017 10:54
Cluster ID's not contiguous in compute-nodes domain. ??? Shogan FLUENT 1 May 28, 2014 15:03
Possible Bug in pimpleFoam (or createPatch) (or fluent3DMeshToFoam) cfdonline2mohsen OpenFOAM 3 October 21, 2013 09:28
Mixed cell zone remeshing in FLUENT 12 ChesterP FLUENT 6 November 1, 2011 06:53
Mixed Wall Face abir FLUENT 0 December 13, 2009 12:36


All times are GMT -4. The time now is 20:21.