CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Forcing update on boundary fields after each iteration (https://www.cfd-online.com/Forums/openfoam-solving/206661-forcing-update-boundary-fields-after-each-iteration.html)

pvpnrao September 10, 2018 19:43

Forcing update on boundary fields after each iteration
 
I am using pimplefoam in Openfoam 5.x.
The boundary condition seems to update only once per timestep.



I need this updating to take place after each pimple loop as well as at the end of the time-step.



Can some one suggest how to edit pimpleFoam to achieve this?

pvpnrao September 11, 2018 10:18

Any clues?

simrego September 11, 2018 10:42

Hi!


As i know it is updated in every equation solving. Check the code or just simply write a pretty dummy coded BC, for example:

https://cpp.openfoam.org/v6/classFoa...d.html#details
just set operator==(0);
and use as a pressure BC at outlet.

and also write out that the BC is evaluated before operator==;

ie:
Info<< "Here is my BC again..." << endl;


If you see this message, your BC is evaluated. You will see this message a lot in the logs!

pvpnrao September 11, 2018 11:27

simrego


Thank you very much for the quick response.



I am printing the area averaged pressure at inlet boundary after each pimple loop. The inlet pressure fluctualtes in the first few pimple loops then settles for a fixed negative value for rest of the PIMPLE iterations.



I am intializing the case with converveged solution from a steady state run . The areaAverageInletPressure at the begining of the first time step shows the initial pressure. But the solution does not reach the same pressure at the end of the time step. At least in the first timestep I expect the inlet pressure to be equal to the initialized value.


My cluster system is under maintenence today, i will post the iteration log ASAP.
Meanwhile, any comments or suggestions will be helpful.

Santiago September 11, 2018 11:53

Quote:

Originally Posted by pvpnrao (Post 706086)
simrego


Thank you very much for the quick response.



I am printing the area averaged pressure at inlet boundary after each pimple loop. The inlet pressure fluctualtes in the first few pimple loops then settles for a fixed negative value for rest of the PIMPLE iterations.



I am intializing the case with converveged solution from a steady state run . The areaAverageInletPressure at the begining of the first time step shows the initial pressure. But the solution does not reach the same pressure at the end of the time step. At least in the first timestep I expect the inlet pressure to be equal to the initialized value.


My cluster system is under maintenence today, i will post the iteration log ASAP.
Meanwhile, any comments or suggestions will be helpful.

There is a class member in geometrciFields called correctBoundaryConditions()

So, if you write

U.correctBoundaryConditions();

Youll get what you intend.

pvpnrao September 11, 2018 12:10

Santiago


I tried this option, please see the code below. I dont know whether I placed the code within the proper loop or not. Nonetheless, it did not work. Please suggest if needs to be placed somewhere else:


// --- Pressure-velocity PIMPLE corrector loop
while (pimple.loop())
{
#include "UEqn.H"

// --- Pressure corrector loop
while (pimple.correct())
{
#include "pEqn.H"
}

if (pimple.turbCorr())
{
laminarTransport.correct();
turbulence->correct();
}
U.correctBoundaryConditions();
}


Furthermore this systax is present in the list one of pEqn.H. So, I guess it is already being executed, but I could not see any difference.


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