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

WIP: Limit velocity and temperature in Kinetic jet injection region #75

Merged
merged 15 commits into from
Aug 7, 2023

Conversation

forrestglines
Copy link
Contributor

Limits the velocity and temperature within the kinetic jet injection zone to below specified ceilings. In the current state of this PR, this will enforce the ceiling whether or not hitting the ceiling was due to kinetic jet injection or not. If this ceiling fixes the issue we could explore less aggressive ceilings.

@forrestglines forrestglines changed the title Forrestglines/limit agn v and t WIP: Limit velocity and temperature in Kinetic jet injection region Jul 17, 2023
@pgrete pgrete changed the base branch from main to pgrete/init-pert July 17, 2023 19:40
Comment on lines 369 to 374
cons(IM1, k, j, i) += vceil/v;
cons(IM2, k, j, i) += vceil/v;
cons(IM3, k, j, i) += vceil/v;
prim(IV1, k, j, i) += vceil/v;
prim(IV2, k, j, i) += vceil/v;
prim(IV3, k, j, i) += vceil/v;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should be *=, don't they?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

//Apply internal energy ceiling as a pressure ceiling
const Real internal_e = prim(IPR, k, j, i)/( gm1 * prim(IDN, k, j, i) );
if( internal_e > eceil){
cons(IEN, k, j, i) -= (internal_e - eceil);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing density factor?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@forrestglines
Copy link
Contributor Author

@par-hermes format

@forrestglines
Copy link
Contributor Author

@pgrete Since this fix seems to be working fine for the current suite of simulations, we can merge this into the other PR if it's alright

Copy link
Contributor

@pgrete pgrete left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One last comment to consistency between debug and non-debug builds.

src/pgen/cluster/agn_feedback.cpp Show resolved Hide resolved
src/pgen/cluster/agn_feedback.cpp Outdated Show resolved Hide resolved

if (va2 > vAceil2) {
//Increase the density to match the alfven velocity ceiling
const Real rho_new = std::sqrt(vAceil2/B2);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const Real rho_new = std::sqrt(vAceil2/B2);
const Real rho_new = std::sqrt(B2/vAceil2);

vAceil2 also has the density in the denominator, doesn't it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woops, that's a pretty big mistake

src/pgen/cluster.cpp Outdated Show resolved Hide resolved
@pgrete
Copy link
Contributor

pgrete commented Aug 7, 2023

I think this has been tested enough over the past weeks. I'm merging this and closing the alternative #76

@pgrete pgrete merged commit bd3c556 into pgrete/init-pert Aug 7, 2023
pgrete added a commit that referenced this pull request Aug 7, 2023
* Move cluster pgen to MeshPgen to allow for reductions

* Prepare hse test case for init pert

* Git add sigma_v plus test for cluster pgen

* Fix index error in cooling test

* Move iFT to utils from turb driver

* Isolate fmft construtor

* Separate OU and FT parts from turbulence pgen

* Make FMFT smooth and consistent for mesh refinement runs

* Fix update of internal RNG state

* Remove restriction on unit domain dims

* Fix k_vec check on device

* Add init perturb for velocity field

* Move construction of modes to shared util

* Allow ghost zones filling in FMFT

* Add initial magnetic field perturbations

* Add doc for cluster init perturb

* Fix typo for using host view

* Fixed entropy for ASCENT output

* Clarified feedback efficiency error

* WIP: Limit velocity and temperature in Kinetic jet injection region (#75)

* Velocity and temperature ceilings

* Added ceilings to velocity and temperature within AGN region

* Fixed to apply only to kinetic jet injection zone

* Fixed missing magnetic energy from temperature ceil

* Fixed typos in ceilings

* Fixed arguments for EOS constructor

* cpp-py-formatter

* Added V, V_a, T, D clipping within defined radius

* Check kinetic feedback in release builds

* Fixed Va ceiling typo

* Fixed cluster/clips -> problem/cluster/clips

* Update src/pgen/cluster.cpp

Co-authored-by: Philipp Grete <[email protected]>

* Fix comments

* Fix formattin

---------

Co-authored-by: Forrest Glines <[email protected]>
Co-authored-by: Forrest Glines <[email protected]>
Co-authored-by: par-hermes <[email protected]>
Co-authored-by: Philipp Grete <[email protected]>

* Enable first order flux correct for non-vl2 integrators

* Fix comments

* Fix weird missing header for non-mpi non-hdf5 builds

---------

Co-authored-by: Forrest Glines <[email protected]>
Co-authored-by: Forrest Glines <[email protected]>
Co-authored-by: forrestglines <[email protected]>
Co-authored-by: Forrest Glines <[email protected]>
Co-authored-by: par-hermes <[email protected]>
@pgrete pgrete deleted the forrestglines/limit-agn-v-and-t branch March 18, 2024 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants