CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (https://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   Calculate a custom flux through the interface of a two phase flow (https://www.cfd-online.com/Forums/openfoam-post-processing/178902-calculate-custom-flux-through-interface-two-phase-flow.html)

arsalan.dryi October 18, 2016 19:41

Calculation of a custom flux through the interface of a two phase flow
 
Dear Foamers,

I'm simulating a typical two-phase flow by modified interFoam solver in OF 2.3.0, well the problem is i need to calculate a custom flux ( a kind of heat flux) through the interface of two phases as follows:
F=\frac{(D\bigtriangledown T+\bigtriangledown \alpha)\overrightarrow{n}}{T}

where D is a transport property like rho that added to the solver, T is an added variable like temperature, \alpha is the volume fraction and \overrightarrow{n} is the normal to the interface.

Well with these descriptions, how the flux F could be calculated through the interface during the simulation?

Any help and comment will be greatly appreciated,
Regards,
Arsalan.

arsalan.dryi October 19, 2016 16:08

I still got stuck in this problem, can anyone give some help or comment on this?!

Thanks in advance,
Regards.

jherb October 20, 2016 12:24

You need to create a surfaceScalarField and update its values in your solver. Here is an example from simpleFoam:
https://github.com/OpenFOAM/OpenFOAM...Foam/pEqn.H#L4

arsalan.dryi October 20, 2016 16:08

Quote:

Originally Posted by jherb (Post 622278)
You need to create a surfaceScalarField and update its values in your solver. Here is an example from simpleFoam:
https://github.com/OpenFOAM/OpenFOAM...Foam/pEqn.H#L4

Hi Joachim,
Thanks for your replay, but how could I compute my flux through gas-liquid deformable interface in my solver?!
Actually I just do not understand what should I do! Please give me more details about it.

arsalan.dryi October 20, 2016 16:11

I think this flux could be calculated by using swak4Foam expressions as follows:
Code:

    createInterface
    {
        type createSampledSurface;
        outputControl timeStep;
        outputInterval 1;
        surfaceName interface;
        surface {
            type isoSurface;
            isoField alpha;
            isoValue 0.5;
            interpolate true;
                      }
    }

    Flux
    {
        type swakExpression;
        valueType surface;
        surfaceName interface;
        expression "(D*snGrad(T)+snGrad(alpha))/T";//
        accumulations (
          sum
        );
       
        verbose true;
    }

But above code returns parser error because snGrad() couldn't be used for surface value type, please correct me if I'm wrong!
Well how should I reconstruct interface that snGrad() could be used?!

gschaider October 24, 2016 14:31

Quote:

Originally Posted by arsalan.dryi (Post 622306)
I think this flux could be calculated by using swak4Foam expressions as follows:
Code:

    createInterface
    {
        type createSampledSurface;
        outputControl timeStep;
        outputInterval 1;
        surfaceName interface;
        surface {
            type isoSurface;
            isoField alpha;
            isoValue 0.5;
            interpolate true;
              }
    }

    Flux
    {
        type swakExpression;
        valueType surface;
    surfaceName interface;
        expression "(D*snGrad(T)+snGrad(alpha))/T";//
        accumulations (
          sum
        );
       
        verbose true;
    }

But above code returns parser error because snGrad() couldn't be used for surface value type, please correct me if I'm wrong!
Well how should I reconstruct interface that snGrad() could be used?!

Diferential operators can only be calculated on the field as a whole. So You'll have to use an expressionField-functionObject to calculate a field gradT with the value "grad(T)" and use that in your expression. To get the normal direction to the surface the normal() function should give you that. Only problem is that this is taken from the OpenFOAM-implementation. It is not guaranteed that these are consistent for neighbouring faces (face normal can point in two directions ... differing by the sign) and you might therefor get fluxes that don't make much sense. Only way to make sure that this is compensated is if you "know" soemthing about the surface that can be checked for ("sea surface always has a normal vector with a positive z component") and then you can multiply individual contributions by -1


All times are GMT -4. The time now is 20:39.