Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turbulent exchange comes from previous iteration #266

Open
pabloprf opened this issue Aug 30, 2022 · 2 comments
Open

Turbulent exchange comes from previous iteration #266

pabloprf opened this issue Aug 30, 2022 · 2 comments
Assignees
Labels

Comments

@pabloprf
Copy link
Contributor

In tgyro_iteration_standard.f90 (and I think in the rest of schemes too), targets are evaluated before fluxes (i.e. tgyro_target_vector is called before tgyro_flux_vector. As a consequence, the turbulent energy exchange used as part of the targets vector is always from the previous iteration. For example, running with TGYRO_RELAX_ITERATIONS=0 to evaluate the original targets and fluxes will give a zero turbulent exchange, e.g. in file out.tgyro.power_e the p_expwd column will be zero.
I think this should be changed so that the turbulent energy exchange is always consistent with the iteration in fluxes, unless this was done intentionally for some reason.
To solve this issue, one could call tgyro_flux_vector earlier on, or one could call the subroutine tgyro_source and build the targets vector again right after.
Thoughts?

@jcandy
Copy link
Member

jcandy commented Sep 1, 2022

Sorry for the slow response. We are in the process of adding the turbulent exchange to CGYRO. The reason for the offset is that the exchange is implemented as a source and IIRC the current iteration logic makes it out of sync. I will definitely revisit this once exchange is implemented in CGYRO.

@pabloprf
Copy link
Contributor Author

pabloprf commented Sep 2, 2022

Sounds good, thanks @jcandy

@pabloprf pabloprf added the bug label Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants