flow rate correction in timeVaryingMappedFixedValue
Hi all, hope everyone is doing good.
I am using timeVaryingMappedFixedValue BC within pisoFoam to introduce turbulence at an inlet. The problem is that due to spatial interpolation the flow rate (Q) varies slightly with every time step and I'd like to keep it fixed by rescaling the velocity field by a factor (Q_ideal/Q_calculated). Could someone please let me know if such a BC already exists. If not, is there an example on how to calculate the flow rate ( surfaceIntegral(v.dA) ) in an OpenFoam BC? Please consider me a beginner in OpenFoam code implementation. Thank you. |
Hi,
- I don't know any such BC - but I think it is a good idea. - An alternative may be using one of the "coded" boundary conditions. Please have a look at available documentation for these. - Just very rough, untested ideas below. Please be cautious. - First you need to compute the first time-step flow rate, and keep it throughout your simulation in order to refer back at future time steps. For example, a function (I haven't test it - it is just to give some idea, I'm afraid): Code:
scalar computeInitFlowRate(const vector& UReference) Code:
void correctFlowRate(vectorField& U, const vector& UReference) |
Hi all,
I had to create a specialisation of the template. Things seem to work now. Thanks to HPE and Marta from this post https://www.cfd-online.com/Forums/op...-registry.html Have a nice one. |
Hi
- Just as a side note, the code in my previous post should be applicable to non-planar patches as well - since the average considers only the patch-normal distance. Hope this helps. |
Hello HPE, do you mind to give a bit more hint on where and how to implement this modify? Many thanks!
|
All times are GMT -4. The time now is 18:04. |