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

UDS boundary conditions

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 19, 2020, 00:00
Default UDS boundary conditions
  #1
New Member
 
Guan-Bang Wang
Join Date: Apr 2018
Posts: 14
Rep Power: 8
coewgb is on a distinguished road
Hi,
I am simulating the convective cooling of a solid with species transport (in both of fluid and solid). I originally thought the species transport in solid (i.e., diffusion) could be solved like thermal conduction. However, I did not find the setting of the diffusivity for the solid zone. I guess, in FLUENT, the species transport is related with fluid flow and cannot be used for solid zone. Is it right?

Consequently, I used UDS equations to solve the species transport, but now I have a problem in setting the conjugate wall boundary. The (UDS) diffusivity at the solid surface with a specific thickness is different from that set for the solid zone, so I wonder if this can be set just like shell conduction for thermal boundary setting? In other words, as the shell conduction is just on the sheet for thermal boundary setting, can I activate this for UDS "shell diffusion" with specified shell material?

Thanks.
coewgb is offline   Reply With Quote

Old   April 20, 2020, 03:42
Default Shell
  #2
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 36
vinerm will become famous soon enough
That's not possible for UDS. As you might have observed, the thickness panel appears only for thermal boundary condition. If energy is not enabled, then there won't be any option to apply thickness. So, either you can solve a 1-D diffusion equation yourself or use Temperature field as species field. But if you are already using Temperature as temperature, then this option is not available.

Yes, your understanding is correct that Fluent solves species only inside fluid zone. So, another alternative is to consider solid zone as fluid with fixed velocity of 0. The problem of solid-liquid interface can be solved by converting interior into wall shadow pairs.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   April 20, 2020, 04:46
Default User defined conjugate boundary
  #3
New Member
 
Guan-Bang Wang
Join Date: Apr 2018
Posts: 14
Rep Power: 8
coewgb is on a distinguished road
Thanks for your reply. I indeed considered the solid zone as fluid to use the species transport in FLUENT, but the wall boundary for species is either specified value or zero diffusive flux. So, the conjugate wall boundary is hard to be applied. The only way is to use DEFINE_PROFILE to define a specified value according to the conjugate boundary equation. I also have tried this method as follows, but the solution is hardly converged because of the user defined boundary conditions. The following is used to define the specified value on the side of the fluid zone, and the calculation is similar for solid zone. What is the problem of such definition of the conjugate boundary?

begin_f_loop(f,t)
{
c0 = F_C0(f,t);
t0 = F_C0_THREAD(f,t);
c1 = F_C1(f,t);
t1 = F_C1_THREAD(f,t);
F_AREA(A, f, t);

NV_DS(gra, =, C_DIFF_EFF(c1,t1,0)*C_R(c1,t1)*C_YI_G(c1,t1,0)[0]+soliddiff*solidrho*C_YI_G(c0,t0,0)[0], C_DIFF_EFF(c1,t1,0)*C_R(c1,t1)*C_YI_G(c1,t1,0)[1]+soliddiff*solidrho*C_YI_G(c0,t0,0)[1], C_DIFF_EFF(c1,t1,0)*C_R(c1,t1)*C_YI_G(c1,t1,0)[2]+soliddiff*solidrho*C_YI_G(c0,t0,0)[2], *, 0.5);//average of the gradient term on the two sides of the boundary
F_PROFILE(f,t,i) = ((NV_DOT(gra, A)/NV_MAG(A))*(thickness/surfacediff)+soliddiff*solidrho*C_YI(c0,t0,0))/C_R(c1,t1);//the value on the side of the fluid zone
}
end_f_loop(f,t)

I have also tried to use UDS for species transport and considered the solid zone as fluid. In this case, the conjugate boundary may be defined by Specified flux, and I do not have to calculate the gradient. The calculation is just as follows. However, the solution is still not converged.

F_PROFILE(f,t,i) = (surfacediff/thickness)*(C_R(c1,t1)*C_DIFF_EFF(c1,t1,0)*C_UDSI( c1,t1,0)-soliddiff*solidrho*C_UDSI(c0,t0,0));//UDS0 is for species0

All in all, the problem now becomes how to define a conjugate boundary using specifed flux (or specified value)?

Look forward to your reply. Many thanks.
coewgb is offline   Reply With Quote

Old   April 20, 2020, 05:48
Default Flux Conservation
  #4
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 36
vinerm will become famous soon enough
The appropriate condition is conservation of flux. So, you have to apply profile on both sides as flux. If you comfortable with UDFs, then use Profile within Fluent to modify and apply. By Profile I mean Profile structure defined inside Fluent. You can access it by name and change its contents within a UDF. Same profile can stay hooked to both boundaries while you keep on changing its contents using, say, DEFINE_ADJUST macro.

Code:
struct thread_profile_struct
{
#if FIXED_PROFILE_NAME_LENGTH
  char profile_name[PROFILE_NAME_LENGTH]; /* name of profile */
  char field_name[PROFILE_NAME_LENGTH]; /* name of data section */
#else
  char *profile_name;
  char *field_name;
#endif
  cxboolean profilep;   /* profile in use? */
  int position;     /* profile number. 0 = SV_PROFILE_0, etc. */
  Svar nv;
  real constant;    /* constant value */
  int timestamp;
  /* for equation sources or fixed value profiles this boolean
     indicates whether the variable has a source or fixed value specified */
  cxboolean active;
};
typedef struct thread_profile_struct Profile;
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   April 21, 2020, 06:02
Default Profile structure
  #5
New Member
 
Guan-Bang Wang
Join Date: Apr 2018
Posts: 14
Rep Power: 8
coewgb is on a distinguished road
Dear Vinerm,
Thanks for your reply with a new idea for applying such boundary conditions. Yes, I am relatively familiar with the use of UDF, so I previously tried to apply the boundary conditions by DEFINE_PROFILE macro in UDF. However, I did not know about the Profile structure you mentioned. After preliminary learning about Profile defined in FLUENT, I find out that it is defined in a Profile file by writing from the calculation results and can be read for another calculation.

I have not found anything about the use of Profile structure for applying the boundary conditions according to an equation rather than the calculation results. In my case, boundary conditions should be defined prior to the calculation process. Maybe you mean that initial values can be given for such boundary conditions and then use DEFINE_ADJUST macro to do the iterative calculation. Could you please provide an example or detailed instruction about the use of the Profile structure and the code for such purpose?

Thank you.
coewgb is offline   Reply With Quote

Old   April 21, 2020, 07:00
Default Use of Profile
  #6
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 36
vinerm will become famous soon enough
You may not find an example for this. This is undocumented, hence, would be difficult to find an example even on Ansys customer portal. I used it about 15 years ago. I am not very sure if I can still find it somewhere. But use of this structure will require you to have an existing profile at the boundary. If you have access to Ansys Portal, they do have a UDF that is meant for the purpose of extracting UDS flux at the wall. You can use that and apply the flux on both sides. You can also use a thin wall formulation within the code to include the effect of thin wall.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   April 25, 2020, 04:33
Default Thanks
  #7
New Member
 
Guan-Bang Wang
Join Date: Apr 2018
Posts: 14
Rep Power: 8
coewgb is on a distinguished road
Hi, vinerm
Thanks a lot for your continuous help. Unfortunately, I do not have the access to Ansys customer portal. I will try to find it elsewhere. I will also appreciate it if you could provide further help at your convenience.

Best regards
coewgb is offline   Reply With Quote

Old   August 1, 2022, 07:56
Default
  #8
Member
 
sina
Join Date: Nov 2021
Posts: 41
Rep Power: 4
sina_sls is on a distinguished road
Quote:
Originally Posted by vinerm View Post
The appropriate condition is conservation of flux. So, you have to apply profile on both sides as flux. If you comfortable with UDFs, then use Profile within Fluent to modify and apply. By Profile I mean Profile structure defined inside Fluent. You can access it by name and change its contents within a UDF. Same profile can stay hooked to both boundaries while you keep on changing its contents using, say, DEFINE_ADJUST macro.

Code:
struct thread_profile_struct
{
#if FIXED_PROFILE_NAME_LENGTH
  char profile_name[PROFILE_NAME_LENGTH]; /* name of profile */
  char field_name[PROFILE_NAME_LENGTH]; /* name of data section */
#else
  char *profile_name;
  char *field_name;
#endif
  cxboolean profilep;   /* profile in use? */
  int position;     /* profile number. 0 = SV_PROFILE_0, etc. */
  Svar nv;
  real constant;    /* constant value */
  int timestamp;
  /* for equation sources or fixed value profiles this boolean
     indicates whether the variable has a source or fixed value specified */
  cxboolean active;
};
typedef struct thread_profile_struct Profile;

Hello

I want to set sinusoidal value of electric potential (MHD module) for a wall, first i try expression but i faced to error :

Error: wta(2nd) to string_eq

Error Object: __expr__

then i try Profile and UDF profile , but agian i faced to problem , when i use them it consider the wall to insulated.

Could you help me how can i set sinusoidal value for current density ( Electric Potential MHD) ?

Best Regards,
Attached Images
File Type: png UDS b v.png (14.5 KB, 8 views)
sina_sls is offline   Reply With Quote

Reply

Tags
boundary, conjugate heat transfer, uds

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
Centrifugal fan j0hnny CFX 13 October 1, 2019 13:55
CGNS Boundary conditions using SU2 denzell SU2 3 July 9, 2018 05:58
How to define the UDS boundary conditions of electromagnetic of a plasma? aestas Fluent UDF and Scheme Programming 2 March 12, 2014 02:57
Question about heat transfer coefficient setting for CFX Anna Tian CFX 1 June 16, 2013 06:28
Low Mixing time Problem Mavier CFX 5 April 29, 2013 00:00


All times are GMT -4. The time now is 12:23.