CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Programming & Development (
-   -   changing matrix coeffs in a cell (

Mjoelnir November 12, 2012 18:09

changing matrix coeffs in a cell
Hi Foamers,

i want to change the fvmatrix coeffs for a specific cell.(for this matrix)

        fvScalarMatrix TEqn        (            fvm::ddt(T)            + fvm::div(phi, T)            - fvm::laplacian(DT, T)        );
i know how to access the the upper() and lower() diag. But i dont know where the source terms are added to the equation. I already looked up the source code of the class gaussConvectionscheme.

My idea for solving this problem would be to interpolate the faces of the cells and the calculate the the upper() and lower(). Here an example for the fvm::div:


fvm.lower() = -weights.internalField()*faceFlux.internalField(); fvm.upper() = fvm.lower() + faceFlux.internalField(); fvm.negSumDiag();
but how to interpolate a face (not the whole mesh) with the scheme described in fvschemes?

how are the fvmatrix.source() terms described for div and laplacian?

and is there a more elegant way?

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