CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

Source configuration using UDS, profile

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Search this Thread Display Modes
Old   October 30, 2018, 07:44
Default Source configuration using UDS, profile
New Member
Join Date: Oct 2018
Posts: 7
Rep Power: 7
dhdh89 is on a distinguished road
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;
face_t f;
cell_t c;

c = F_C0(f,t);
F_PROFILE(f,t,i) = C_UDSI(c,t,1);
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;
dhdh89 is offline   Reply With Quote

Old   October 31, 2018, 01:59
Senior Member
Join Date: Aug 2011
Posts: 421
Blog Entries: 1
Rep Power: 21
blackmask will become famous soon enough

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
blackmask is offline   Reply With Quote


debug, profile, source, udf, uds

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
[swak4Foam] swak4foam for OpenFOAM 4.0 mnikku OpenFOAM Community Contributions 80 May 17, 2022 08:06
[] Patches to compile OpenFOAM 2.2 on Mac OS X gschaider OpenFOAM Installation 136 October 10, 2017 17:25
polynomial BC srv537 OpenFOAM Pre-Processing 4 December 3, 2016 09:07
centOS 5.6 : paraFoam not working yossi OpenFOAM Installation 2 October 9, 2013 01:41
Directional Diffusivity of UDS Source Greg Perkins FLUENT 2 September 4, 2003 03:02

All times are GMT -4. The time now is 22:06.