- **OpenFOAM Programming & Development**
(*http://www.cfd-online.com/Forums/openfoam-programming-development/*)

- - **Continuity equation in coupledFvMatrix**
(*http://www.cfd-online.com/Forums/openfoam-programming-development/76897-continuity-equation-coupledfvmatrix.html*)

Continuity equation in coupledFvMatrixHI all,
I try to write a coupled solver that uses continuity equation. I tried to do it that way: Code:
` coupledFvScalarMatrix coupledEqns(1);` Regards Bastian |

Just make it of type fvScalarMatrix:
Code:
`coupledFvScalarMatrix coupledEqns(1);` |

Thanks Laurence,
since my code is steady-state and incompressible I do not really need fvm::ddt(rho). So I tried: Code:
`coupledFvScalarMatrix coupledEqns(1);` Code:
`Making dependency list for source file coupledFoam.C` |

Easy - you are trying to make a matrix and you are only giving it a field: fvc::div(phi).
That has no matrix coefficients - how do you expect to solve the system of equations that says [0] * [x] = [b] Hrv |

Quote:
that makes sence. I am not yet deep enough in it. So how is the correct formulation of the continuity equation? |

Hello Mr. Jasak,
This is interesting. Could you also explain this code (fvm::div(phi, U) == 0) in the matrix form, similar to what you have written before as [0] * [x] = [b] ?All the best |

another question - how is this possible? divergence of a scalar?
fvc::div(phi) |

HiHi,
fvm: (div,phi) == 0 Briefly explaining, fvm: stands for implicit. A discretization in space is done first (via the FVM) and in time if necessary and all the coeffs. are placed in a matrix form [O], then the resultant of the discretization of the source terms are placed to the right hand side of the equation in a vector [S].where the unknowns are the velocity field vector components on the mesh. All above, are such that [O]*[U] = [S] which is solved to find [U] vector field components. For the scalar issue: you should see 4.4.5 in: http://www.openfoam.org/docs/user/fvSchemes.php Regards, T.D. |

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