CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Community Contributions

[swak4Foam] viscous force calculation with MRF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 3, 2015, 12:13
Default viscous force calculation with MRF
  #1
Member
 
Pekka Pasanen
Join Date: Feb 2012
Location: Finland
Posts: 87
Rep Power: 14
zordiack is on a distinguished road
Hi, I'm having trouble calculating viscous force over a patch with swak4Foam (actually two patches). For reference I'm using the built-in libforces calculation. This is the relevant swak4Foam function:

Code:
viscousForces
{
    type patchExpression;
    variables (
        "rho=998.3;"
        "viscous_force=-rho*nu*snGrad(U)*area();"
        "impeller1{patch'impeller1}=sum(-998.3*nu*snGrad(U)*area());"
    );
    accumulations (
        average
    );
    patches (
        impeller0
    );
    expression "sum(viscous_force)+impeller1";
    verbose true;
    outputControlMode   timeStep;
    outputInterval      1;
}
The implementation is copied from here https://openfoamwiki.net/index.php/C...ectionalForces. Now I suspect it might have something to do with the calculation being in MRF. How could I take that into account?

Here is some sample output from the functions:

Code:
Expression pressureForces on impeller0:  average=(4758.3887 -5556.7538 -51217.2)
Expression viscousForces on impeller0:  average=(-0.42171331 0.93947787 2.6970982)
forces rotorForces output:
    sum of forces:
        pressure : (4758.3887 -5556.7538 -51217.2)
        viscous  : (-0.62912771 1.5910869 5.3923825)
        porous   : (0 0 0)
    sum of moments:
        pressure : (-503.3495 -384.21045 -1364.6771)
        viscous  : (0.12301857 0.063222675 12.807648)
        porous   : (0 0 0)
The pressure forces seem to match nicely, but viscous forces do not. The reason I want to implement this using swak4Foam is that I want to automatically calculate some turbomachinery data, and moment calculations are needed in order to calculate power and efficiency.
zordiack is offline   Reply With Quote

Old   March 4, 2015, 06:53
Default
  #2
Senior Member
 
Tom Fahner
Join Date: Mar 2009
Location: Breda, Netherlands
Posts: 634
Rep Power: 32
tomf will become famous soon enoughtomf will become famous soon enough
Send a message via MSN to tomf Send a message via Skype™ to tomf
Hi,

Are you running a turbulent case? If so, the standard forces functionObject takes the turbulent viscosity into account when calculating the viscous forces.

Regards,
Tom
tomf is offline   Reply With Quote

Old   March 4, 2015, 08:07
Default
  #3
Member
 
Pekka Pasanen
Join Date: Feb 2012
Location: Finland
Posts: 87
Rep Power: 14
zordiack is on a distinguished road
Yes it's a turbulent case and I already tried using nu+nut in the calculations, still different results. Should it be just nut?

Output with "viscous_force=-rho*(nu+nut)*snGrad(U)*area();":

Code:
Expression pressureForces on impeller0:  average=(-2624.4874 1612.6975 33782.874)
Expression viscousForces on impeller0:  average=(-0.59524669 1.5039751 8.371256)
forces rotorForces output:
    sum of forces:
        pressure : (-2624.4874 1612.6975 33782.874)
        viscous  : (-0.64199103 1.4823397 8.9218996)
        porous   : (0 0 0)
    sum of moments:
        pressure : (143.58526 249.0284 559.52474)
        viscous  : (0.13726107 0.070810696 12.710413)
        porous   : (0 0 0)
zordiack is offline   Reply With Quote

Old   March 4, 2015, 08:37
Default
  #4
Senior Member
 
Tom Fahner
Join Date: Mar 2009
Location: Breda, Netherlands
Posts: 634
Rep Power: 32
tomf will become famous soon enoughtomf will become famous soon enough
Send a message via MSN to tomf Send a message via Skype™ to tomf
The forces functionObject seems to use devRhoReff, which is defined in the turbulence model. Most turbulence models will use nuEff for this, which is indeed nut+nu.

The way the devRhoReff is calculated seems to be different to the way you have defined in the variables section, I think you should investigate on that to find the mismatch.

If you type this in your terminal:

Code:
cd $FOAM_SRC
grep -r devRhoReff .
You will get a list of files that use this function. Than it is up to you to find the relevant equation for the viscous forces calculation with your turbulence model.

Good luck,

Regards,
Tom
tomf is offline   Reply With Quote

Old   March 4, 2015, 09:19
Default
  #5
Member
 
Pekka Pasanen
Join Date: Feb 2012
Location: Finland
Posts: 87
Rep Power: 14
zordiack is on a distinguished road
So it seems that for kOmegaSST the calculation is done by this function in kOmegaSST.C (incompressible):

Code:
tmp<volSymmTensorField> kOmegaSST::devReff() const
{
    return tmp<volSymmTensorField>
    (
        new volSymmTensorField
        (
            IOobject
            (
                "devRhoReff",
                runTime_.timeName(),
                mesh_,
                IOobject::NO_READ,
                IOobject::NO_WRITE
            ),
           -nuEff()*dev(twoSymm(fvc::grad(U_)))
        )
    );
}
I have no idea how to implement this with swak4Foam. Gradient operator grad(U) will not work because it's a patchexpression (?), snGrad(U) works, but it doesn't produce a tensor so twoSymm or dev won't work.
zordiack 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculation of Pressure and viscous moments separately zeenia CFX 3 January 20, 2014 03:38
Viscous Force Calculation cwang5 OpenFOAM Programming & Development 1 May 4, 2010 04:59
Forces viscous calculation in VWT with OpenFOAM 15x terrybarnaby OpenFOAM Running, Solving & CFD 0 November 28, 2008 08:39
pressure force and viscous force CFD FLUENT 0 March 7, 2006 01:03
Warning 097- AB Siemens 6 November 15, 2004 04:41


All times are GMT -4. The time now is 19:05.