CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   Source configuration using UDS, profile (https://www.cfd-online.com/Forums/fluent-udf/210584-source-configuration-using-uds-profile.html)

dhdh89 October 30, 2018 07:44

Source configuration using UDS, profile
 
I have configured the UDF, but there is a problem that the UDS does not affect the result in the calculation.

I want to analyze the heat transfer model for a gas with a thin film (t = 0 mm) in between. The thin film generates heat in both directions. The mixture moves through each thin film. (Pic.)

The thin film is capable of heat transfer, and the gas movement between the films is impossible.

So I made two more faces with the interface between mixture as a mapped interface.

UDS was used to set the heating value on the surface, and flux was set using define_profile.

The UDS value was set as the Source and inserted into the cell zone.

As a result, the heat source from the surface acts as a source in the cell where the corresponding surface exists in the cell zone.

I thought this logic was wrong and wrote UDF.

Could you help me?


DEFINE_UDS_FLUX(UDS_Heat_a, f, t, i)
{
cell_t c;
real NV_VEC(fluxes), NV_VEC(A), flux = 0.0, mflow;
c = F_C0(f, t);
F_AREA(A, f, t);

mflow = 2500; //[w/m2]
NV_D(fluxes, =, 0, 0, mflow);
flux = NV_DOT(fluxes,A);
return flux;

C_UDSI(c,t,1) = flux;
}
DEFINE_PROFILE(Prof_Heat_a,t,i)
{
face_t f;
cell_t c;

begin_f_loop(f,t)
{
c = F_C0(f,t);
F_PROFILE(f,t,i) = C_UDSI(c,t,1);
}
end_f_loop(f,t)
}
DEFINE_SOURCE(Source_Heat_a, c, t, dS, eqn)
{
real source;
real vol = C_VOLUME(c,t);
real prop = C_UDSI(c,t,1);

source = prop / vol / 2;
dS[eqn] = 0.0;
return source;
}

blackmask October 31, 2018 01:59

Code:

{
...

return flux;

        C_UDSI(c,t,1) = flux;
...

}


The code after "return" statement has no effect. You need to exchange those two lines. However the code still does not meet your needs after the modification.



You need something like
Code:

DEFINE_EXECUTE_AT_END


All times are GMT -4. The time now is 08:36.