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

How to pass electric current magnitude to UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 6, 2018, 15:14
Default How to pass electric current magnitude to UDF
  #1
New Member
 
Paul Lee
Join Date: Jun 2018
Location: Vancouver
Posts: 14
Rep Power: 7
paoching is on a distinguished road
I'm looking at a galvanic corrosion damage problem using fluent electric potential model and are writing a udf with DEFINE_GRID_MOTION to update the dynamic damage of metal surface. The equation looks like this:

corr_rate = (J*MWT)/(z*F*RHO)
y(1)=y(0)+corr_rate*dt

where
corr_rate is surface damage in m/s
J is electric current magnitude in A/m^2, a post processing variable
MWT is molecular weight of metal in g/mol
z is charge number of dissolved metal ion
F is Faraday's constant in C/mol
RHO is density of metal in g/m^3

problem is I don't know how to pass electric current J into the UDF. I've looked through the UDF manual and while I can call cell variable like pressure and temperature with C_P(c,t) and C_T(c,t), there is no similar macro for electric current.

Can someone help me?

Thanks in advance!
paoching is offline   Reply With Quote

Old   July 17, 2018, 15:19
Default update
  #2
New Member
 
Paul Lee
Join Date: Jun 2018
Location: Vancouver
Posts: 14
Rep Power: 7
paoching is on a distinguished road
A little update, I was able to deform mesh with hard entered constant current density J. see attached UDF, which is hooked to dynamic mesh zone.
my problem lies in how and if I can pass the post processing variable current density into UDF.
2018-07-17_12-15-20.png

2018-07-17_12-14-20.png

corrosion_al.c
paoching is offline   Reply With Quote

Old   October 16, 2019, 07:11
Default
  #3
New Member
 
Domagoj
Join Date: Oct 2019
Posts: 10
Rep Power: 6
Domagoj is on a distinguished road
Hello, did you managed to pass electric current J into the UDF?
How did You do it?

Thanks!
Domagoj is offline   Reply With Quote

Old   October 16, 2019, 12:47
Default
  #4
New Member
 
Paul Lee
Join Date: Jun 2018
Location: Vancouver
Posts: 14
Rep Power: 7
paoching is on a distinguished road
Quote:
Originally Posted by Domagoj View Post
Hello, did you managed to pass electric current J into the UDF?
How did You do it?

Thanks!
I was able to pass the potential gradient from fluent to the UDF and calculate current density with ohms law
paoching is offline   Reply With Quote

Old   October 17, 2019, 01:37
Default
  #5
New Member
 
Domagoj
Join Date: Oct 2019
Posts: 10
Rep Power: 6
Domagoj is on a distinguished road
Quote:
Originally Posted by paoching View Post
I was able to pass the potential gradient from fluent to the UDF and calculate current density with ohms law
Thanks, did You use C_PHI_1(c,ct) and C_PHI_G(c,ct)[i] cell macros?
I am not sure because this macro is not in documentation.

Best regards.
Domagoj is offline   Reply With Quote

Old   June 14, 2022, 07:10
Default
  #6
ghc
New Member
 
Join Date: Jul 2021
Posts: 1
Rep Power: 0
ghc is on a distinguished road
Quote:
Originally Posted by Domagoj View Post
Thanks, did You use C_PHI_1(c,ct) and C_PHI_G(c,ct)[i] cell macros?
I am not sure because this macro is not in documentation.

Best regards.
Hi,

Has anyone used those commands succesfully? I am stucked with SIGSEGV errors while trying to obtain the electric potential gradient...

Best regards
ghc is offline   Reply With Quote

Old   June 15, 2022, 04:13
Default
  #7
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
Quote:
Originally Posted by ghc View Post
Hi,

Has anyone used those commands succesfully? I am stucked with SIGSEGV errors while trying to obtain the electric potential gradient...

Best regards
i recommend you to open new thread and explain in details your problem
describe case, model you are using, show code and compilation log

list of avaliable macros for specific models you may find in
Code:
..\fluent\fluent_xxx\addons\model_name\src
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Reply


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
How to set sinusoidal electric current for volume of electrodes in Fluent? ngoctm FLUENT 6 April 14, 2023 10:46
UDF for current density in PEM fuel cell sajjad haider FLUENT 2 February 22, 2012 18:16
I need UDF help. S.Whitney FLUENT 0 October 15, 2007 11:29
DEFINE_DPM_OUTPUT macro UDF HELP Puneet FLUENT 3 November 28, 2003 10:55
How can I get the particle current position in UDF cfdfans FLUENT 4 April 2, 2001 05:03


All times are GMT -4. The time now is 08:26.