CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Post-Processing

Calculate a custom flux through the interface of a two phase flow

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree2Likes
  • 1 Post By jherb
  • 1 Post By gschaider

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 18, 2016, 19:41
Default Calculation of a custom flux through the interface of a two phase flow
  #1
Member
 
Arsalan
Join Date: Jul 2014
Posts: 74
Rep Power: 11
arsalan.dryi is on a distinguished road
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.

Last edited by arsalan.dryi; October 19, 2016 at 13:18.
arsalan.dryi is offline   Reply With Quote

Old   October 19, 2016, 16:08
Default
  #2
Member
 
Arsalan
Join Date: Jul 2014
Posts: 74
Rep Power: 11
arsalan.dryi is on a distinguished road
I still got stuck in this problem, can anyone give some help or comment on this?!

Thanks in advance,
Regards.
arsalan.dryi is offline   Reply With Quote

Old   October 20, 2016, 12:24
Default
  #3
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 21
jherb is on a distinguished road
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 likes this.
jherb is offline   Reply With Quote

Old   October 20, 2016, 16:08
Default
  #4
Member
 
Arsalan
Join Date: Jul 2014
Posts: 74
Rep Power: 11
arsalan.dryi is on a distinguished road
Quote:
Originally Posted by jherb View Post
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 is offline   Reply With Quote

Old   October 20, 2016, 16:11
Default
  #5
Member
 
Arsalan
Join Date: Jul 2014
Posts: 74
Rep Power: 11
arsalan.dryi is on a distinguished road
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?!
arsalan.dryi is offline   Reply With Quote

Old   October 24, 2016, 14:31
Default
  #6
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by arsalan.dryi View Post
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
arsalan.dryi likes this.
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Reply

Tags
flux calculation, interface, interfoam, swak4foam, swakexpression

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting rotating frame of referece. RPFigueiredo CFX 3 October 28, 2014 04:59
Radiation interface hinca CFX 15 January 26, 2014 17:11
Question about heat transfer coefficient setting for CFX Anna Tian CFX 1 June 16, 2013 06:28
mass flux in two phase flow nimasam OpenFOAM 0 December 9, 2010 03:48
compressible two phase flow in CFX4.4 youngan CFX 0 July 1, 2003 23:32


All times are GMT -4. The time now is 06:36.