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

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

 October 18, 2016, 20:41 Calculation of a custom flux through the interface of a two phase flow #1 Member   Arsalan Join Date: Jul 2014 Posts: 74 Rep Power: 10 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: where D is a transport property like rho that added to the solver, T is an added variable like temperature, is the volume fraction and 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 14:18.

 October 19, 2016, 17:08 #2 Member   Arsalan Join Date: Jul 2014 Posts: 74 Rep Power: 10 I still got stuck in this problem, can anyone give some help or comment on this?! Thanks in advance, Regards.

 October 20, 2016, 13:24 #3 Senior Member   Joachim Herb Join Date: Sep 2010 Posts: 649 Rep Power: 20 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.

October 20, 2016, 17:08
#4
Member

Arsalan
Join Date: Jul 2014
Posts: 74
Rep Power: 10
Quote:
 Originally Posted by jherb 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.

 October 20, 2016, 17:11 #5 Member   Arsalan Join Date: Jul 2014 Posts: 74 Rep Power: 10 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?!

October 24, 2016, 15:31
#6
Assistant Moderator

Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 50
Quote:
 Originally Posted by arsalan.dryi 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
__________________
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

 Tags flux calculation, interface, interfoam, swak4foam, swakexpression