How to use surface set in radiate boundary condition

Data line for keyword should be like:

element_number,rx,temmperature,emissivity

According to the manual, “In order to apply radiation conditions to a surface the element set label underneath may be replaced by a surface name. In that case the “x” in the radiation flux type label is left out.”

But I tried the data line with surface name, in this format:

surface_name,r,temmperature,emissivity

What was wrong?

The related files are at

Below your original line and then 3 alternatives which all worked on my side:

*radiate,amplitude=a2
** original:
**CONVECTION,r,1000.,1.0
** works with Surface name:
**CONVECTION,R2,1000.,1.0
** works with same results:
**CONVECTION,R1,1000.,1.0
** using ELSET name instead of Surface name:
BILLET,R1CR,1000.,1.0

It only worked for me once I set in source file ini_cal.c the parameter nload_=100000, then recompiled and linked the source code.

I can not find any documentation on changing the value for “nload_”, what the meaning of a value of 100000? That should be the default. The element number and face number are already defined in the surface set definition, it is unnecessary to duplicate.

There may be no documentation on the nload_ variable in the official ccx manual. But at least ccx writes an error to the standard console output what you can do to overcome the (sizing) issue. ccx tells you which variable to change in which source file. Much better than nothing! As you I don’t have much an idea of what nload_ (default setting in the code is nload_ = 0) is being used for, but I got it technically working through the ccx instructions on the output screen.

There are many parameters in the ccx source code files being defined for the default sizing of vectors and matrices which should fit for the significant majority of models. Your model details may deviate a bit too much from standard sizing parameters why you are asked to adjust a given parameter.

By the way ccx has never been easier to compile than with the new version 2.21 even on Windows 10. With the standard Makefile you can now compile it without problems to run it with the Spooles solver.

I still think use of surface set should be default, it significantly simplifies the preprocessing.

According to the documentation, the element face number can be omitted if surface name is used, if so, this is a bug that the original is not working.

** original:
*CONVECTION,r,1000.,1.0

The error message for the original input:

 *ERROR reading *RADIATE. Card image:
        CONVECTION,R,1000.,1.0

your modification make the face number specific in Rx:

** works with Surface name:
*CONVECTION,R2,1000.,1.0

but the convection surface has different face numbers, your end result is wrong.

Both problems in this topic are still in ccx 2.23 and master, and I traced them:

  • greatq’s line with the bare R (posts 1 and 5) stops with “*ERROR reading *RADIATE. Card image”. The 2.23 manual (section 7.108, *RADIATE) says that with a surface name “the ‘x’ in the radiation flux type label is left out”, so the input follows the manual. *FILM has the same check. In [SOLVED] DFLUX and shells - #4 by dhondt (2021) Guido wrote that he had improved the documentation: the “0” is not needed on the S, F or R label (dflux, film, radiation). Matej then reported in [SOLVED] DFLUX and shells - #6 by Matej that *FILM still needs F0 with a surface name. No developer replied to that; greatq suggested there in 2024 (post 7) to keep the “0” instead. *DFLUX accepts the bare S, but *FILM and *RADIATE still do not.
  • johanngil’s observation in post 2, that R1 or R2 with a surface name works only after raising nload_ in ini_cal.c, has a simple cause: allocation.f does not count the faces of a surface for *RADIATE, so the run stops with “*ERROR in loadadd: increase nload_”. With one spare load entry the surface line gives exactly the element-set result.

On greatq’s concern in post 5: the digit after R does not matter on a surface line. ccx replaces it with the face of each surface entry (radiates.f lines 387-390), so R2 on a surface with faces S2 and S4 loads both faces. I checked this against E1, R2 plus E1, R4 lines, which give the same temperatures (ra_surf0_spare.inp below with E1, S4 added to the surface STOP, a third E1, S1, 0. line for a second spare entry and R2 instead of R0, against ra_set.inp with the line E1, R4, 1., 1. added: NT = 6.914418E-01 at nodes 5 and 8 and 9.825873E-01 at nodes 6 and 7 in both).

Checked on ccx 2.23 (macOS arm64). films.f, radiates.f and allocation.f are unchanged in these places on master (9ba5d76, 16 Oct 2026).

Decks

fi_surf.inp:

** One unit DC3D8 cube, conductivity 1., bottom face held at
** temperature 0. Film condition (sink temperature 20., film
** coefficient 1.) on the top face through the facial surface STOP,
** with the label F as section 7.59 describes it.
** Expected: NT = 10. at the top nodes 5-8.
*NODE, NSET=NALL
1, 0., 0., 0.
2, 1., 0., 0.
3, 1., 1., 0.
4, 0., 1., 0.
5, 0., 0., 1.
6, 1., 0., 1.
7, 1., 1., 1.
8, 0., 1., 1.
*ELEMENT, TYPE=DC3D8, ELSET=E1
1, 1, 2, 3, 4, 5, 6, 7, 8
*NSET, NSET=BOT
1, 2, 3, 4
*NSET, NSET=TOP
5, 6, 7, 8
*SURFACE, NAME=STOP
E1, S2
*MATERIAL, NAME=M
*CONDUCTIVITY
1.
*SOLID SECTION, ELSET=E1, MATERIAL=M
*PHYSICAL CONSTANTS, ABSOLUTE ZERO=0., STEFAN BOLTZMANN=1.
*BOUNDARY
BOT, 11, 11, 0.
*STEP
*HEAT TRANSFER, STEADY STATE
1., 1.
*FILM
STOP, F, 20., 1.
*NODE PRINT, NSET=TOP
NT
*END STEP

The other decks replace the two lines *FILM / STOP, F, 20., 1. by:

deck lines
fi_surf0.inp *FILM / STOP, F0, 20., 1.
ra_surf.inp *RADIATE / STOP, R, 1., 1.
ra_surf0.inp *RADIATE / STOP, R0, 1., 1.
ra_set.inp *RADIATE / E1, R2, 1., 1. (element set and face number instead of the surface)
ra_surf0_spare.inp *DFLUX / E1, S1, 0. / E1, S1, 0. / *RADIATE / STOP, R0, 1., 1. (a zero flux given twice on one face: the two lines are counted as two loads but stored as one, which leaves one spare entry)
df_surf.inp *DFLUX / STOP, S, 1.

For the radiation decks (sink temperature 1., emissivity 1., Stefan-Boltzmann constant 1., absolute zero 0.) the top temperature solves T^4 + T = 1, so T = 0.7244920.

Results

deck outcome
fi_surf *ERROR reading *FILM. Card image: STOP,F,20.,1., exit 201
fi_surf0 NT = 1.000000E+01 at nodes 5-8 (exact)
ra_surf *ERROR reading *RADIATE. Card image: STOP,R,1.,1., exit 201
ra_surf0 *ERROR in loadadd: increase nload_, exit 201
ra_set NT = 7.244920E-01 at nodes 5-8
ra_surf0_spare NT = 7.244920E-01 at nodes 5-8
df_surf NT = 1.000000E+00 at nodes 5-8 (the bare S works)

The NU, FC and CR forms without the digit (STOP, FNU, STOP, FFC, ..., STOP, RNU, STOP, RCR, ...) also stop with “*ERROR reading”, and so does STOP, SNU on *DFLUX.

Where it goes wrong

  1. The label check. films.f (lines 267-272) and radiates.f (lines 281-286) accept only F0 to F6 and R0 to R6:

            if(((label(1:2).ne.'R1').and.(label(1:2).ne.'R2').and.
         &       (label(1:2).ne.'R0').and.
         &       (label(1:2).ne.'R3').and.(label(1:2).ne.'R4').and.
         &       (label(1:2).ne.'R5').and.(label(1:2).ne.'R6')).or.
    

    dfluxs.f (lines 170-175) also lists 'S ', which is why the bare S works there. On a surface line the digit plays no role: it is overwritten by the face of each surface entry (films.f lines 379-382, radiates.f lines 387-390), so any digit gives the same result.

  2. *The allocation for RADIATE. The *RADIATE branch of allocation.f (lines 1979-2005) looks the name up only as an element set (suffix E):

                elset(ipos:ipos)='E'
                call cident81(set,elset,nset_,i)
                if(i.gt.0) then
                  if(set(i).eq.elset) then
                    nload_=nload_+meminset(i)
                    nradiate=nradiate+meminset(i)
    

    The branch for *DLOAD, *DSLOAD, *DFLUX, *MASS FLOW and *FILM (lines 743-812) also tries the name as a facial surface (suffix T, lines 796-810). A *RADIATE line with a surface name therefore adds nothing to nload_, and loadadd stops when the face is stored. radiates.f itself handles the surface correctly: with one spare entry (ra_surf0_spare) the run ends with the element-set result.

Possible fix

Not built or tested:

  • films.f and radiates.f: accept the label without a face number on a line that names a facial surface, and keep requiring the face number on element and element-set lines. dfluxs.f accepts the bare S on every line, element and element-set lines included, so its check is not the one to copy. The forms with NU, FC or CR need care, because films.f and radiates.f turn a second character N or P into 5 or 6 (lines 232-233 and 244-245) before the check. Alternatively, sections 7.59 and 7.108 could say that a digit is needed on these cards.
  • allocation.f, *RADIATE branch: when the name is not an element set, look it up with the suffix T and add its member count to nload_ and nradiate, as the *FILM branch does.

Workaround: write any digit after F or R on a surface line (F0, R0). For *RADIATE, use an element set with a face number (E1, R2, ...) instead of a surface.