CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Limited schemes implementation (https://www.cfd-online.com/Forums/openfoam-solving/58829-limited-schemes-implementation.html)

fabianpk June 10, 2008 08:41

I have been looking into the i
 
I have been looking into the implementation of TVD schemes in OpenFOAM, and I found something that I'm not entirely sure I understand.

When the function for the limiter variable is calculated in LimitedScheme.C (so before it is actually calculated) it goes into LimitFuncs.C where it does magSqr if the variable that's being interpolated is a vectorField. So, later on when the gradient is calculated, it is not the gradient of the field but the gradient of the mag-squared field.

The idea I have is that this is done because the later calculations of the limiter etc requires a scalar. And since it doesn't really matter if we use magSqr or mag of the field, the one that's cheaper to calculate is used.

Is my theory to why magsqr is used correct? Or is it some entirely different reason?

/Fabian


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