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/)
-   -   Coupled PDE (https://www.cfd-online.com/Forums/openfoam-programming-development/174235-coupled-pde.html)

cute July 7, 2016 20:04

Coupled PDE
 
Dear Foamer,

I am new in OpenFoam and would like to learn. I need your help.

Consider the following two PDEs that I would like to solve in a coupled manner.

ddt(C) = laplacian(d, C) - alpha*F(C)*X
ddt(X) = laplacian(DX, X) + F(C)*X - beta*X

where F(C) = C/(0.5+C), DX = gamma*sqr(X) and d, alpha and beta are some real numbers.

Could you please help me writing code for above system or provide some code snippet?

Thanks.

rapierrz July 8, 2016 13:52

Hi cute,

For adding this equation in openfoam you can see other solvers,

For example you can see this tutorial:

https://openfoamwiki.net/index.php/H...ure_to_icoFoam

for coupling of two equation you can use of a corrector loop and solve

two equation and correct them with some iteration.

cute July 8, 2016 14:52

Thanks rapierrz. Yes, I have seen this tutorial and used it to solve the PDEs using segregated method. But now, I want to store these equations into one matrix and then solve, i.e. coupling method. In my another post, alexeym suggested that "write them in coupled manner, i.e. q = ||C, X||, and then write your equations in terms of q. Then you introduce volVector2DField and solve equation as usual, or just use volVectorField assuming third component as 0."

http://www.cfd-online.com/Forums/ope...tml#post608481 (post#15)

I have a difficulty of implementing in a coupled manner as suggest by alexeym. If someone can provide the starter code that would be helpful.

Thanks.

cute July 11, 2016 07:52

Anyone has any suggestion?

hk318i July 11, 2016 09:12

Hello,

I cannot give you a complete answer but you may need to check foam-ext. It has a coupled solver. Also, you may try something like Vector-Coupled solver [LINK] in OpenFOAM

cute July 11, 2016 15:09

Thanks for pointing these two links, I will definitely try these two links and will update you.

cute July 11, 2016 16:35

what is foam-ext? Where can I find this?

hk318i July 12, 2016 05:07

Quote:

Originally Posted by cute (Post 608943)
what is foam-ext? Where can I find this?

foam-extend

cute July 12, 2016 19:42

Thanks Hassan Kaseem.

I found blockMatrix package that I am trying to install on my machine under openfoam-3.0.1. When I execute wmake command, I get following errors. How can I fix these errors?

Code:

In file included from BlockLduMatrix/BlockLduMatrix.H:471:0,
                from BlockLduMatrix/scalarBlockLduMatrix.H:42,
                from BlockLduMatrix/blockLduMatrices.H:39,
                from BlockLduMatrix/blockLduMatrices.C:33:
BlockLduMatrix/BlockLduMatrix.C: In constructor ‘Foam::BlockLduMatrix<Type>::BlockLduMatrix(const Foam::lduMesh&)’:
BlockLduMatrix/BlockLduMatrix.C:58:32: error: ‘const class Foam::lduAddressing’ has no member named ‘nPatches’
    coupleUpper_(ldu.lduAddr().nPatches()),
                                ^
BlockLduMatrix/BlockLduMatrix.C:59:32: error: ‘const class Foam::lduAddressing’ has no member named ‘nPatches’
    coupleLower_(ldu.lduAddr().nPatches()),
                                ^
make: *** [Make/linux64Gcc49DPInt32Opt/BlockLduMatrix/blockLduMatrices.o] Error 1


hk318i July 13, 2016 06:39

Unfortunately, there is no direct way to compile foam-extend code in OpenFOAM. There are major differences between the two forks. You can use foam-extend as it is or you can try to port the code which could mean reimplementing the complete library and solver in OpenFOAM.

cute July 13, 2016 06:57

hmmm... so it is not that easy to use coupled solver.
As a beginner, it would be difficult to reimplement the library and solver. :confused:
I am curious to know:
(1) why it is still not included in the current version of openfoam? is it difficult?
(2) what others are doing, if they need coupled solver?

hk318i July 13, 2016 07:25

This topic is discussed here few times and I know it is not easy to port the code even for experienced user. Here are two links to gives you some background. olaFoam & this thread

Regarding the second question, some users just using the version which satisfy their needs. Some of them have the manpower and time to implement their needs then they may or may not share their code. As I understand from OpenCFD website, coupled solver is underdevelopment.


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