|
[Sponsors] |
January 19, 2023, 08:48 |
Updating solver from older version to OF8
|
#1 |
New Member
Sarah
Join Date: Jan 2023
Posts: 12
Rep Power: 3 |
I am trying to update a solver (artificially thickened flame) from OF2.2.2 to OF8. There is a class named efficiencyFunction that uses delta as variable, whose input arguments are in the form (for OF2.2.2):
delta_(LESdelta::New("delta", U.mesh(), *this)) But the LESdelta's "New" function in OF8 take input arguments in the form: Foam::autoPtr<Foam::LESdelta> Foam::LESdelta::New ( const word& name, const momentumTransportModel& turbulence, const dictionary& dict ) which was in older version OF2.2.2 is of the form: Foam::autoPtr<Foam::LESdelta> Foam::LESdelta::New ( const word& name, const fvMesh& mesh, const dictionary& dict ) so when I am trying to compile it, it is giving me an error as: no matching function for call to ‘Foam::LESdelta::New(const char [6], const Mesh&, Foam::efficiencyFunction&)’ If anyone can get my query (if it is clear enough) and respond to it as to what changes should I make, I would be really grateful. |
|
February 1, 2023, 07:11 |
|
#2 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51 |
Hey Sarah,
as you can see and already pointed out, the constructors are different: NEW Code:
Foam::autoPtr<Foam::LESdelta> Foam::LESdelta::New ( const word& name, const momentumTransportModel& turbulence, const dictionary& dict ) Code:
Foam::autoPtr<Foam::LESdelta> Foam::LESdelta::New ( const word& name, const fvMesh& mesh, const dictionary& dict ) Example given, the LESdelta::New function needs e.g., the following argument: https://github.com/OpenFOAM/OpenFOAM...teFields.H#L42 Meaning that you call needs to be something like that: Code:
auto myNewObject = LESdelta::New("whatEver", turbulence, dict); E.g.
__________________
Keep foaming, Tobias Holzmann |
|
June 12, 2023, 03:07 |
|
#3 |
New Member
Sarah
Join Date: Jan 2023
Posts: 12
Rep Power: 3 |
Hi Thanks for your reply, I am still not able to solve the problem.
However I wish to access LESDelta in my solver code, can anyone please help me how to can I use the LES delta, as I can't find any solver which uses LES delta in their formula to which I can refer to? |
|
August 2, 2023, 06:30 |
|
#4 | |
New Member
serg
Join Date: Dec 2015
Posts: 28
Rep Power: 10 |
Quote:
Did you make any progress on accessing the delta? My solver uses it for calculating scalar variances of mixture fraction variance. I’d be glad if anyone could help. Thanks |
||
August 22, 2023, 06:28 |
|
#5 |
New Member
Sarah
Join Date: Jan 2023
Posts: 12
Rep Power: 3 |
Hi Serg
I calculated delta in my code itself using the mesh information. For 3-D it would be pow(mesh.V(),1.0/3.0). Note that it is only valid for cubeRootVol type of delta. For other type of delta you can maybe refer to their source code to find out how they are calculated. Also to implement it properly you can refer to the source file of cubeRootVol delta. |
|
December 12, 2023, 07:46 |
|
#6 |
New Member
serg
Join Date: Dec 2015
Posts: 28
Rep Power: 10 |
I was using this code snippet to reach delta, but it seems its an old version, so It does not return anything.
PHP Code:
|
|
December 15, 2023, 09:20 |
|
#7 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 668
Rep Power: 14 |
This may not work, but is a shortcut that is worth trying - essentially it's the "banana" trick. Try modifying your code snippet to:
Code:
//if (mesh.objectRegistry::foundObject<volScalarField>("delta")) //{ const volScalarField& delta = mesh_.objectRegistry::lookupObject<volScalarField>("delta"); // LESdelta_ = delta; // } |
|
December 16, 2023, 09:32 |
|
#8 | |
New Member
serg
Join Date: Dec 2015
Posts: 28
Rep Power: 10 |
Quote:
Best regards |
||
December 16, 2023, 13:34 |
|
#9 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 668
Rep Power: 14 |
Strange. I added the following into a clone of pisoFoam, in OF8, and it worked fine:
Code:
Info << "-------------------------------------" << endl; volScalarField LESdelta ( IOobject ( "LESdelta", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE ), mesh, dimensionedScalar("LESdelta", dimLength, SMALL) ); if (mesh.objectRegistry::foundObject<volScalarField>("delta")) { Info << "Found it!" << endl; const volScalarField& delta = mesh.objectRegistry::lookupObject<volScalarField>("delta"); LESdelta = delta; } else { Info << "No joy I am afraid" << endl; } Info << LESdelta << endl; Info << "-------------------------------------" << endl; |
|
December 16, 2023, 13:38 |
|
#10 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 668
Rep Power: 14 |
PS, check your syntax:
Code:
if (mesh.objectRegistry::foundObject<volScalarField>("delta")) { const volScalarField& delta = mesh_.objectRegistry::lookupObject<volScalarField>("delta"); LESdelta_ = delta; } |
|
December 17, 2023, 01:23 |
|
#11 | |
New Member
serg
Join Date: Dec 2015
Posts: 28
Rep Power: 10 |
Quote:
Regards |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Error: WorkBench Error: Could not handle event: SolutionStatusUpdate | Kieyo | Fluent Multiphase | 0 | November 9, 2022 23:58 |
viscosity udf don't use correct temperature and strain rate | rezvani | Fluent UDF and Scheme Programming | 8 | May 27, 2021 05:40 |
Updating solver version | saj216 | OpenFOAM Programming & Development | 0 | April 29, 2020 09:25 |
Problem in compiling a solver made for a different version (v2.0 ->v4.1) | JLS | OpenFOAM Programming & Development | 2 | July 9, 2019 14:03 |
Converting custom solver from old version to openFoam4.1 | Nigel Bruce Khan | OpenFOAM Running, Solving & CFD | 2 | August 11, 2017 10:45 |