TAGGED: fluent
-
-
February 5, 2023 at 9:56 am
Tawsif Mahmud
Subscribermy source term is not working for biomagnetic fluid driven cavity. This is my code.what have i missed in my code??
#include "udf.h"
#define a 0.0250
#define b -0.0025
#define pi 3.1415926535
#define gamma 0.078539816
#define muX 1.60007704
#define sigMu 0/*________ x momemtum source term ________*/
DEFINE_SOURCE(xmom_source,c,t,dS,eqn)
{
real x[ND_ND];
real source;
real h,hx,hy;
real source_magnet,source_lorentz;
real dHx;
C_CENTROID(x,c,t);/*magnetic source term*/
h = gamma/(2*pi*(sqrt(pow((x[0]-a),2)+pow((x[1]-b),2))));
dHx = -(gamma/(2*pi))*((x[0]-a)/pow(pow((x[0]-a),2)+pow((x[1]-b),2),(3/2)));
source_magnet = muX * h * dHx;/*lorentz source term*/
hx = (gamma/2*pi)*((x[1]-b)/(pow(x[0]-a,2)+pow(x[0]-a,2)));
hy = -(gamma/2*pi)*((x[0]-a)/(pow(x[0]-a,2)+pow(x[0]-a,2)));
source_lorentz = sigMu * ((hx*hy*C_V(c, t))-(hy*hy*C_U(c, t)));source = source_magnet + source_lorentz;
return source;
}
/*________ y momemtum source term ________*/
DEFINE_SOURCE(ymom_source,c,t,dS,eqn)
{
real x[ND_ND];
real source;
real h,hx,hy;
real source_magnet,source_lorentz;
real dHy;
C_CENTROID(x,c,t);/*magnetic source term*/
h = gamma/(2*pi*(sqrt(pow((x[0]-a),2)+pow((x[1]-b),2))));
dHy = -(gamma/(2*pi))*((x[1]-b)/pow(pow((x[0]-a),2)+pow((x[1]-b),2),(3/2)));
source_magnet = muX * h * dHy;/*lorentz source term*/
hx = (gamma/2*pi)*((x[1]-b)/(pow(x[0]-a,2)+pow(x[0]-a,2)));
hy = - (gamma/2*pi)*((x[0]-a)/(pow(x[0]-a,2)+pow(x[0]-a,2)));
source_lorentz = sigMu * ((hx*hy*C_U(c, t))-(hx*hx*C_V(c, t)));source = source_magnet + source_lorentz;
return source;
} -
February 6, 2023 at 11:00 am
DrAmine
Ansys EmployeeWhat do you mean with "is not working"? We cannot judge what you have implemented with UDF as that is based on our custom laws you want to add / consider or any other model formulation or source terms.
-
- You must be logged in to reply to this topic.

Boost Ansys Fluent Simulations with AWS
Computational Fluid Dynamics (CFD) helps engineers design products in which the flow of fluid components is a significant challenge. These different use cases often require large complex models to solve on a traditional workstation. Click here to join this event to learn how to leverage Ansys Fluids on the cloud, thanks to Ansys Gateway powered by AWS.

Earth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.

Ansys Blog
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.
- Suppress Fluent to open with GUI while performing in journal file
- Floating point exception in Fluent
- What are the differences between CFX and Fluent?
- Heat transfer coefficient
- Getting graph and tabular data from result in workbench mechanical
- The solver failed with a non-zero exit code of : 2
- Difference between K-epsilon and K-omega Turbulence Model
- Time Step Size and Courant Number
- Mesh Interfaces in ANSYS FLUENT
- error: Received signal SIGSEGV
-
5162
-
3275
-
2453
-
1308
-
956
© 2023 Copyright ANSYS, Inc. All rights reserved.