CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Understanding sourcecode of solvers (https://www.cfd-online.com/Forums/openfoam-solving/58652-understanding-sourcecode-solvers.html)

 karen August 14, 2008 03:19

Hi all, because I want to w

Hi all,

because I want to write an own solver, I'm trying to understand some basics in the sourcecode of existing solvers.
In this context I have some problems. Perhaps someone can help me to understand the following:
In the the time-loop of the laplacianFoam solver
(in \$WM_PROJECT_DIR/application/solver/basic/laplacianFoam/laplacianFoam.C) there is one more loop:

for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
solve
(
fvm::ddt(T)-fvm::laplacian(DT,T)
);
}

I don't understand how the loop can do some correction. Why I don't get the same result without the loop. For me it seems like doing nNonOrthCorr-times the same thing. In this context perhaps someone can tell me, what's wrong with the following:

1. fvm::ddt(T)-fvm::laplacian(DT,T) discretizes the differential equation with the schemes given in the fvSchemes-file -> result is a linear equation system
2. solve (...) solves the in 1. obtained equation system with the solver given in fvSolution-file. You get a solution for the "next timestep" with the correctness specified in the fvSolution-file about tolerance? And now? Is this solution used as a new initial-value for the next step in the "nonOrth-loop"? But why the solver starts then to calculate, if the tolerance - given in fvSolution-file - is reached in the step before?

I guess I don't understand something very basically. Please, can someone help me?

Karen

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