|
[Sponsors] |
![]() |
![]() |
#1 |
New Member
GaspA
Join Date: Jan 2023
Location: Switzerland - Valais
Posts: 13
Rep Power: 4 ![]() |
Hello,
I am trying to convert the code implementing the kOmegaSSTCC (curvature correction) model to Openfoam 11. The original code is intended for OF5. Original code: https://github.com/ancolli/kOmegaSSTCC/tree/master line 504 of kOmegaSSTCC/kOmegaSSTCC.C Code:
// Compute rTilda volScalarField D(sqrt(max(symInnerProduct, 0.09*omega_*omega_))); tmp<volSymmTensorField> divS = ( fvc::ddt(tSymm()) +fvc::div ( alphaRhoPhi, tSymm() ) ); The error obtained during compilation is: Code:
../momentumTransportModels/lnInclude/kOmegaSSTCCBase.C:506:14: error: ‘ddt’ is not a member of ‘Foam::fvc’; did you mean ‘Foam::fvm::ddt’? 506 | fvc::ddt(tSymm()) What is surprising is that the function fvc::div works correctly (by compilation). Tested by commenting out the term fvc::ddt(tSymm()) Do you have an answer to this? Many Thanks in advance. |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 825
Rep Power: 16 ![]() |
I think I understand why the error occurs - from a cursory glance, there is no fvc::ddt( tmp<volField>), i.e. no ddt function that takes a tmp<volField> as a parameter. There is one that takes a volField, but not a tmp<volField> - check out https://cpp.openfoam.org/v11/fvcDdt_8H_source.html.
The fvc::div works because it has both - check out https://cpp.openfoam.org/v11/fvcDiv_8H_source.html. |
|
![]() |
![]() |
![]() |
![]() |
#3 |
New Member
GaspA
Join Date: Jan 2023
Location: Switzerland - Valais
Posts: 13
Rep Power: 4 ![]() |
Hello Tobermory
Thank you very much for this answer. This seems quite logical to me. I did not think to check if a tmp was accepted. The code is here, line 504: https://github.com/ancolli/kOmegaSST.../kOmegaSSTCC.C And here is the problematic part: Code:
tmp<volTensorField> tgradU = fvc::grad(U); tmp<volTensorField> tSkew = skew(tgradU()); // tmp<volTensorField> tSkew = skew(fvc::grad(U)); tmp<volSymmTensorField> tSymm = symm(tgradU()); // tmp<volSymmTensorField> tSymm = symm(fvc::grad(U)); volScalarField S2(2*magSqr(tSymm())); //volScalarField S2(2*magSqr(symm(tgradU()))); // volScalarField::Internal GbyNu(dev(twoSymm(tgradU()())) && tgradU()()); volScalarField::Internal G(this->GName(), nut()*GbyNu); tgradU.clear(); ///////////////// curvature correction // Compute rStar volScalarField symInnerProduct(2.0*tSymm() && tSymm()); volScalarField asymInnerProduct ( max(2.0*tSkew() && tSkew(), dimensionedScalar("0", dimensionSet(0, 0, -2, 0, 0), 0.0)) ); volScalarField w ( atan(dimensionedScalar("4",dimensionSet(0,0,2,0,0),1.0e-02)*asymInnerProduct)*2.0/(constant::mathematical::pi)*(asymInnerProduct-symInnerProduct)+symInnerProduct ); volScalarField rStar(sqrt(symInnerProduct/max(w, dimensionedScalar("minw", w.dimensions(), SMALL)))); //avoiding dividing by zero volScalarField rStar(sqrt(symInnerProduct/w)); // Compute rTilda volScalarField D(sqrt(max(symInnerProduct, 0.09*omega_*omega_))); tmp<volSymmTensorField> divS = ( fvc::ddt(tSymm()) +fvc::div ( alphaRhoPhi, tSymm() ) ); Can we simply declare tSymm() in volSymmTensorField and not in tmp<volSymmTensorField>? Best regards |
|
![]() |
![]() |
![]() |
![]() |
#4 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 825
Rep Power: 16 ![]() |
You could try replacing
Code:
fvc::ddt(tSymm()) Code:
0.5*fvc::ddt( fvc::grad(U) + fvc::grad(U).T() ) |
|
![]() |
![]() |
![]() |
![]() |
#5 |
New Member
GaspA
Join Date: Jan 2023
Location: Switzerland - Valais
Posts: 13
Rep Power: 4 ![]() |
Hello Tobermory,
Thank you very much for this answer. Unfortunately it does not work. The error is identical. After performing a search in the files invoked by this one, it appeared that the function fvc::ddt is never used! This implies that this function is not known in this script, as surprising as it may seem. Solution: By adding #include "fvcDdt.H" in the header, everything works correctly with fvc::ddt(tSymm()) Thanks for your help. |
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Frequently Asked Questions about Installing OpenFOAM | wyldckat | OpenFOAM Installation | 3 | November 14, 2023 11:58 |
How to develop OpenFOAM with CMake and popular IDEs | cosscholar | OpenFOAM Programming & Development | 0 | March 16, 2022 15:17 |
OpenFOAM Training, London, Chicago, Munich, Sep-Oct 2015 | cfd.direct | OpenFOAM Announcements from Other Sources | 2 | August 31, 2015 13:36 |
Suggestion for a new sub-forum at OpenFOAM's Forum | wyldckat | Site Help, Feedback & Discussions | 20 | October 28, 2014 09:04 |
64bitrhel5 OF installation instructions | mirko | OpenFOAM Installation | 2 | August 12, 2008 18:07 |