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

Viscous Work in rhoPimpleFoam (OF 1612)

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 30, 2018, 02:52
Default Viscous Work in rhoPimpleFoam (OF 1612)
  #1
L_W
New Member
 
Lars Wein
Join Date: Jun 2012
Posts: 8
Rep Power: 14
L_W is on a distinguished road
Hi,


I'm using rhoPimpleFOAM in OpenFOAM V1612 and I need to implement the viscous work term in the energy equation. Currently my implementation in the EEqn.h looks like:


Code:
{
    volScalarField& he = thermo.he();
    volScalarField muEff ("muEff", turbulence->muEff());
    volTensorField gradU = fvc::grad(U);
    volTensorField tau = - muEff * (gradU + gradU.T()) + (2.0/3.0 * muEff * fvc::div(U)) * I; 


     volScalarField tauGradU = tau && gradU;
 
    fvScalarMatrix EEqn
    (
        fvm::ddt(rho, he) + fvm::div(phi, he)
      + fvc::ddt(rho, K) + fvc::div(phi, K)
      + (
            he.name() == "e"
          ? fvc::div
            (
                fvc::absolute(phi/fvc::interpolate(rho), U),
                p,
                "div(phiv,p)"
            )
          : -dpdt
        )
      - fvm::laplacian(turbulence->alphaEff(), he)
      - tauGradU
    ==
        fvOptions(rho, he)
    );
    EEqn.relax();
    fvOptions.constrain(EEqn);
    EEqn.solve();
    fvOptions.correct(he);
    thermo.correct();
}
It compiles succesfully and pimple starts to solve the momentem equations, but when it starts to solve the energy equation it got the following error:

Code:
--> FOAM FATAL ERROR: 
 
    lookup of grad(U) from objectRegistry region0 successful
    but it is not a surfaceScalarField, it is a volTensorField

    From function const Type& Foam::objectRegistry::lookupObject(const Foam::word&, bool) const [with Type = Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>]
    in file /sw/eng/OpenFOAM/v1612+/GNU_MPP/OpenFOAM-v1612+/src/OpenFOAM/lnInclude/objectRegistryTemplates.C at line 206.



FOAM aborting
Can anybody see my mistake?
L_W is offline   Reply With Quote

Old   August 1, 2018, 11:56
Default Work-Arround
  #2
L_W
New Member
 
Lars Wein
Join Date: Jun 2012
Posts: 8
Rep Power: 14
L_W is on a distinguished road
I have found a work-arround on my own. Incase anybody is facing the same issue in OpenFOAM 1612, here is my solution:


In OpenFOAM 1806 viscous work can be included into the energy equation via an additional source (in fvOptions). See
https://www.openfoam.com/documentati...661e05c65.html
So, I just copied the corresponding files, viscousDissipation.C and .H to my FOAM_USER_LIBBIN and compiled it for OpenFOAM 1612.



Kind regards
L_W is offline   Reply With Quote

Reply

Tags
rhopimplefoam, viscous work


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
Viscous resistance coefficients in porous medium fpingqian FLUENT 50 June 26, 2019 02:55
Pressure stair-step behaviour using rhopimplefoam joegi.geo OpenFOAM Running, Solving & CFD 3 December 12, 2014 13:10
rhoPimpleFoam floating point error dancfd OpenFOAM Running, Solving & CFD 6 January 5, 2014 21:57
Linearization of viscous flux in discontinuous Galerkin finite element methods yidongxia Main CFD Forum 1 November 17, 2011 13:11
Include Viscous Work term (in fluid model) mehshan.javaid Main CFD Forum 0 September 22, 2011 11:43


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