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

How fluent solver work inside the fluent?

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   July 28, 2023, 07:27
Default How fluent solver work inside the fluent?
  #1
Member
 
Chhotelal
Join Date: Jun 2023
Posts: 31
Rep Power: 2
Chhotelal1234 is on a distinguished road
I want to know, how Fluent Solver takes the variable and calculates the value when uploading the UDF function.

In a simple case, I upload only the DEFINE INIT function and initialized the problem, the value is not getting the true value.
#include "udf.h"

#define M 0.25
#define RHO 1600
#define E 0.4
#define Tref 300
#define Tin 300


int last_timestep = -1;

DEFINE_INIT(initial_humidity, d)
{
real Tabs, w, a, b, C, Pvs, RH;
Thread *t;
cell_t c;

thread_loop_c(t, d)
{
begin_c_loop(c, t)
{
C_T(c, t) = Tin;

Tabs = C_T(c, t);

Pvs = 0.1 * exp(27.0214 - (6887 / Tabs) - (5.31 * log(Tabs / 273.16))); /* Eq(25) */
b = 2.667e-7 * pow((1 - (Tabs / 641.7)), -23.438);
C = 1 / (4e5 * pow(Tabs, -2.1166));
a = b * pow(1000 * M, 1 / C);
RH = 1 - exp(-a / Tabs); /* Eq (15) */

if (RH > 0.99)
{
RH = 0.99;
}

w = (Pvs * RH * 0.62189) / (101.3 - Pvs * RH); /* Eq (26) */

}
end_c_loop(c, t)
Message ("realative humidity:%f\n", w);
Message ("Pv:%f\n", Pvs);
Message ("RH:%f\n", RH);
}
}

================================================== ============================
Error is coming, and the value getting Zero at the initial condition
initial_humidity
Done.
realative humidity:0.000000
Pv:0.000000
RH:0.000000

================================================== ============================

Node 10: Process 22992: Received signal SIGSEGV.
Chhotelal1234 is offline   Reply With Quote

 

Tags
alexanderz


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
foam-extend-4.1 release hjasak OpenFOAM Announcements from Other Sources 19 July 16, 2021 05:02
Selection of solver in ANSYS Fluent for given mach number Ankit Patel FLUENT 9 January 29, 2021 04:44
Fluent Adjoint Solver for compressible flow b.shuvayan FLUENT 2 January 30, 2015 07:27
simpleFoam parallel solver & Fluent polyhedral mesh Zlatko OpenFOAM Running, Solving & CFD 3 September 26, 2014 06:53
The fluent stopped and errors with "Emergency: received SIGHUP signal" yuyuxuan FLUENT 0 December 3, 2013 22:56


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