TAGGED: ansys-fluent, fluent, heat-transfer, pcm, porous, udf
-
-
October 19, 2023 at 11:21 am
Robbie Crosby
SubscriberI am trying to edit the value of the heat transfer coefficient under heat transfer settings for a Non-equilibrium thermal model in porous media. I am trying to write a UDF to do this however I cant get my UDF to come up when compiled. Does anyone have any advice for where I am going wrong. Thank you.
#include "udf.h"
#include "mem.h"
#define Tsolidus 300.0
#define Tliquidus 304.0
#define L_f 250 //Latent heat of fusion
#define UDM_RHO_F_PREV 0 // UDM index for storing previous rho_f
#define UDM_LAMBDA_PREV 1 // UDM index for storing previous lambda
DEFINE_PROFILE(h_sfq, c, t)
{
real dl, epsilon, mu, nu, pr, rho_pcm, u, v, mu_pcm, k_pcm, Re_d, h_sfq, local_h_sfq;
cell_t cell;
dl = 0.0194; //Diameter Matlab
epsilon = 0.85; //Porosity Matlab
mu = C_MU_L(c, t); // Laminar viscosity
rho_pcm = C_R(c, t); // Density
nu = mu/rho_pcm; // Kinematic Viscosity
pr = nu/rng_alpha(1., mu, mu); // Prandtl Number
u = C_U(c, t);
v = C_V(c, t);
mu_pcm = C_MU_L(c ,t);
k_pcm = C_K_L(c, t);
Re_d = (rho_pcm * sqrt(u*u + v*v) *dl) / (epsilon * mu_pcm);
if (Re_d > 0 && Re_d <= 40)
local_h_sfq = (0.76 * pow(Re_d, 0.4) * pow(pr, 0.37) * k_pcm)/dl;
else if (Re_d > 40 && Re_d <= 1000)
local_h_sfq = (0.52 * pow(Re_d, 0.5) * pow(pr, 0.37) * k_pcm)/dl;
else if (Re_d > 1000 && Re_d <= 20000)
local_h_sfq = (0.26 * pow(Re_d, 0.6) * pow(pr, 0.37) * k_pcm)/dl;
else
return local_h_sfq;
}
-
October 20, 2023 at 5:15 pm
Federico Alzamora Previtali
Ansys EmployeeAre you having problems to get this to compile? Or is the UDF not working?
If the former, are you getting any error/warning messages when you try to compile?
If the second, I would look at the last section of your code, where you return the value of local_h_sfq only in the last else statement
-
- 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.
- legend min and max
- Ensight hot iron palette from an image
- Streamlines in EnSight using MRI data
- Import MRI data into Ensight
- FLUENT APPLICATIION ERROR
- Total Surface Heat Flux Calculation in Fluent
- Difference between “total pressure” and “absolute pressure”?
- Drop Test of a Water-Filled Tube
- Minimum Orthogonal Quality Less than 0.01 For Transonic Airfoil Flow Analysis
- obtaining pressure distribution by making points in ansys
-
8808
-
4658
-
3153
-
1680
-
1470
© 2023 Copyright ANSYS, Inc. All rights reserved.