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/)
-   -   pimple corr reset (https://www.cfd-online.com/Forums/openfoam-programming-development/154673-pimple-corr-reset.html)

danny123 June 18, 2015 09:14

pimple corr reset
 
Hello

Pimple.loop() is a flag that is true as long the pimple loops runs. If have added additional booleans to it to improve some stuff like stopping the loop if there is no convergence. The problem now is that corr_ is not reset to zero. I have tried something like:

Code:

pimple.corr() = 0;
but this object cannot be overwritten. corr() is also defined in solutionControl.H , but I have not found how it can be reset.

Thanks if somebody could give me a hint.

Regards,

Daniel

danny123 June 19, 2015 11:24

Since nobody seems to be interested on this topic, I found a solution myself, however not that elegant. I just copied the loop() object in pimpleControl.C and created a new one like this:

Code:

bool Foam::pimpleControl::resetcorr()
{
    read();

    corr_=0;

    return false;
}

Obviously this object needs to be declared in pimpleControl.H too. You then can just call it in the application solver and it resets corr to 0.

I do not check if the read statement is really necessary, but at least it does not hurt. If there is a better way, please post it.


All times are GMT -4. The time now is 11:14.