CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   How to set up a semi-permeable interface? (https://www.cfd-online.com/Forums/fluent/255814-how-set-up-semi-permeable-interface.html)

voidcrow April 30, 2024 13:36

How to set up a semi-permeable interface?
 
I am attempting to simulate an alkaline water electrolyzer, which has a porous separator that is supposed to block the flow of gases (hydrogen, oxygen) but not the liquid solution (water + potassium hydroxide). Here's what I tried so far, unsuccessfully:

  • Set the inverse absolute permeability (viscous resistance) of the separator to a very high value for the gas phase only. I used the FLT_MAX macro defined in float.h (DBL_MAX leads to immediate solution divergence). With FLT_MAX as the viscous resistance, the mass fraction profile obtained after convergence is not as expected, there is still a very large amount of gas inside the separator (not even close to being negligible).
  • Set both the inverse absolute permeability to a very high value and the diffusivity of the gas to a very low value (FLT_MIN) inside the separator cell zone. I did not notice a significant difference in the concentration profile obtained versus the first attempt.
  • Change the boundary condition from interior to wall. This allows me to use the zero mass flux boundary condition for the gas phase (which is what I want ultimately), but now for the liquid phase the only option I have is to set the mass fraction either as a fixed value (which it is not) or with an UDF DEFINE_PROFILE. I tried to write an UDF to set the mass fraction of the liquid species to be equal to the mass fraction found in the cell adjacent to it, using the F_C0 (or F_C1) macro to obtain the adjacent cell index. Example for water, the UDF hooked to the liquid phase:
Code:

DEFINE_PROFILE(mass_fraction_bc, t, i) {
    face_t f;
    cell_t c1;
    real y;
    begin_f_loop(f, t) {
        c1 = F_C1(f, t);
        y = C_YI(c1, t, i);
        F_PROFILE(f, t, i) = y;
    } end_f_loop(f, t)
}

This last approach doesn't work (even with the 'specified shear' condition set to 0), because the concentration of component ends up being non-zero on the wall but not in the inner cells (i.e., there is no 'flow' from the wall to the cell region).


It seems this would be something so simple to do. Any help is appreciated.


All times are GMT -4. The time now is 10:52.