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

new divergence term in alpha1Eqn in inter Foam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 22, 2015, 09:47
Default new divergence term in alpha1Eqn in inter Foam
  #1
Senior Member
 
Daniel Witte
Join Date: Nov 2011
Posts: 148
Rep Power: 15
danny123 is on a distinguished road
Hello,

I want to add a term in alpha1Eqn in interFoam to ensure that this equation is solved when there is a gradient in alpha1. Reason: if there is no gradient, only the mass balance needs to be solved, the specy balance is not relevant.

I looked at the code for alpha1Eqn:

Code:
fvScalarMatrix alpha1Eqn
        (
            #ifdef LTSSOLVE
            fv::localEulerDdtScheme<scalar>(mesh, rDeltaT.name()).fvmDdt(alpha1)
            #else
            fv::EulerDdtScheme<scalar>(mesh).fvmDdt(alpha1)
            #endif
          + fv::gaussConvectionScheme<scalar>
            (
                mesh,
                phi,
                upwind<scalar>(mesh, phi)
            ).fvmDiv(phi, alpha1)
        );
This is in OpenFoam 2.3.x. The 2nd term is the divergence of (alpha1 phi) I understand. In order to cancel this term out in case of not changing alpha1, I want to substract alpha1 x divergence (phi). The last term will be zero if continuity is fulfilled, so the result should be the same once the whole equation system is solved.

If this would be a simple vector operation, this would be easy. However alpha1 is the unknown variable of the equation system.

I tried

Code:
- alpha1*fv::gaussConvectionScheme<scalar>
            (
                mesh,
                phi,
                upwind<scalar>(mesh, phi)
            ).fvmDiv(phi)
        );
which obviously does not work. Divergence is coded in p_rghEqn as

Code:
fvc::div(phiHbyA)
but I need to put the variable upfront. Is there anybody who knows how to do this?

Regards,

Daniel
danny123 is offline   Reply With Quote

Old   April 22, 2015, 13:28
Default
  #2
Senior Member
 
Daniel Witte
Join Date: Nov 2011
Posts: 148
Rep Power: 15
danny123 is on a distinguished road
Found the solution:

Code:
          - fvc::div(phi)*fvm::Sp(1,alpha1)
Works as expected.
danny123 is offline   Reply With Quote

Reply

Tags
alpha1eqn interfoam


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
[snappyHexMesh] How to define to right point for locationInMesh Mirage12 OpenFOAM Meshing & Mesh Conversion 7 March 13, 2016 15:07
channelFoam for a 3D pipe AlmostSurelyRob OpenFOAM 3 June 24, 2011 14:06
[Other] cgnsToFoam problems with "QUAD_4" cells lentschi OpenFOAM Meshing & Mesh Conversion 1 March 9, 2011 05:49
ATTENTION! Reliability problems in CFX 5.7 Joseph CFX 14 April 20, 2010 16:45
gmsh2ToFoam sarajags_89 OpenFOAM 0 November 24, 2009 23:50


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