I'm trying to make some modification in the code of openfoam. I'm using a solver based on pisofoam and simulate a channel with water flowing in it and I need to calculate a function that is dependent on the water depth (H).
My question is: how can I access to the values of H at everytime step? Or how I can calculate? I need the value of the water depth to perform other calculations, any ideas would be really helpful.
Thank you in advance.
In the link below, you'll find the document and the files in which the effect of gravity is added to an incompressible solver, simpleFoam. The document Appendix.PDF has the details on modifications made to simpleFoam and the folder simpleGravityFoam has the source codes to the modified solver.
However, if you're looking to find the water depth from it's free surface, you'd need a multiphase solver. Only then can the solver understand the location of the free surface to calculate the water depth from.
I hope this helps.
I am working with OpenFOAM. I wonder that whether it is possible to calculate water depth and free surface elevation (scalar variables) in EnSight.