|
[Sponsors] |
February 25, 2023, 13:10 |
Switch schemes in code
|
#1 |
Senior Member
|
I want to manually switch the time scheme in the code, for example, when t<100, using Euler, otherwise using backward.
Is there a way to achieve this goal in the code? It seems the ddtScheme always read the data from the file fvSchemes. I cannot dynamically switch the scheme. Thanks! |
|
February 27, 2023, 03:24 |
|
#3 |
Senior Member
Yann
Join Date: Apr 2012
Location: France
Posts: 1,086
Rep Power: 26 |
The timeActivatedFileUpdate function object does exactly this:
Cheers, Yann |
|
February 27, 2023, 16:46 |
|
#4 | |
Senior Member
|
Quote:
Yann, Thank you for reply. Using this method can solve my current problem and it works for every case. But I want to control the scheme in the code directly something like this: Code:
template<class Type> tmp<ddtScheme<Type>> ddtScheme<Type>::New ( const fvMesh& mesh, Istream& schemeData ) { const word schemeName(schemeData); auto* ctorPtr = IstreamConstructorTable(schemeName); return ctorPtr(mesh, schemeData); } The ddtScheme is created by reading the fvScheme file. I would like to create the ddtScheme manually and switch different schemes flexibly. |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Patankar CFD FORTRAN 90 Code FVM | siddiquesil | Main CFD Forum | 19 | October 25, 2022 05:21 |
No different caculation speed between serial and openMP code? | AnhDL | Main CFD Forum | 4 | May 16, 2020 04:17 |
Design Integration with CFD? | John C. Chien | Main CFD Forum | 19 | May 17, 2001 15:56 |
What is the Better Way to Do CFD? | John C. Chien | Main CFD Forum | 54 | April 23, 2001 08:10 |
Numerical schemes in PHOENICS code | Hafsia | Phoenics | 5 | September 13, 2000 04:45 |