CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

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

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 6, 2016, 10:26
Default How to calculate the flux of this term grad(alpha1)*alphaf*U?
  #1
Senior Member
 
David Long
Join Date: May 2012
Location: Germany
Posts: 104
Rep Power: 13
keepfit is on a distinguished road
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):



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::snGrad(alpha1));
                                                                                                                  ^
alphaEqn.H:16:69: note: candidates are: ...........
I have tried a bot of combinations, but none is working. Any advice to calculate alphaf*grad(alpha1)?

Thanks in advance.
keepfit is offline   Reply With Quote

Old   June 7, 2016, 05:37
Default
  #2
New Member
 
Balajee
Join Date: Dec 2013
Posts: 13
Rep Power: 12
bala_gk1988 is on a distinguished road
Code:
U*afGrada1
Both U and afGrada1 are volVectorFields. You are taking outer product of those two vector fields, which produces a volTensorField.

The inner product of that volTensorField with mesh.Sf()should produce a vector field not a scalar field.
bala_gk1988 is offline   Reply With Quote

Old   June 9, 2016, 15:08
Default
  #3
Senior Member
 
David Long
Join Date: May 2012
Location: Germany
Posts: 104
Rep Power: 13
keepfit is on a distinguished road
Quote:
Originally Posted by bala_gk1988 View Post
Code:
U*afGrada1
Both U and afGrada1 are volVectorFields. You are taking outer product of those two vector fields, which produces a volTensorField.

The inner product of that volTensorField with mesh.Sf()should produce a vector field not a scalar field.
thanks for your reply, bala_gk1988!

I was not aware of this problem. I tried the following code (no compile error)

Code:
volVectorField afGrada1("afGrada1", a1af*fvc::grad(alpha1));
volScalarField afGrada1U("afGrada1U", afGrada1&U);
surfaceScalarField Phi_afGrada1Uf("Phi_afGrada1Uf", fvc::interpolate(afGrada1U) * mesh.magSf());
however, it seems the result of Phi_afGrada1Uf is not compatible with fvc::flux(a, b, scheme).

Code:
LHS and RHS of + have different dimensions
     dimensions : [0 3 -1 0 0 0 0] + [0 2 -1 0 0 0 0]
it seems that i need to dig into the fvc:flux(...) code
keepfit is offline   Reply With Quote

Reply


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
Hi please tell me how can calculate heat flux in duct ? is draw line on surface ? reslan FLUENT 0 February 26, 2016 16:27
Hi i need to find surface heat flux is draw line on surface to calculate hlocal? reslan FLUENT 0 February 25, 2016 17:21
An error has occurred in cfx5solve: volo87 CFX 5 June 14, 2013 17:44
Calculate diameter of a 3D vessel as a function of flux, Re and Wall shear stress kamran_kibria Main CFD Forum 0 October 20, 2010 16:38
How to calculate the flux? YW FLUENT 2 November 10, 2003 13:45


All times are GMT -4. The time now is 11:34.