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

fvc::interpolate -> harmonic interpolation?

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By herbert

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 6, 2010, 10:09
Default fvc::interpolate -> harmonic interpolation?
  #1
Senior Member
 
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 18
gwierink is on a distinguished road
Dear all,

I would like to know how OF interpolates physical properties onto faces. I know there is linear interpolation and I have seen some threads (Interpolation in OpenFOAM and About interFoam solver) on related issues, but not quite what I am looking for.
My questions are the following:
  1. How does OF interpolate physical properties (e.g. viscosity in interFoam) onto faces and where is it defined?
  2. Is there a harmonic interpolation scheme for physical properties (can fvc::interpolate be set to harmonic somehow)?
Many thanks in advance!
__________________
Regards, Gijs
gwierink is offline   Reply With Quote

Old   July 6, 2010, 11:04
Default
  #2
Senior Member
 
Stefan Herbert
Join Date: Dec 2009
Location: Darmstadt, Germany
Posts: 129
Rep Power: 17
herbert is on a distinguished road
Hi Gijsbert,

@1: I think it is always done using fvc::interpolate() (e.g. for viscosity in interFoam you can find it in src/transportModels/incompressible/incompressibleTwoPhaseMixture/twoPhaseMixture.C; member funtion mu())

@2: fvc::interpolate should read its schemes from fvSchemes-Dictionary. Therefore you should be able to apply what you think to be the best for your purpose.

Regards,
Stefan
herbert is offline   Reply With Quote

Old   July 6, 2010, 11:42
Default
  #3
Senior Member
 
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 18
gwierink is on a distinguished road
Hi Stefan,

Thanks for your reply!

Quote:
@1: I think it is always done using fvc::interpolate() (e.g. for viscosity in interFoam you can find it in src/transportModels/incompressible/incompressibleTwoPhaseMixture/twoPhaseMixture.C; member funtion mu())
In the member functions (for e.g. muf) in src/transportModels/incompressible/incompressibleTwoPhaseMixture/twoPhaseMixture.C fvc::interpolate is also used, but I can' find anywhere how things are interpolated.

As you write, I also thought of changing schemes in fvSchemes:
Quote:
@2: fvc::interpolate should read its schemes from fvSchemes-Dictionary. Therefore you should be able to apply what you think to be the best for your purpose.
But when I write
Code:
interpolationSchemes
{
    default         banana;//linear;
}
I get a list of (what seem to be) advection schemes (not face interpolation schemes (?)):
Code:
Interpolation dsicretization schemes:

Unknown discretisation scheme banana

Valid schemes are :

56
(
linear
quadraticUpwindFit
limitedCubic
limitedLinear
downwind
OSPREV
Gamma
localMax
quadraticLinearUpwindFit
outletStabilised
quadraticFit
MUSCLV
reverseLinear
GammaV
blended
UMISTV
limitWith
linearPureUpwindFit
vanLeer
vanLeerV
linearUpwind
Minmod
filteredLinear2V
MinmodV
Phi
cubic
SuperBee
filteredLinear3
biLinearFit
filteredLinear3V
quadraticLinearFit
QUICK
UMIST
limitedLinearV
SuperBeeV
weighted
skewCorrected
midPoint
vanAlbadaV
linearFit
linearUpwindV
localMin
fixedBlended
SFCDV
vanAlbada
OSPRE
MUSCL
clippedLinear
filteredLinear2
upwind
limitedCubicV
localBlended
SFCD
cubicUpwindFit
filteredLinear
QUICKV
)
In the mean time I did find a harmonic interpolation scheme in src/finiteVolume/interpolation/surfaceInterpolation/schemes/harmonic/harmonic.H. But when I plug it into the UEqn as a test (in interFoam), like below, the compiler complains that harmonic is a virtual function so it needs an object.

Code:
    
surfaceScalarField muEff
(
    "muEff",
    twoPhaseProperties.muf()
    + harmonic::interpolate(rho*turbulence->nut())
//       + fvc::interpolate(rho*turbulence->nut())
);
Would anyone have an idea about this? Am I doing something nonsensible syntax-wise? Thanks in advance!
__________________
Regards, Gijs
gwierink is offline   Reply With Quote

Old   July 6, 2010, 12:25
Default
  #4
Senior Member
 
Stefan Herbert
Join Date: Dec 2009
Location: Darmstadt, Germany
Posts: 129
Rep Power: 17
herbert is on a distinguished road
Hi Gijsbert,

the problem is, that the interpolationScheme defined in fvSchemes in used for every call of fvc::interpolate (and this are 12 in interFoam!). Some of this interpolations might not fit to the harmonic scheme. This should cause the errors and should also be the reason, why it is not listed in your banana-Test.

Nevertheless you won't have to change any piece of code I think. Instead you can specify the harmonic scheme to single operations e.g. by the following entry in fvSchemes:
Code:
interpolationSchemes
(
     default                      linear;
     interpolate(nu1)          harmonic;
     interpolate(nu2)          harmonic;
     interpolate((rho*nut))  harmonic;
)
You can test if these entries are used, by replacing harmonic by banana again.

Have a lot of fun,
Stefan
mbookin and Knusper like this.
herbert is offline   Reply With Quote

Old   July 6, 2010, 12:53
Default
  #5
Senior Member
 
Kathrin Kissling
Join Date: Mar 2009
Location: Besigheim, Germany
Posts: 134
Rep Power: 17
kathrin_kissling is on a distinguished road
Hello Gjis!!!

hope you're fine.

If you don't want this to be accessed from anywhere else you can hardcode that one as well!

tmp< GeometricField< Type, fvPatchField, volMesh > > interpolate ( const GeometricField< Type, fvPatchField, volMesh > &




const surfaceScalarField & tvf,

const word & name
)
Name than would be the name of your interpolation scheme.

Best!

Kathrin
kathrin_kissling is offline   Reply With Quote

Old   July 7, 2010, 10:17
Default
  #6
Senior Member
 
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 18
gwierink is on a distinguished road
@ Stefan:
Quote:
Some of this interpolations might not fit to the harmonic scheme
Aha, good point!
Thanks for the help, I implemented it and it works.


@ Kathrin:
Hi Kathrin, I'm fine, thanks . Hope you're well too!

Many thanks for the help. Hardcoding would perhaps be good at some point. But I am not quite clear on the snippet, so I have some (possibly dumb) questions ... For a harmonic scheme myHarmonicScheme I suppose the code goes like this:

Code:
tmp<  GeometricField<  Type,  fvPatchField,  volMesh  > > interpolate                      
(                      
const GeometricField< Type,  fvPatchField, volMesh >& const surfaceScalarField &tvf,
          const word &myHarmonicScheme
)
Isn't "tvf" a tensorVolumeField (just a guess)? Is that ok for viscosity? Also, should I then put this code into $FOAM_SRC//finiteVolume/finiteVolume/fvc/? And shouldn't there be an actual implementation of the interpolation algorithm?
__________________
Regards, Gijs
gwierink is offline   Reply With Quote

Old   January 17, 2011, 11:29
Default
  #7
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 29
akidess will become famous soon enough
Gijsbert, the snippet Kathrin showed you is already part of fvc (see openfoam documentation). You should be able to hard call a harmonic interpolation by using:

Code:
surfaceScalarField some_ssf = fvc::interpolate(some_vsf, "harmonic");
- Anton

EDIT: I just tested this, unfortunately it doesn't work. This snippet tries to find a "harmonic" entry in fvSchemes instead, which has little advantage over directly specifying the term in fvSchemes.

Last edited by akidess; January 17, 2011 at 13:01.
akidess is offline   Reply With Quote

Old   January 4, 2012, 10:52
Default
  #8
Senior Member
 
n/a
Join Date: Sep 2009
Posts: 199
Rep Power: 16
deji is on a distinguished road
Hello to all. Perhaps someone can quickly enlighten on this topic, I need to interpolate cell centered values to cell faces. The cell centered faces needed to interpolate to cell faces are near the boundary, and not really quite sure how to code it. How is this:

const fvPatchScalarField& Tw = thermo.T().boundaryField()[patchI];
const scalarField Tadj = Tw.patchInternalField();//gives T for cell adjacent to wall
surfaceScalarField Tsurf=fvc::interpolate(Tadj);


This code makes sense, but I'm not sure if it is correct. Furthermore, does the interpolation computes face values for the east, west, north, and southern faces? I need the east, west, and northern face values, so how do get those from the interpolation operation?

Cheers,
Deji
deji is offline   Reply With Quote

Old   October 1, 2012, 13:31
Default face value of a parameter
  #9
Member
 
,...
Join Date: Apr 2011
Posts: 92
Rep Power: 14
hawkeye321 is an unknown quantity at this point
Hi FOAMERS
I am trying to solve a set of equations in the following form
--------
(Density)*fvm::ddt(U)
+ (Density/gL)*fvm::div(phi, U)
- (Visc)*(fvm::laplacian(U))
- GravityVector*g*Density*((BetaT*(T-TNot))+BetaC*(C-CNot))
+ fvm::Sp(gL*Visc/Perm,U)
--------
Perm is the permeability which is calculated by the following relation

Perm[celli] = (pow(SDAS.value(),2))*pow((gL[celli]),3)/(180*(pow((1-gL[celli]),2)));

Is there any way to make sure that the permeability at the cell face is calculated by mean harmonic interpolation?
hawkeye321 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
urgent help needed (rhie-chow interpolation problem) Ardalan Main CFD Forum 2 March 18, 2011 15:22
CAD -> gMsh -> enGrid -> OpenFOAM Problem AlGates OpenFOAM 7 August 6, 2010 12:46
Post-Processing -> Interpolation of cell-centered values to vertex PCFD Tecplot 2 June 26, 2010 23:54
Surface interpolation schemes and parallelization jutta OpenFOAM Running, Solving & CFD 0 February 25, 2010 14:32
momentum interpolation for collocated grid Hadian Main CFD Forum 4 December 25, 2009 07:25


All times are GMT -4. The time now is 19:30.