CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   How the boundary conditions are enforced in Openfoam (https://www.cfd-online.com/Forums/openfoam/115227-how-boundary-conditions-enforced-openfoam.html)

hz283 March 26, 2013 10:28

How the boundary conditions are enforced in Openfoam
 
Hi All,

I have a question about how the boundary condition is used in the code. For example, when the momentum equation is solved, I did not find any statements to call the boundary conditions. The codes are follows:

00001 fvVectorMatrix UEqn
00002 (
00003 fvm::ddt(rho, U)
00004 + fvm::div(phi, U)
00005 + turbulence->divDevRhoReff(U)
00006 ==
00007 parcels.SU(U)
00008 + fvOptions(rho, U)
00009 );
00010
00011 UEqn.relax();
00012
00013 fvOptions.constrain(UEqn);
00014
00015 if (pimple.momentumPredictor())
00016 {
00017 solve
00018 (
00019 UEqn
00020 ==
00021 fvc::reconstruct
00022 (
00023 (
00024 - ghf*fvc::snGrad(rho)
00025 - fvc::snGrad(p_rgh)
00026 )*mesh.magSf()
00027 )
00028 );
00029
00030 fvOptions.correct(U);
00031 K = 0.5*magSqr(U);
00032 }

It seems that from the source code for pressure and energy equations, the boundary treatment does not appear in the application source files. Does anybody know where the quantities at the boundary conditions are treated?

Thanks
bestH

santiagomarquezd April 1, 2013 10:58

Hi, the boundary conditions are enforced within the solve method, prior to call the sparse solvers, check the fvMatrixSolve.C file.

Regards.


All times are GMT -4. The time now is 08:42.