Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

Reversed flows after switching inlet boundary conditions

    • thaison.tran
      Subscriber

      Hello everyone,

      I am modeling hydrogen storage in a tank with adsorbent materials using Ansys 2023R1.

      The inlet boundary condition is initially a mass flow inlet, which automatically switches to a pressure inlet after 1 minute through a scheme command. However, Fluent crashes (floating point exception) when the set pressure at the inlet is slightly higher than the tank pressure at that time. It only accepts set pressures equal to or lower than the tank pressure. While the simulation continues to run, I observe severe reversed flow (40%-80%) at the pressure inlet boundary after the switch. I have tried reducing the time step size from 0.1s to 0.01s and lowering relaxation factors, but the issue persists. I suspect the pressure gradient caused by the heat of adsorption is affecting the solver’s ability to handle the new boundary conditions.

      I appreciate your advice and insights on this. 

      Thank you.

    • Rob
      Forum Moderator

      What is the tank pressure, and what are you setting the boundary value as relative to it? What is the hydrogen density? 

    • thaison.tran
      Subscriber

       

       

      Thanks Rob for your prompt response.

      Here I am referring the tank pressure as inlet pressure (gauge total pressure), which is set using the following scheme script.

       
      (define (change-inlet-boundary-to-pressure)
          (if (> (%rpgetvar 'flow-time) 60) 
              (begin
                  ;; Set the boundary from mass-flow-inlet to pressure-inlet
                  (ti-menu-load-string "define/boundary-conditions/zone-type inlet pressure-inlet")
                  
                  ;; Set the pressure inlet conditions: pressure = 45000 Pa (0.45 bar), temperature = 77 K
                  (ti-menu-load-string "define/boundary-conditions/pressure-inlet inlet yes no 45000 no 0 no 77 no yes")
                  
                  ;; Output a message confirming the boundary change
                  (display "Boundary condition switched to pressure inlet with pressure 45000 Pa and temperature 77 K.\n")
              )
          )
      )

       

      I created a report file to monitor gauge total pressure at the inlet so that I can adjust the set pressure in the scheme script accordingly. As for hydrogen properties, I extracted it from the REFPROP library available in Ansys into a RGP table and hook it up to the material section of hydrogen in Fluent.  

       

       

       

    • Rob
      Forum Moderator

      OK, so density is a function of pressure, good. 

      Can you check the zone temperature and Total Pressure, you may find it's a little higher than 0.45 bar.

    • thaison.tran
      Subscriber

      I checked the inlet total pressure at every time step in the report file, and even manually stopped the simulation to set the gauge total pressure equal to or slightly higher than the current value (0.46 bar). Interestingly, the switch is pretty smooth with reversed flows last for a few time steps in the case without the adsorbent material in the tank.

    • Rob
      Forum Moderator

      OK, think through what's happening. 

      The massflow inlet pushes mass into the domain at a fixed rate. As the pressure increases I would assume the velocity on the boundary drops. The tank pressure increases and something happens to move free gas into the absorpant material: is that a UDF? Setting a pressure inlet will mean the system reaches an equilibrium with outside at some point. But.... what is stopping the absorbed gas being released? 

    • thaison.tran
      Subscriber

      Thanks for the insightful thoughts, Rob.

       

      Yes, I am using a UDF to model the adsorption process. I believe what's happening is that nothing is preventing the gas from continuing to be adsorbed, leading to heat release and a pressure increase inside the tank after the switch. I’ve noticed an abnormal rise in both the adsorption mass and temperature in the tank, which could be related to the reversed flows at the inlet. I'd also expect the system to reach equilibrium at some point, but this hasn't happened even after several hundred time steps. I’m wondering if there is an option to force the solver to account for this.

    • Rob
      Forum Moderator

      How are you replicating the adsorption process? 

    • thaison.tran
      Subscriber

       

      Below are steps to replicate the adsorption process.

      1. Calculate the isotherm and kinetics of the adsorption process:

       
       
      2. Calculate the mass source term ‘sm'
       
       
       
      3. Calculate the energy source term ‘sh'
       

       

    • Rob
      Forum Moderator

      Double check the pressure boundary - you may find Total and Static pressure are causing the problem. 

      You also need to check you're dealing with the energy (heat) in the mass source as that's not automatically removed from the domain. 

    • thaison.tran
      Subscriber

      I did check and found no issues related to the total and static pressure at the inlet.

       

      Removing the energy and mass source terms appears to be impossible as it physically impact the ongoing (with the existing gas in the tank) and new (fresh gas) adsorption processes.Probably I need to avoid switching boundary conditions by adjusting the mass flow inlet stepwise to meet the capped pressure.

    • Rob
      Forum Moderator

      The sources may just need some very careful management. Part of the problem may be that as you remove mass & add heat for the process you cause more/less mass to be removed because the temperature changes: have a look at the Fluent phase change models (Eulerian and Eulerian Wall Film) models. 

Viewing 11 reply threads
  • You must be logged in to reply to this topic.