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

Solving Maxwell's eq using UDF

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By vinerm

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 11, 2020, 12:03
Default Solving Maxwell's eq using UDF
  #1
New Member
 
gdhamale
Join Date: Dec 2015
Posts: 2
Rep Power: 0
gdhamale is on a distinguished road
Hi there,
I am learning to write a UDF for plasma torch simulation (DC arc). Pl help me to understand how to write udf to solve coupled equations (attached) for my computational domain

J (current density) is known to us and defined via DEFINE_PROFILE macro (boundary condition given at the surface of a cathode) as below:
#include "udf.h"
double Rc 0.0002 /* Arc cut radius in meter*/
DEFINE_PROFILE(Current_den,t,i)
{
face_t f;
double x[ND_ND],J0,b;
begin_f_loop(f,t)
{
F_PROFILE(f,t,i)=0.;
F_CENTROID(x,f,t);
J0 = 5.7e8;
b = 2935;
if(x[1]<= Rc) F_PROFILE(f,t,i) = J0*exp(-b*x[1]);
}
end_f_loop(f,t)
}
Attached Images
File Type: gif Maxwell.gif (2.6 KB, 23 views)

Last edited by gdhamale; April 11, 2020 at 12:08. Reason: Not showing the attachment
gdhamale is offline   Reply With Quote

Old   April 11, 2020, 14:19
Default Maxwell Equations
  #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
Your query is not very clear. As far as solving of an equation is conserved, then you have to enable an equation for a scalar. If you wish to use inbuilt MHD model for your application, then equation is already being solved, though with certain assumptions.

As far as the UDF is concerned, it will return a value and apply that value to whichever variable you hook it. If you hook it for current density, then it will be taken as current density. If you hook it for potential, then it will be used as potential.
gdhamale likes this.
__________________
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 11, 2020, 14:56
Default
  #3
New Member
 
gdhamale
Join Date: Dec 2015
Posts: 2
Rep Power: 0
gdhamale is on a distinguished road
Thank you for your response.
Yes, I need to enable the scalar equation (for vector and scalar potential – total 3 equations in 2D) which I have mentioned in the attached image. Could you pl explain me how to express these equations using DEFINE_SCALAR macro?

Thanks a lot!
gdhamale is offline   Reply With Quote

Old   April 11, 2020, 16:21
Default MHD Module
  #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
I'd suggest you to have a look at inbuilt MHD module.

https://www.afs.enea.it/project/nept...d/main_pre.htm

If you want to use your own equations, then you just need to enable scalars under User-Defined > Scalars. This is done via GUI not via a UDF. However, UDF might be required if you want to specify something special, such as, a constitutive relation or boundary condition.
__________________
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   December 4, 2020, 03:25
Smile
  #5
New Member
 
Aditya Shaw
Join Date: Dec 2020
Posts: 1
Rep Power: 0
shawaditya is on a distinguished road
Hello, I am doing a similar simulation in plasma and was wondering if you were able to solve the maxwell udf issue. I'd be extremely delighted if you could help me out

Thanks
shawaditya is offline   Reply With Quote

Old   October 30, 2022, 16:07
Smile
  #6
Senior Member
 
mahdi abdollahzadeh
Join Date: Mar 2011
Location: Covilha,Portugal
Posts: 153
Rep Power: 15
mm.abdollahzadeh is on a distinguished road
If you had any success with the plasma torch model can you share a case here?
I have developed a code for that but I am facing problem with converging temperature
mm.abdollahzadeh is offline   Reply With Quote

Old   July 11, 2023, 04:52
Default
  #7
New Member
 
niming
Join Date: Jul 2023
Posts: 5
Rep Power: 3
sixgod is on a distinguished road
Quote:
Originally Posted by shawaditya View Post
Hello, I am doing a similar simulation in plasma and was wondering if you were able to solve the maxwell udf issue. I'd be extremely delighted if you could help me out

Thanks
Excuse me, have you solved it now? I have the same problem.
sixgod 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
Suppress twoPhaseEulerFoam energy AlmostSurelyRob OpenFOAM Running, Solving & CFD 33 September 25, 2018 18:45
Segmentation fault when using reactingFOAM for Fluids Tommy Floessner OpenFOAM Running, Solving & CFD 4 April 22, 2018 13:30
HeatSource BC to the whole region in chtMultiRegionHeater xsa OpenFOAM Running, Solving & CFD 3 November 7, 2016 06:07
Floating point exception error lpz_michele OpenFOAM Running, Solving & CFD 53 October 19, 2015 03:50
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 07:20


All times are GMT -4. The time now is 09:17.