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

Use oneThirdI and twoThirdsI in my own code

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 3, 2021, 13:50
Default Use oneThirdI and twoThirdsI in my own code
  #1
Senior Member
 
Agustín Villa
Join Date: Apr 2013
Location: Alcorcón
Posts: 314
Rep Power: 15
agustinvo is on a distinguished road
Hello,


In a certain part of a turbulence model I need to introduce the 2/3\delta_{ij} tensor (which is obviously symmetric). However, when I use twoThirdsI I get an error. Well, I don't even arrive to check it, but I got a huge list of notes, where I mostly understand I can't use it directly. Mi code contains:


Code:
tmp<fvSymmTensorMatrix> REqn
    (
        fvm::ddt(alpha, rho, R)
      + fvm::div(alphaRhoPhi, R)
      - fvm::laplacian(alpha*rho*DREff(), R)
      ==
        alpha*rho*P
      + alpha*rho*oneMinusFn_*phiw  // velocity-pressure correlation at wall
      - fvm::Sp(alpha*rho*fn_*phiC1/2/k_,R)  // C1 implicit term  pressure
      + alpha*rho*fn_*
        ( phiC1* (b-dev(b))       // C1 explicit term  pressure
        + C2_*epsilon_*dev(innerSqr(b))   // C2 term
        + k_
        *(
             (C3_ - C3Star_*mag(b))*S                  // C3 Term
           + C4_*dev(twoSymm(b&S))                    // C4 Term
           + C5_*twoSymm(b&W.T())                     // C5 Term
            )
        )
      - fvm::Sp(alpha*rho*oneMinusFn_*epsilon_/k_,R)  // epsilon wall term
      - twoThirdsI*fn_*epsilon_//(b-dev2(b))*fn_*epsilon_                       // epsilon high term
      + fvOptions(alpha, rho, R)
    );

A walkaround I found is to use (A-dev2(A)) where I ensure that I get 2/3\delta_{ij} but it is not the most elegant way. Have you ever tried to do something similar before?
agustinvo 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



All times are GMT -4. The time now is 04:52.