|
[Sponsors] |
Where to store solveScalarFields for the data transfer between timesteps? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
May 13, 2024, 11:23 |
Where to store solveScalarFields for the data transfer between timesteps?
|
#1 |
Senior Member
Klaus
Join Date: Mar 2009
Posts: 261
Rep Power: 22 |
I want to use solveScalarField psi and const solveScalarField source from the two previous timesteps and use them in the current timestep in PCG.C for computations. This means I have to create four solveScalarFields in a way that they are accessible from within PCG.C . I want to use the functionality when running simpleFoam.
Where can/should I add the four solveScalarFields to store psi and source from the previous timesteps? |
|
May 13, 2024, 11:55 |
|
#2 |
Senior Member
|
My extremely limited input:
1/ how exactly do you wish to modify the CG algorithm? Does PETSc offer more flexibility to implement what you are after, i.e., implement first in PETSc and subsequently employ PETSc4Foam? 2/ how do scalarField and solveScalarField differ? 3/ CG stores a vector for conjugate search directions (typically denoted by \vec{p} as in e.g. https://en.wikipedia.org/wiki/Conjugate_gradient_method ). Can you borrow from GMRES type ideas and extend the set of work vectors? |
|
May 13, 2024, 15:53 |
|
#3 | |
Senior Member
Klaus
Join Date: Mar 2009
Posts: 261
Rep Power: 22 |
Quote:
It's really about finding a storage place to transfer, store and update information from multiple timesteps to be used and updated within PCG.C. |
||
May 13, 2024, 16:30 |
|
#4 |
Senior Member
|
Not sure.
Make a child class of the currently in place symmetric matrix class, foresee two additional vector (aside from source and psi) and specialise PCG as a member function of this new class? Note that CG converges non-linearly and that the effect of an improved initial guess might be limited. Note that PETSc does provide tools for a deflated CG implementation. Deflation does more than merely improving the initial guess. |
|
Yesterday, 17:48 |
|
#5 |
Senior Member
Klaus
Join Date: Mar 2009
Posts: 261
Rep Power: 22 |
There's only #include "lduMatrix.H"
What I need are "global" variables in the e.g. simpleFoam solver to store psi and source vectors from t-1 and t-2 timesteps for processing and update in the current timestep from within the matrix solvers e.g. PCG, GAMG... |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Where to store data from previous timesteps for reuse? | klausb | OpenFOAM Programming & Development | 0 | June 23, 2021 18:12 |
Where does the branch predictor store it's prediction data? | aerosayan | Main CFD Forum | 7 | November 15, 2020 12:08 |
Error - Solar absorber - Solar Thermal Radiation | MichaelK | CFX | 12 | September 1, 2016 05:15 |
Transfer data in MPI | hall | Main CFD Forum | 0 | May 3, 2004 18:57 |
Data transfer | H. P. LIU | Main CFD Forum | 5 | May 19, 2003 10:47 |