fvc::interpolate -> harmonic interpolation?
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:
|
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 |
Hi Stefan,
Thanks for your reply! Quote:
As you write, I also thought of changing schemes in fvSchemes: Quote:
Code:
interpolationSchemes Code:
Interpolation dsicretization schemes: Code:
|
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 Have a lot of fun, Stefan |
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 |
@ Stefan:
Quote:
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 |
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"); 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. |
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?:confused: Cheers, Deji |
face value of a parameter
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? |
All times are GMT -4. The time now is 19:05. |