CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   How to calculate the flux of this term grad(alpha1)*alphaf*U? (https://www.cfd-online.com/Forums/openfoam/172795-how-calculate-flux-term-grad-alpha1-alphaf-u.html)

keepfit June 6, 2016 10:42

How to calculate the flux of this term --- grad(alpha1)*alphaf*U?
 
Hi Foamers,

I am working on a modified solver based on interFoam, having problem to calculate the flux of the following term (in modified VOF method):

https://66.media.tumblr.com/09e03f7c...ssaho1_250.png

where alpha1 is the liquid phase volume fraction, alphaf the fluid volume fraction, and U the fluid velocity. The term alphaf is introduced because there is a third phase: solid.

To calculate the flux of this term, I tried the following code:
Code:

volVectorField afGrada1("afGrada1", alphaf*fvc::grad(alpha1));
//volVectorField afGrada1("afGrada1", alphaf*fvc::snGrad(alpha1));
surfaceScalarField afGrada1Uf(fvc::interpolate(U*afGrada1) & mesh.Sf());

But it seems that there is a problem on the gradient of alpha1.

Code:

alphaEqn.H: In function ‘int main(int, char**)’:
alphaEqn.H:16:69: error: no matching function for call to ‘Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>::GeometricField(const char [9], Foam::tmp<Foam::Field<double> >)’
 volVectorField afGrada1("afGrada1", alphaf*fvc::grad(alpha1));
                                                            ^
alphaEqn.H:16:69: note: candidates are: ...........

I have tried a lot of combinations, but none is working. Any idea to calculate the flux of alphaf*grad(alpha1)*U?

Thanks in advance.

David


All times are GMT -4. The time now is 09:40.