Some Very Basic Questions About icoFoam

 Register Blogs Members List Search Today's Posts Mark Forums Read

 August 18, 2020, 12:56 Some Very Basic Questions About icoFoam #1 New Member   Mohammad Khojastehmehr Join Date: Jul 2020 Posts: 19 Rep Power: 3 Hey everybody! I hope you are all doing fine! I have some basic questions about icoFoam solver. I would be greatly appreciated if you could help me with these: 1. constrainHbyA: I don't know exactly what does (constrainHbyA(rAU*UEqn.H(), U, p) do? I know to calculate HbyA, we multiply rAU by UEqn.H() but my question is what more does this constrainHbyA do and why does it need pressure and velocity fields? https://develop.openfoam.com/Develop...onstrainHbyA.H https://develop.openfoam.com/Develop...onstrainHbyA.C 2. constrainPressure(p, U, phiHbyA, rAU): How does this exactly work? it says it is done to: Code: `Update the pressure BCs to ensure flux consistency` Does it calculate the pressure at boundaries where a fixed value is not specified (zeroGradient BC for example)? if so, how exactly does it ensure flux consistency and why it needs p, U, phiHbyA and rAU? https://develop.openfoam.com/Develop...rainPressure.H https://develop.openfoam.com/Develop...rainPressure.C 3. adjustPhi(phiHbyA, U, p):: I've realized if the mass balance doesn't equal zero at boundaries, it will modify the flux at the adjustable boundary conditions (where the velocity does not have a fixed value). What I don't understand is: why do we adjust the values of phiHbyA and not phi after calculating phi by phi = phiHbyA - pEqn.flux()? what is wrong with just interpolating U values to calculate fluxes at the faces? At the end of the loop, where U is calculated, for example, when the outlet has zeroGradient BC, the velocity at the outlet patch must be equal to the velocity of the boundary mesh and the outlet flux is therefore easily calculated by multiplying outlet patch velocity by area. so when we adjust phi, do we adjust this outlet flux? it is okay to manually change this value to ensure mass balance? It does not make sense to me! https://develop.openfoam.com/Develop...hi/adjustPhi.H https://develop.openfoam.com/Develop...hi/adjustPhi.C After all, it seems I have some problem understanding flux consistency. Any enlightenment would be most welcome! Thank you all, Mohammad Last edited by MCrossover97; August 20, 2020 at 14:37.

 December 29, 2020, 12:38 #2 Senior Member   Domenico Lahaye Join Date: Dec 2013 Posts: 429 Blog Entries: 1 Rep Power: 13 Below partial answers only. Definitely requires more attention. More information is at Section 2.2.3 of https://openfoamwiki.net/index.php/S...ssure_equation 1. constrainHbyA Modifies the mass flux HbyA = rAU*UEqn.H (denoted by mDot on monograph by Moukalled e.a.) on non-assignable velocity boundary patches with data contained in those patches. Not sure why. Not sure whether Rhie-Chow interpolation is included in UEqn.H. Possibly one should look into how UEqn.H is computed. Not sure when a velocity patch is assignable. Pressure and velocity fields passed as input only. 2. constrainPressure(p, U, phiHbyA, rAU) Updates the pressure on those boundary patches on which a pressure flux is imposed. p is passed as argument because p on the boundary is modified. U, phiHbyA and rAU are passed as input only. 3. adjustPhi(phiHbyA, U, p) Description: For cases which do no have a pressure boundary adjust the balance of fluxes to obey continuity. Return true if the domain is closed. MCrossover97 likes this. Last edited by dlahaye; December 29, 2020 at 13:16. Reason: Found additional information after initial post

 January 6, 2021, 08:50 #3 New Member   Mohammad Khojastehmehr Join Date: Jul 2020 Posts: 19 Rep Power: 3 Thank you for your answers, Domenico! I will study the link. dlahaye likes this.

 Tags continuity, icofoam, piso