# Boundary condition to simulate a compliant volume

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

 November 11, 2020, 04:25 Boundary condition to simulate a compliant volume #1 New Member   Gauteng Join Date: Jul 2020 Posts: 6 Rep Power: 4 Hello world from sunny South Africa, I am looking for help to solve what seems should be a relatively simple problem. I am new to openFOAM and have googled this particular thought but not come up with many results other than programming a new BC which seems quite daunting. I would like to define a BC that essentially acts as a compliant isentropic volume. In other words, consider the boundary as a gas balloon/accumulator/lung etc that expands and as it expands its pressure rises as the volume expands/stretches. The pressure will rise (compressing the gas) because of the compliance of the volume walls. I am not interested at this point to consider thermal effects as the process happens slowly and at low pressures (5cmH20 to 40cmH20). I define the volumes compliance as (change in volume/change in pressure). EG if the volume changes by 50ml then the pressure goes up by 5cm. The hope is to model a lung without the computational overhead of: -Modelling the actual volume as a 'static' mesh and running a compressible solver -Modelling a moving mesh system like a piston in a cylinder The following BC's showed potential but thought I would reach out and see if im missing something simpler: - codedFixedValue (not sure this has the ability to look at dV/dT) - externalCoupled (seems most likely to work) - Possibly using an energy BC like gradientEnergy (doubt this will work) - plenumPressure (too defined for my use) - syringePressure (too defiend for my use) I think the most likely is attempting a pseudo-custom BC and emplying externalCoupled which I assume will involve a Python script to pull data from the OF results, make a calculation and then return/apply the boundary pressure based on the volume of air that has moved through the boundary. Would appreciate some insight! Thanks. mikulo likes this.

 January 19, 2021, 04:09 Any thoughts? #2 New Member   Gauteng Join Date: Jul 2020 Posts: 6 Rep Power: 4 Bump? Any thoughts?

 November 3, 2021, 02:31 #3 New Member   Gauteng Join Date: Jul 2020 Posts: 6 Rep Power: 4 Intruiging that this question has not come up before and seemingly no-one here can suggest a good solution. If anyone is interested, I did manage to get a solution working using the external coupled solver but its very inefficient due to the built in wait time delays in the OpenFOAM external solver routine. I have also found that the postProcessing routine seems to fail in calculating the correct flow through a boundary when using an adaptive mesh (which of course leads to a failed volume calculation)

 November 27, 2021, 19:18 #4 Senior Member   Joachim Herb Join Date: Sep 2010 Posts: 649 Rep Power: 20 In the OpenFOAM.com line, there seems to be a boundary conditions for this: plenumPressure https://www.openfoam.com/documentati...ary-conditions https://www.openfoam.com/documentati...d.html#details

August 22, 2022, 03:55
#5
Member

Join Date: Nov 2020
Posts: 51
Rep Power: 4
Quote:
 Originally Posted by fromanza Hello world from sunny South Africa, I am looking for help to solve what seems should be a relatively simple problem. I am new to openFOAM and have googled this particular thought but not come up with many results other than programming a new BC which seems quite daunting. I would like to define a BC that essentially acts as a compliant isentropic volume. In other words, consider the boundary as a gas balloon/accumulator/lung etc that expands and as it expands its pressure rises as the volume expands/stretches. The pressure will rise (compressing the gas) because of the compliance of the volume walls. I am not interested at this point to consider thermal effects as the process happens slowly and at low pressures (5cmH20 to 40cmH20). I define the volumes compliance as (change in volume/change in pressure). EG if the volume changes by 50ml then the pressure goes up by 5cm. The hope is to model a lung without the computational overhead of: -Modelling the actual volume as a 'static' mesh and running a compressible solver -Modelling a moving mesh system like a piston in a cylinder The following BC's showed potential but thought I would reach out and see if im missing something simpler: - codedFixedValue (not sure this has the ability to look at dV/dT) - externalCoupled (seems most likely to work) - Possibly using an energy BC like gradientEnergy (doubt this will work) - plenumPressure (too defined for my use) - syringePressure (too defiend for my use) I think the most likely is attempting a pseudo-custom BC and emplying externalCoupled which I assume will involve a Python script to pull data from the OF results, make a calculation and then return/apply the boundary pressure based on the volume of air that has moved through the boundary. Would appreciate some insight! Thanks.
I am also interested in this type of problem. Have you gotten any progress already?

Regards,
Mike

 August 22, 2022, 04:45 #6 New Member   Gauteng Join Date: Jul 2020 Posts: 6 Rep Power: 4 H Mike, Yes, I've made good progress and I've found the external coupled solution is actually quite suited for my application and desire to not fiddle with custom BC's. While its probably not the most accurate or efficient, it does what i need for now until I venture deeper into the code. There are a few tutorials on the web which should provide enough guidance. Some of the things I really like about the solution are: - the ability to adjust variables 'real-time' without having to reinitialize the simulation. - basic script language to code the external solver Some issues I havent resolved: - Cant get a dynamic mesh to work, seems to be something wrong with how the external coupled BC maps to changing mesh at the patch?? - There is a built in min 1000ms delay in the OF code to wait for the external solver so it can be inefficient I followed this: https://github.com/OpenFOAM/OpenFOAM...externalSolver Hope this helps!

 Tags balloon, boundary condition, lungs