CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   changing matrix coeffs in a cell (https://www.cfd-online.com/Forums/openfoam-programming-development/109221-changing-matrix-coeffs-cell.html)

Mjoelnir November 12, 2012 17:09

changing matrix coeffs in a cell
 
Hi Foamers,

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

        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:

Code:

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 13:49.