# Update of view factor generation using 2AI and 2LI methods plus CGAL for ray tracing

### Summary

```
This view factors generation application uses a combined approach of
double area integral (2AI) and double linear integral (2LI). 2AI is used
when the two surfaces are 'far' apart and 2LI when they are 'close'.
The distance between faces is calculating a ratio between averaged areas and the distance between face
centres. 2LI is integrated along edges using Gaussian quadrature with a given tolerance.
This approach doesn't use face agglomeration as pre-processing step.
Optional new feature can be used to solve the system of equations from the s2s system using the
standard iterative linear solvers in OpenFOAM.
```

### Resolved bugs

The old method used 2AI and agglomeration for all the view fators. The 2AI is not accurate for faces which are in close proximity. The agglomeration process proved to be problematic concerning the face centre and normal calculation.

### Details of new models

The extra inputs in the s2s dictionary are:

```
GaussQuadTol 0.1; // GaussQuad integral error tolerance (default : 0.01). Used to decide when to increase order of integration.
distTol 8; // relative distance (default : 8). For <distTol : use 2LI, >distTol : use 2AI
alpha 0.22; // Constant model use for common edges for 2LI (default : 0.22). Approx for integral value of duplicate edges.
intTol 1e-2; // (m) Interval tolerance. This is used for ray shooting from
// face centre to face centre plus `intTol` in order to avoid the ray to hit the same face where it was originated. (default : 1e-2)
```

The default values are generally reasonable for a wide range of cases.

The optional iterative linear solver is specified in the radiationProperty dictionary:

```
viewFactorCoeffs
{
smoothing false; // Use for closed surfaces where sum(Fij) = 1
constantEmissivity true;
nBands 1;
useDirectSolver false; // Use direct solver on master or fully parallel iterative solver
}
```

NOTE: In this development face agglomeration is not needed. The model will create an identity list if it is not present. Thus, it is not necessary for the user to run `faceAgglomerate`

. But, the framework for using faceagglomeration was left inside the model as it can be needed in later stages.

Edited by Mattijs Janssens