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/)
-   -   Implementing coupled transport equation (https://www.cfd-online.com/Forums/openfoam-programming-development/241659-implementing-coupled-transport-equation.html)

Swirl March 11, 2022 11:40

Implementing coupled transport equation
 
Hello everyone,


I am currently trying to implement two additional, coupled transport equations to the reactingFoam solver. I know how to add and solve for equations generally, though I am not sure how to correctly implement the coupled nature of those equations.


The first equation is a regular scalar transport equation with a instationary, convective and diffusion tem for the scalar "f". This part is straight forward.


The second transport equation for the scalar "m" also has those regular terms, but also a diffusive term as well as a source term that involve "f".


I have read about fvm:: being implicit and fvc:: being an explicit function. Would it be correct to first solve the equation for "f" and use the calculated field in the equation for "m" using fvc:: ? Or is there a way to more accurately take the coupling into account?


I hope this explanation is understandable. Would appreciate if anyone could give some input.

mAlletto March 16, 2022 15:00

OpenFOAM uses segregated solution algorithms. So one equation for each variable is solved after the other. So you have to solve for f and insert the as solution of go from the previous time step

Tobermory March 18, 2022 10:52

Just to add to Michael's answer, can I suggest that you take a look at a compressible solver like rhoSimpleFoam. The heart of this solver is

Code:

        #include "UEqn.H"
        #include "EEqn.H"
        #include "pEqn.H"

i.e. it solves the velocity momentum predictor, then solves the energy equation (thereby updating the T field, based on the old p field) and then calculates the new p field, and uses that to correct the velocity field. But of course, p and T are coupled through the equation of state, and so some approximation was necessary with this segregated approach (i.e. p and T are out of sync slightly). In a truly coupled solver, p & T would be solved simultaneously ... but as Michael explains, OF does not contain such a solver (as far as I am aware).

You can draw a direct analogy to your problem, from the above, Hope that helps.

mAlletto March 18, 2022 10:57

Foam extend has block coupled solver which allows to solve for multiple variables at once. The com and org versions do not have coupled solvers

dylanmadison March 20, 2022 20:39

OpenFOAM uses segregated solution algorithms.
ultra pixel survive

Swirl March 21, 2022 03:49

Thanks for the explanations, everyone! That helps a lot.


All times are GMT -4. The time now is 01:31.