|
[Sponsors] |
March 9, 2021, 14:38 |
Hydrogen Tank Filling - Advice
|
#1 |
New Member
Luis
Join Date: Sep 2020
Posts: 9
Rep Power: 6 |
Hi,
I was wondering if someone could guide me regarding an issue I had for the past days. I'm relatively new to CFD/openFOAM. I need to simulate the filling process of a hydrogen tank and see how the temperature and pressure field develops. I'm using OF5 for this, and attached are my case files in case they're needed. (I generated my mesh in Gmsh, so my .msh file is attached too and needs to be converted with (gmshToFoam") The issue is that the simulation appears to run without any problem, but the temperature and pressure rise inside the tank is very small (almost nothing) regardless if I use a low or high mass flow rate inlet. After studying, searching and debugging for a few weeks I could make the case run without crashing, still my temp and pressure do not appear to rise as expected for a hydrogen tank filling process I try to validate my set up by replicating other papers for the same tank filling scenario where CFD was used, but without success yet. I think this might be an issue with my boundary conditions, especially p and U. But I've try several types and combinations and still my problem remains. I would really appreciate if someone with more experience could guide me a little bit here. Thanks. Code:
/*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 7 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [1 -1 -2 0 0 0 0]; internalField uniform 1e6; boundaryField { inlet { type zeroGradient; } upperWall { type zeroGradient; } lowerWall { type zeroGradient; } rightWall { type zeroGradient; } leftWall { type zeroGradient; } defaultFaces { type empty; } } Code:
\*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volVectorField; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 0); boundaryField { inlet { type flowRateInletVelocity; massFlowRate 0.1; //rho rho; //rhoInlet 0.0887; value uniform (0 0 0); } upperWall { type noSlip; } lowerWall { type noSlip; } rightWall { type noSlip; } leftWall { type noSlip; } defaultFaces { type empty; } } Code:
/*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 7 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; object T; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 0 0 1 0 0 0]; internalField uniform 298.15; boundaryField { inlet { type fixedValue; value uniform 273.15; } upperWall { //type zeroGradient; type externalWallHeatFluxTemperature; mode coefficient; Ta uniform 298.15; thicknessLayers (0.005 0.02); kappaLayers (0.4 0.53); kappaMethod fluidThermo; h uniform 10; value $internalField; //initial temperature kappaMethod fluidThermo; } lowerWall { //type zeroGradient; type externalWallHeatFluxTemperature; mode coefficient; Ta uniform 298.15; thicknessLayers (0.005 0.02); kappaLayers (0.4 0.53); kappaMethod fluidThermo; h uniform 10; value $internalField; //initial temperature kappaMethod fluidThermo; } rightWall { //type zeroGradient; type externalWallHeatFluxTemperature; mode coefficient; Ta uniform 298.15; thicknessLayers (0.005 0.02); kappaLayers (0.4 0.53); kappaMethod fluidThermo; h uniform 10; value $internalField; //initial temperature kappaMethod fluidThermo; } leftWall { //type zeroGradient; type externalWallHeatFluxTemperature; mode coefficient; Ta uniform 298.15; thicknessLayers (0.005 0.02); kappaLayers (0.4 0.53); kappaMethod fluidThermo; h uniform 10; value $internalField; //initial temperature kappaMethod fluidThermo; } defaultFaces { type empty; } } Code:
/*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 7 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "constant"; object thermophysicalProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // thermoType { type hePsiThermo; mixture pureMixture; transport polynomial; thermo hPolynomial; equationOfState PengRobinsonGas; specie specie; energy sensibleEnthalpy; } mixture { equationOfState { Tc 32.994; Vc 65.5e-3; Pc 1293920.25; Zc 0.309; omega -0.220; } specie { molWeight 2.016; } thermodynamics { Hf 0; Sf 0; CpCoeffs<8> (6436.5105 63.161307 -0.1685728 1.5229265e-04 0 0 0 0); } transport { muCoeffs<8> ( -0.135666 6.84115878e-02 -3.928747e-04 1.8996e-06 -5.23104e-09 7.4490972e-12 -4.250937e-15 0 ); kappaCoeffs<8> ( 2.009705e-02 3.234622e-04 2.1637249e-06 -6.49151204e-09 5.52407932e-12 0 0 0 ); } } // ************************************************************************* // Last edited by mexicalense; March 11, 2021 at 10:02. |
|
March 11, 2021, 09:59 |
more background
|
#2 |
New Member
Luis
Join Date: Sep 2020
Posts: 9
Rep Power: 6 |
A little update and background.
My inlet mass flow rates can range from constant 0.01 to 0.1 Kg/s. Tank dimensions are: L = 6.6 m Dia. = 0.7 m Volume = 2.5933 m^3 inlet dia. = 0.005 m The tank is designed to hold 40 Kg of hydrogen at 20 MPa (ideal gas). Using Peng Robinson EOS I calculated the real gas mass at full condition is around 34.4 Kg @ 20MPa and 333.15 K (max temp limit for tank liner) Assuming a mass flow rate of 0.1 kg/s, the filling time should be around 343 seconds. That's how long I set my simulation time. But as you can see in the picture, at the end time although the temperature rise seem appropriate, the pressure only increases by 1.2 MPa from the tank initial pressure condition of 1 MPa and 298.15 K |
|
March 12, 2021, 04:31 |
|
#3 |
New Member
Join Date: Feb 2020
Posts: 10
Rep Power: 6 |
You're using local time stepping to calculate you solution and you're just calculating 343 iterations. LTS is just another technique to obtain a steady-state solution, its not transient. If you want to calculate the transient filling process, change it from localEuler to Euler.
|
|
March 12, 2021, 05:34 |
|
#4 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 747
Rep Power: 14 |
... or try Crank Nicholson if you want a more accurate picture of the transient behaviour. CN tends towards 2nd order (depending on how much blending you add, for stability), whilst Euler is 1st order and more "diffusive" (in time). As Sapujapu correctly points out, LTS is a pseudo-transient scheme, so the intermediate solutions before steady state are typically not physical.
|
|
March 16, 2021, 07:54 |
|
#5 |
New Member
Luis
Join Date: Sep 2020
Posts: 9
Rep Power: 6 |
Hi again
Thank you so much for your suggestions. It fixed my issue, my bad. Now the simulation looks good! I'm was searching here in the forum and other websites about how to implement gravity for the rhoCentralFoam solver. Does anyone can provide guidance about how to do that?? It seems it's not as straight forward as with BuoyantBoussinesqPimpleFoam and the other buoyancy solvers. Thanks in advanced. |
|
October 6, 2022, 08:04 |
|
#6 |
New Member
mohammad sadegh
Join Date: Apr 2011
Posts: 5
Rep Power: 15 |
Hi All,
That would be great if the issue was resolved, a brief explanation is given here such that we know how the problem was solved. Thanks |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
ANSYS Fluent Sloshing in baffled tank simulation | Fisya | CFD Freelancers | 2 | August 27, 2019 18:55 |
Filling Tank with Water | leff | CFX | 7 | August 21, 2017 08:47 |
BCs to the outlet patch (filling a simple tank) | Ternox | OpenFOAM Pre-Processing | 4 | August 21, 2017 08:19 |
Air tank filling | gsr_132 | FLUENT | 1 | June 10, 2016 04:16 |
Is it possible to simulate tank filling process in 2D (VOF Model)? | Blue | FLUENT | 0 | November 30, 2013 13:47 |