How the cyclic boundary condition affect the coefficient matrix
Hi all,
does anyone examine on how the cyclic boundary condition is implemented? I apply the cyclic boundary condition to the inlet and outlet in a 2D pipe flow, and it works well (generating parabolic flow with right maximum velocity). But I find that the neighbor/owner list of the cyclic boundary generated by 'blockMesh' has no difference with that of normal inlet/outlet boundary. I think the crucial code is not in 'cyclicFvPatchField.C'. can someone kindly give me some hint which part in OpenFOAM deal with the cyclic boundary in generating the coefficient matrix? Thanks. Mill 
Quote:
Did you find any information related to your question of how cyclic boundary conditions modify the coefficient matrix? Thanks in advance for your help. C 
treatment of cyclic boundary conditions
Hi Martel,
As far as I know, the coefficient matrix is not affected by the cyclic boundary conditions. If you output the coefficient matrix for a Dirichlet boundary or a Neumann boundary and compare it with that for a cyclic boundary, you would find they are the same. The treatment of cyclic boundary is similar to the treatment of the processorPatch. Functions or variables including valueInternalCoeffs(), valueBoundaryCoeffs() are affected. Cheers, Mill 
Thank you for your quick reply codinging.
Please let me ask you another related question: I am trying to understand how openfoam generates the matrices for the differential operators. I have programmed a simple example for the laplacian operator: Quote:
* Matrix Diagonal terms * Matrix out of diagonal terms * Indices of the out of diagonal terms * source terms (right hand side of the linear system) (zero in my example) * Boundary conditions contribution to the source term coefficients * Boundary conditions contribution to the matrix term coefficients As you said, the effect of the boundary conditions is not yet included in the matrix and source term that I get. My question is: How can I get the indices (I already have the values) of the Boundary Conditions contribution to the matrix coefficients and to the source term? Thanks in advance for your help. CME But the effect of the boundary conditions is not yet included in the matrix and source term that I get. My question is: How can I get the contribution (coefficients and indices) of the Boundary Conditions to the matrix coefficients (diag and outofdiag) and to the source term? Thanks in advance for your help. CME 
boundary conditions
Hi Martel,
you are correct that boundary condition contribution to the source terms and the coefficient matrix are separately store in internalCoeffs() and boundaryCoeffs(). I would suggest you to have a look at the D(), H(), A() operators of a fvMatrix. e.g. in fvMatrix.C template<class Type> Foam::tmp<Foam::scalarField> Foam::fvMatrix<Type>::D() const { tmp<scalarField> tdiag(new scalarField(diag())); addCmptAvBoundaryDiag(tdiag()); return tdiag; } 'addCmptAvBoundaryDiag(tdiag())' considers the contribution for the treatment of differential operators related to a boundary. In addition to this, you might find how internalCoeffs() and boundaryCoeffs() are generated by looking at a specific implementation of a boundary condition, e.g. 'fixedValueFvPatchField.C’ for the Dirichlet boundary condition. Cheers, Mill 
Thanks for the comment

All times are GMT 4. The time now is 05:09. 