CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   volScalarField::Internal vs. volScalarField (https://www.cfd-online.com/Forums/openfoam/197496-volscalarfield-internal-vs-volscalarfield.html)

MaryBau January 7, 2018 18:40

volScalarField::Internal vs. volScalarField
 
Hi!

In kEpsilon.C, G is defiened as:

Code:

    volScalarField::Internal G
    (
        this->GName(),
        nut.v()*(dev(twoSymm(tgradU().v())) && tgradU().v())
    );

Why is it defined as "volScalarField::Internal" instead of just a simple "volScalarFiled"? And have something like this:

volScalarField G1= this->nut_*(dev(twoSymm(tgradU())) && tgradU());


Thanks,

Mary

Tibo99 December 1, 2020 08:44

I got the same question lately. Did you get an answer for your question?

Regards,

olesen December 5, 2020 04:02

Quote:

Originally Posted by Tibo99 (Post 789449)
I got the same question lately. Did you get an answer for your question?

The question to ask yourself: if it were a volScalarField, which is an internal field (with dimensions) and a boundary - what would you like to calculate on the boundaries?

granzer December 26, 2020 10:33

This is what I have understood.
The volScalarField is a typedef of GeometricField<>. So volScalarField contains an internal field a boundaryfield etc. Now, the volScalarField::Internal is the 'type' of the internal field in the volscalarField. It's defined by typedefing of Diemnsionedfield.
For volScalarField the 'Internal' translates to:
Code:

typedef DiamensionedField<Scalar, volMesh>    Internal;
So, the code
Code:

    volScalarField::Internal G
    (
        this->GName(),
        nut.v()*(dev(twoSymm(tgradU().v())) && tgradU().v())
    );

Can be seen as
Code:

    DimensionedField<scalar, volField> G
    (
        this->GName(),
        nut.v()*(dev(twoSymm(tgradU().v())) && tgradU().v())
    );



All times are GMT -4. The time now is 07:29.