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

Solving User-defined Scalar Transport Equation properly

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By meepokman

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 10, 2018, 08:57
Default Solving User-defined Scalar Transport Equation properly
  #1
New Member
 
Chin
Join Date: Jul 2018
Posts: 2
Rep Power: 0
meepokman is on a distinguished road
Hi all,

I'm currently trying to use the User-defined Scalar Transport Equations to solve my simulation problem. Essentially, the four scalar transport equations I'm trying to solve are as per the attached picture, for alpha, Ux, Uy, and Uz.

The equations are very similar to what would be solved for a typical species transport equation, however, there is no diffusion term, and it doesn't follow the velocity of the primary phase, as the species has its own momentum source term for Ux, Uy, and Uz, hence I'm not using the species transport module or the multiphase module natively available in Fluent. I was having divergence issues, however, and couldn't understand why.

I then decided to test my setup with a simple test case, where I only solve the first equation, using the primary phase's flow velocities, to test the solution (as per a more typical species transport equation).

I get two different solutions solving for the convective flux in two ways. The UDF I used is as follows:

DEFINE_UDS_FLUX(eqn1_flux,f,t,i)
{
cell_t c0;
cell_t c1;
Thread *t0;
Thread *t1;
real NV_VEC(psi_vec), NV_VEC(A), flux = 0.0;

c0 = F_C0(f,t);
t0 = F_C0_THREAD(f,t);
c1 = F_C1(f,t);
t1 = F_C1_THREAD(f,t);
F_AREA(A,f,t);

if (BOUNDARY_FACE_THREAD_P(t))
{
NV_DS(psi_vec, = , F_U(f,t),F_V(f,t),F_W(f,t),*,rho_water);
flux = NV_DOT(psi_vec,A);
}
else {
NV_DS(psi_vec, = , C_U(c0,t0),C_V(c0,t0),C_W(c0,t0),*,1.0);
NV_DS(psi_vec, +=, C_U(c1,t1),C_V(c1,t1),C_W(c1,t1),*,1.0);
flux = rho_water*NV_DOT(psi_vec,A)/2.0;
}

/* flux = F_FLUX(f,t); */ /* Second way of calculating */
}

If I solve it by taking the dot product of cell velocities and cell face (my mesh is uniform, so I am just using a simple linear average), I get a different solution than if I use the inherent macro F_FLUX provided by FLUENT. The use of F_FLUX yields a solution that is similar to that solved by a species transport equation as provided by FLUENT.

My issue here is if there's a way to improve the solution obtained by taking the actual dot product of cell_centroid values and cell face normal. I'm asking because I can only calculate the convective flux through the faces for the 4-equation case (my original problem) using the cell centroid values (C_UDSI) for my scalars, since FLUENT doesn't seem to store cell face values for any of the scalars. I'm not sure if that's the reason for the divergence observed earlier, but this disparity seems to be a potential reason.

Thank you for all help and advice provided!
Attached Images
File Type: jpg Four_Eqn_Scalar_Transport.JPG (43.3 KB, 84 views)
File Type: jpg SpeciesTransport.JPG (11.3 KB, 44 views)
Antimony likes this.
meepokman 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
problem with Min/max rho tH3f0rC3 OpenFOAM 8 July 31, 2019 10:48
Segmentation fault when using reactingFOAM for Fluids Tommy Floessner OpenFOAM Running, Solving & CFD 4 April 22, 2018 13:30
pressure in incompressible solvers e.g. simpleFoam chrizzl OpenFOAM Running, Solving & CFD 13 March 28, 2017 06:49
Cannot run the code properly: very large time step continuity error crst15 OpenFOAM Running, Solving & CFD 9 December 14, 2014 19:17
Could anybody help me see this error and give help liugx212 OpenFOAM Running, Solving & CFD 3 January 4, 2006 19:07


All times are GMT -4. The time now is 00:14.