|
[Sponsors] | |||||
|
|
|
#1 |
|
New Member
Join Date: Aug 2025
Posts: 7
Rep Power: 2 ![]() |
Hello everyone,
I am currently working on a simulation for my Bachelor thesis and therefore i need to do several validation tests. One of them is this one. The project is going to simulate a lineartribometer with hydrogen injection. So i need to simulate the airflow and the hydrogen injection, since i want to know how much hydrogen gets to the probe. Ok, now for the validation i simplified the BCs and disabled the airflow, since i only wanted to measure the hydrogen mass in the system over time and see how it compares to a simple analytical solution. The analytical approach is straightforward: 𝑚(𝑡 =𝑉dot⋅𝑡⋅𝜌with 𝑉dot=10^−5m3/s 𝜌=0.0899kg/m3 Temperature fixed at 20 °C For the measurement in the simulation i used this: However, the results show a clear divergence between the analytical and the simulation data (see attached figure). Question: What is it i could have done wrong? Thank you very much for your support! |
|
|
|
|
|
|
|
|
#2 |
|
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 894
Rep Power: 19 ![]() |
Well, the devil is in the detail. The bit that you are missing, perhaps, is that the pressure in the domain (which I am assuming is closed, i.e. has an inlet but no outlet) rises as you inject the hydrogen ... which changes the density in the domain.
Now, from your charts, it is clear that the rate of mass injection is not constant in your simulation ... in fact it seems to be rising slowly with time. That would make sense if you used a constant volume injection boundary conditions (eg flowRateInletVelocity and setting "volumetricFlowRate") - with that BC, you can specify a density in the BC, but the code just treats the BC as a fixed velocity injection, and uses the patch density to calculate the patch mass flow rate (check the code). The patch density is extrapolated from the field density. So with a constant volume injection, one would expect a rising mass injection as the domain density rises. Your analytical model assumes a constant mass injection, which is why you have a perfectly straight line, i.e. you are comparing apples and pears. |
|
|
|
|
|
|
|
|
#3 |
|
New Member
Join Date: Aug 2025
Posts: 7
Rep Power: 2 ![]() |
Hi Tobermory, thank you for your reply.
I attached a picture with the bcs of the domain. Its mostly open, with walls on top and on the bottom. And i attached a graph of the velocity next to one hydrogen inlet measured with the probe function. Not exactly at the hydrogen bc. I dont know why the inlet velocity seems to fluctuate this much. Since i want to know the hydrogen content next to a certain line in the simulation, i wanted to show that the hydrogen mass correlates with a simple analytic calculation. The airflow coming from the airInlets is folowing a sine function to simulate a moving piston. They work as outlets at negative values. But why does it flucuate? Its a fixedValue with a 1,623m/s hydrogen stream. |
|
|
|
|
|
|
|
|
#4 |
|
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 894
Rep Power: 19 ![]() |
Well, solutions can fluctuate - either due to a physical transient oscillation (jets often waggle; vortex shedding; etc etc.), or due to instability in the CFD solution (i.e. unphysical effect). Impossible to tell here without digging into the simulation details, but here are some things to think about:
1. Do you expect any flow unsetadiness for your scenario? Do you have expt data for a similar scenario to confirm? 2. If you are sure that the flow is steady, then you need to look at your solver setup ... if running as steady state, then typical remedies might be to increase the under-relaxation; run 1st order divSchemes and then change to 2nd order; improve the mesh; apply increased turbulence levels at the inlets, and then maybe relax back to "Normal" values once the solution is well converged and see if the convergence remains. If running as transient, then adjust your time step, and try some of the other remedies listed above. Hope that helps - good luck. |
|
|
|
|
|
|
|
|
#5 |
|
New Member
Join Date: Aug 2025
Posts: 7
Rep Power: 2 ![]() |
Hi,
thanks for your input! Its an transient simulation. Sadly i have no experimental data for this simulation. But i dont think at first glance i would expect such a behavior. But from what i seeing the slowest velocity occurs everytime the airflow reaches its maximum. So it seems like the air is impeding the hydrogen. Something i didnt think would happen considering the fixedValue Bc. Outside of a simulation i think its realistic to assume this velocity is influenced by the speed of the airflow its hitting. I mean this behavior is fine as long as a can explain why its happening. This i cannot as of right now. |
|
|
|
|
|
|
|
|
#6 |
|
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 894
Rep Power: 19 ![]() |
How close to the inlet is your probe? If it is far downstream, or if the inlet jet is deflected then your probe may not be in the centre of the jet? I guess you've alreadfy checked that. Incidentally, you can get OF to output the actual flow rate through each inlet using a function object (flowRatePatch in OF13 ... not sure what version you are using, but there will be a similar function). This might be worth checking.
If the inlet flow rate is really fluctuating, then agreed - this sounds odd for a fixedValue BC. Can you post your 0/U 0/p 0/prgh and 0/T files? There might be something in there that I or someone else can spot that's funny. |
|
|
|
|
|
|
|
|
#7 |
|
New Member
Join Date: Aug 2025
Posts: 7
Rep Power: 2 ![]() |
Hi,
The first probe in the Uprobes.txt is located next to the air inlet. The domain is 0,0027m high with the second probe 0.000001m below the hydrogen inlet. Here you can see the fluctuating Uy. The third probe sits directly at the hydrogen inlet. Which shows the Uy= -1.623m/s from the U file. In the Uprobes u can see the velocity difference that happens within this pretty small distance. I try to attach the other files too. |
|
|
|
|
|
|
|
|
#8 |
|
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 894
Rep Power: 19 ![]() |
Okay, so the probe in the H2 inlet shows a steady velocity, but as you move away from the inlet plane the jet velocity becomes more erratic - see my chart of your data below.
That's as expected, I think, given that H2 is so much lighter than the air that it is trying to penetrate. Check your Courant number, turbulence model, mesh resolution, but otherwise I think the code is behaving asa expected? |
|
|
|
|
|
|
|
|
#9 |
|
New Member
Join Date: Aug 2025
Posts: 7
Rep Power: 2 ![]() |
I expected a maxing out of the inlet velovity at highest airspeeds due to static pressure probably being lower at higher velocity. But another proberun with pressure shows lowest h inlet velocity at times of highest pressure. Thats to be expected i think.
But the hydrogen bc doesnt fluctuate (that means it enters the domain nevertheless), so why is my analytical solution diverging so hard from my simulation? Is my analytical approach trash? My missing explanation for this is my final obstacle. Courant number is at 0.3. The mesh was choosen with a mesh convergence study. |
|
|
|
|
|
|
|
|
#10 |
|
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 894
Rep Power: 19 ![]() |
What is your boundary condition (U, T, p) for the hydrogen inlet(s)? I am guessing that you have a fixedValue for velocity, right? If yes, then all that means is that the volume flow rate of hydrogen into the domain is constant.
Can you please run postProcess to calculate the mass flow rate through the inlets for your latest run (the name of the function object varies I think between OF versions, but should be something like flowRatePatch). This is the key variable. I am guessing that this is fluctuating strongly (because the inlet pressure and therefore density is fluctuating). If that is the case, then it's simply solved by changing the H2 inlet BC to a fixed mass flow condition (eg flowRateInletVelocity). |
|
|
|
|
|
|
|
|
#11 |
|
New Member
Join Date: Aug 2025
Posts: 7
Rep Power: 2 ![]() |
Here are the the definitions for the hydrogen Inlet:
U: hydrogenInlet { type fixedValue; value uniform (0 -1.623 0); } p: hydrogenInlet { type fixedValue; value uniform 1e5; } T: hydrogenInlet { type fixedValue; value uniform 293.15; } very standard bcs id say I use velocity for the bc now because it didnt matter to the results. Ive tried velocity, volumeflow and massflow for the hydrogen inlet. The velocity diagrams all look the same. (Example for mflow in the attatchments) Ill calculate the mass flow rate of the inlets later this day. |
|
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Turbomachinery Mass imbalance | sheaker | CFX | 12 | September 5, 2019 09:09 |
| Mass Source application and strange phenomena | JPBLourenco | FLUENT | 0 | June 27, 2019 09:36 |
| Multiphase flow - incorrect velocity on inlet | Mike_Tom | CFX | 6 | September 29, 2016 02:27 |
| Exit Corrected Mass Flow Rate Mesh Sensitivity Study | s__s__s | CFX | 4 | July 20, 2016 12:46 |
| Water subcooled boiling | Attesz | CFX | 7 | January 5, 2013 04:32 |