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/)
-   -   sequential solving - matrix manipulation (https://www.cfd-online.com/Forums/openfoam-programming-development/230871-sequential-solving-matrix-manipulation.html)

AxelS October 9, 2020 04:48

sequential solving - matrix manipulation
 
Dear Foamers,

I still try to implement a special update scheme in the interFoam solver (https://doi.org/10.1016/j.jcp.2019.109067). The scheme requires to sequentially solve the equations inside the domain.

From what I understand right now (I just started to work with OpenFOAM a few weeks ago), an equation is set-up according to:

A*u=b

where A is the matrix containing the coefficients from the implicit parts, u containing the values after the update in the step .solve() and b containing source terms and explicit parts, right?

What I would like to do know is to extract a number of rows from A, u and b and solve this subsystem. Is there an straight forward way in OpenFoam to handle this kind of operation?

I hope my question got clear, otherwise don't hesitate to ask. I really appreciate any kind of help. Thanks a lot,
Axel

dlahaye October 9, 2020 05:56

OpenFoam stores linear system in sparse LDU format, see e.g. [1,2].

Extracting rows from A requires going through the same bookkeeping as implemented in the matrix-vector multiplication implemented in the Amul function, see Section 5/8 of [3].


[1]: Moukalled, Manga and Darwish, The finite volume method in computational fluid dynamics, Springer 2015 , http://www.springer.com/gp/book/9783319168739

[2]: https://www.foamacademy.com/wp-
content/uploads/2018/03/OF2018matrix.pdf

[3]: https://www.linkedin.com/pulse/openf...menico-lahaye/

AxelS October 12, 2020 04:55

interfaces
 
Dear Domenico,

thank you very much for the provided references. They seem to be very helpful.
I understood know the setup of the coefficient matrix but still struggle with some parts of the implementation.

Can you tell me whats the purpose of the functions initMatrixInterfaces() (Line 83) and updateMatrixInterfaces() (Line 105) in LduMatrixATmul.C (https://github.com/OpenFOAM/OpenFOAM...atrixATmul.C)?

Thank you once more and appreciate your response.


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