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

grad of a GeometricFiel

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 31, 2018, 09:00
Default grad of a GeometricFiel
  #1
New Member
 
Join Date: May 2018
Posts: 1
Rep Power: 0
BenChaECN is on a distinguished road
Hello everyone,


I am trying to code a new surface interpolation scheme for alpha in OpenFOAM.


For this new scheme, I need to calculate the gradient of alpha.


But I have a problem. Indeed, I use the existing blended scheme as starting point. But, the argumentat at the entrance is a GeometricField<Type, fvPatchField, volMesh>. And when I am trying the command fvc::grad() (I included fvc.H) it doesn’t work.


Does someone have a solution to this problem ?
BenChaECN is offline   Reply With Quote

Old   June 2, 2018, 23:11
Default
  #2
Senior Member
 
fumiya's Avatar
 
Fumiya Nozaki
Join Date: Jun 2010
Location: Yokohama, Japan
Posts: 266
Blog Entries: 1
Rep Power: 18
fumiya is on a distinguished road
You might want to check the source code of the existing interpolation schemes that use the gradient operation such as linearUpwind:
https://github.com/OpenFOAM/OpenFOAM...s/linearUpwind

Code:
    tmp<fv::gradScheme<scalar>> gradScheme_
    (
        fv::gradScheme<scalar>::New
        (
            mesh,
            mesh.gradScheme(gradSchemeName_)
        )
    );

    for (direction cmpt = 0; cmpt < pTraits<Type>::nComponents; cmpt++)
    {
        tmp<volVectorField> tgradVf =
            gradScheme_().grad(vf.component(cmpt), gradSchemeName_);

        const volVectorField& gradVf = tgradVf();
__________________
[Personal]
fumiya is offline   Reply With Quote

Reply

Tags
geometricfiel grad scheme


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
Why define a grad Scheme when using linearUpwind? Benedikt OpenFOAM Pre-Processing 2 August 10, 2019 08:19
Drag Coefficient Gradient: 0 in 2d adjoint optimization tomp1993 SU2 Shape Design 11 August 1, 2019 15:14
Does <cache{ grad ( U ) }> affect somehow my turbulence fimbull OpenFOAM Running, Solving & CFD 0 August 1, 2017 08:20
A simple question about adding Div and Grad of a source term to the momentum equation adkar Main CFD Forum 5 May 23, 2016 17:31
gauss grad no correction for coupled boundary??!! doubtsincfd OpenFOAM 0 December 19, 2011 18:19


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