CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

flux limiter involving tensor : How to use fvc::flux() with volTensorField ?

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

Like Tree3Likes
  • 3 Post By Cyp

Reply
 
LinkBack Thread Tools Display Modes
Old   December 21, 2010, 06:57
Default flux limiter involving tensor : How to use fvc::flux() with volTensorField ?
  #1
Cyp
Senior Member
 
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 229
Rep Power: 9
Cyp is on a distinguished road
Hi!

I am trying to build a flux from the fvc::flux() function with an volTensorField. The aim is to use flux limiter such as vanLeer scheme.

For a volScalarField I use:
Code:
volScalarField fS = blahblah;
surfaceScalarField phi = linearInterpolate(U) & mesh.Sf();
surfaceScalarField phiS = fvc::flux(phi,fS,sScheme);
It perfectly works.

Now I want to replace the volScalarField fS with a volTensorField TfS but
Code:
volTensorField TfS = blahblah;
surfaceScalarField phiS = fvc::flux(phi,TfS,sScheme);
doesn't work. It even does not compile because fvc::flux() is not coded for volTensorField.

I can replace the previous snippet of code by:
Code:
volTensorField TfS = blahblah;
 surfaceScalarField phiS = linearInterpolate(U&TfS) & mesh.Sf();
It compiles but this snippet doesn't allow us to choose a flux limiter.

Do you know a trick to do such a thing ?
Thank you very much for your help,
Cyp
Cyp is offline   Reply With Quote

Old   January 3, 2011, 06:05
Default
  #2
Cyp
Senior Member
 
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 229
Rep Power: 9
Cyp is on a distinguished road
Hi!

I am still facing this problem.

Does anyone have an idea to solve this issue ?


Best regards,
Cyp

(and happy new year!)
Cyp is offline   Reply With Quote

Old   January 21, 2011, 05:36
Default
  #3
Cyp
Senior Member
 
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 229
Rep Power: 9
Cyp is on a distinguished road
Hi!

Here is the solution I found out to use tensor with the fvc::flux() object. Since fvc::flux() doesn't seem to be adapted to volTensorField, I turn the tensor formulation to a sum of scalarField formulation. Hence I can use fvc::flux().

U = Ux + Uy + Uz
fS&U = fSxx*Ux+fSyx*Ux+fSzx*Ux + fSxy*Uy+fSyy*Uy + ......

Firstly, I need to get the surfacic flux of each component of the velocity field:
Code:
        phi_x = linearInterpolate(U.component(vector::X)*vector(1,0,0)) & mesh.Sf();
        phi_y = linearInterpolate(U.component(vector::Y)*vector(0,1,0)) & mesh.Sf();
        phi_z = linearInterpolate(U.component(vector::Z)*vector(0,0,1)) & mesh.Sf();
I am not sure it is the best way to do but it seems to work. However, an odd thing is that phi-(phi_x+phi_y+phi_z) doesn't return exactly 0.0 ..


Then, I defined a surfaceScalarField which is based on the sum of volScalarField:
Code:
surfaceScalarField phiS =         fvc::flux(phi_x,fSb.component(tensor::XX),sScheme)
                  + fvc::flux(phi_x,fSb.component(tensor::YX),sScheme)
                  + fvc::flux(phi_x,fSb.component(tensor::ZX),sScheme)

                  + fvc::flux(phi_y,fSb.component(tensor::XY),sScheme)
                  + fvc::flux(phi_y,fSb.component(tensor::YY),sScheme)
                  + fvc::flux(phi_y,fSb.component(tensor::ZY),sScheme)

                  + fvc::flux(phi_z,fSb.component(tensor::XZ),sScheme)
                  + fvc::flux(phi_z,fSb.component(tensor::YZ),sScheme)
                  + fvc::flux(phi_z,fSb.component(tensor::ZZ),sScheme);
This method works on simple test cases where the tensor is isotropic. However, I still have problem with more elaborated problems. I guess the problems come from the boundary conditions..

I hope the snippet above could some of you,

Best regards,
Cyp
Cyp is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ultimate Flux Limiter gentela Main CFD Forum 0 October 3, 2010 03:43
Lax-Wendroff flux, using any flux limiter mcaro Main CFD Forum 1 September 30, 2010 11:37
Slope limiter vs. Flux limiter jinwon park Main CFD Forum 3 September 11, 2007 10:55
the flux limiter prapanj Main CFD Forum 4 October 14, 2006 23:08
Flux Limiter Q. Liu Main CFD Forum 4 August 6, 1999 22:36


All times are GMT -4. The time now is 18:16.