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

Add curvature term to bEqn?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 6, 2017, 08:35
Default Add curvature term to bEqn?
  #1
Member
 
Join Date: Oct 2015
Location: Finland
Posts: 39
Rep Power: 11
blttkgl is on a distinguished road
Hey all,

I am trying to modify bEqn.H file inside the XiFoam solver to add curvature effect kappa into the b scalar calculation.

the term I am trying to add is the following:

\kappa = \nabla . n

which can be written as :

-\frac{\nabla^{2}b - n.\nabla(n.\nabla b)}{abs(\nabla b)}

I want to use the already calculated b and n fields inside the bEqn.H from the following lines:
Code:
volVectorField n("n", fvc::grad(b));

    volScalarField mgb(mag(n));

    dimensionedScalar dMgb = 1.0e-3*
        (b*c*mgb)().weightedAverage(mesh.V())
       /((b*c)().weightedAverage(mesh.V()) + SMALL)
      + dimensionedScalar("ddMgb", mgb.dimensions(), SMALL);

    mgb += dMgb;

    surfaceVectorField SfHat(mesh.Sf()/mesh.magSf());
    surfaceVectorField nfVec(fvc::interpolate(n));
    nfVec += SfHat*(fvc::snGrad(b) - (SfHat & nfVec));
    nfVec /= (mag(nfVec) + dMgb);
    surfaceScalarField nf((mesh.Sf() & nfVec));
    n /= mgb;


    #include "StCorr.H"

    // Calculate turbulent flame speed flux
    // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    surfaceScalarField phiSt("phiSt", fvc::interpolate(rhou*StCorr*Su*Xi)*nf);

    scalar StCoNum = max
    (
        mesh.surfaceInterpolation::deltaCoeffs()
       *mag(phiSt)/(fvc::interpolate(rho)*mesh.magSf())
    ).value()*runTime.deltaTValue();

    Info<< "Max St-Courant Number = " << StCoNum << endl;

    // Create b equation
    // ~~~~~~~~~~~~~~~~~
    fvScalarMatrix bEqn
    (
        fvm::ddt(rho, b)
      + mvConvection->fvmDiv(phi, b)
      + fvm::div(phiSt, b)
      - fvm::Sp(fvc::div(phiSt), b)
      - fvm::laplacian(turbulence->alphaEff(), b)
     ==
        fvOptions(rho, b)
    );
can I directly go with fvm::div(n) and add it? I am new to OpenFoam programming so any help is appreciated.

-Bulut
blttkgl is offline   Reply With Quote

Reply

Tags
beqn, combustion, progress variable, surface normal, xifoam


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
How to add a source term like this!! arvind_arya OpenFOAM 1 February 11, 2011 03:34
curvature correction term, material derivative of a tensor volker OpenFOAM Programming & Development 7 June 3, 2010 09:08
add a source term in kEpsilon model maurice OpenFOAM Running, Solving & CFD 0 May 18, 2009 08:54
add a source term in incompressible k-epsilon model maurice OpenFOAM 0 May 18, 2009 02:41
How to add source term Smith FLUENT 0 January 29, 2008 09:12


All times are GMT -4. The time now is 23:45.