CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   How does "solve" method works ? (https://www.cfd-online.com/Forums/openfoam-programming-development/105818-how-does-solve-method-works.html)

 fredo490 August 9, 2012 11:33

How does "solve" method works ?

Hello everybody, I have a question about the solve and relax methods.

1) It might be stupid but how does the solve method choose the "variable" to solve ?
For example in the compressibleTwoPhaseEulerFoam solver, if we take a look at the UEqns.h file, we can see the following code :
Code:

```00029        U1Eqn = 00030        ( 00031            (scalar(1) + Cvm*rho2*alpha2/rho1)* 00032            ( 00033                fvm::ddt(alpha1, U1) 00034              + fvm::div(alphaPhi1, U1) 00035              - fvm::Sp(fvc::ddt(alpha1) + fvc::div(alphaPhi1), U1) 00036            ) 00037          - fvm::laplacian(alpha1*nuEff1, U1) 00038          + fvc::div(alpha1*Rc1) 00039          == 00040          - fvm::Sp(dragCoeff/rho1, U1) 00041          - alpha1*alpha2/rho1*(liftForce - Cvm*rho2*DDtU2) 00042        ); 00043 00044        U1Eqn.relax();```
How does it know that it has to solve U1 ? And how does it know that other variable must be "constant" ? Why not solving alpha1 ? Is it because U1 is the last argument ?

2) what is the difference between the "relax" method and the "solve" method ?