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

Add particles #99

Merged
merged 8 commits into from
Apr 29, 2024
Merged

Conversation

asalmgren
Copy link
Contributor

No description provided.

@asalmgren asalmgren requested a review from cgilet April 26, 2024 22:21
@@ -82,5 +82,9 @@ void incflo::Advance()
{
amrex::Print() << "Time per step " << end_step << std::endl;
}

#ifdef INCFLO_USE_PARTICLES
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wouldn't we want to include this redistribution in the calculation of the time per step?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

if (a_var_name == "mass_density") {
massDensity( a_mf, a_lev );
} else {
a_mf.setVal(0.0);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a reason why a_mf is set to zero for variable unknown to computeMeshVar? I might argue it would be better/clearer to Abort here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Real x_ctr = cyl_center[0];
Real y_ctr = cyl_center[1];

// Remove particles that are outside of the cylindner
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
// Remove particles that are outside of the cylindner
// Remove particles that are outside of the cylinder

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

using namespace amrex;

/*! Read tracer particles parameters */
void incflo::readTracersParams ()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
void incflo::readTracersParams ()
void incflo::readTracerParticlesParams ()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@@ -191,6 +194,10 @@ void incflo::ReadParameters ()
}
} // end prefix eb_flow
#endif

#ifdef INCFLO_USE_PARTICLES
readTracersParams();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
readTracersParams();
readTracerParticlesParams();

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

src/incflo.H Outdated
bool m_use_tracer_particles; /*!< tracer particles that advect with flow */

/*! Read tracer particles parameters */
void readTracersParams ();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
void readTracersParams ();
void readTracerParticlesParams ();

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@@ -435,7 +447,7 @@ void incflo::WritePlotFile()
pltscaVarsName.push_back("gpx");
++icomp;
}
if (m_plt_gpy) {
if (m_plt_gpy) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
if (m_plt_gpy) {
if (m_plt_gpy) {

Copy link
Collaborator

@cgilet cgilet Apr 29, 2024

Choose a reason for hiding this comment

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

The spacing on this is funny. Not completely sure that the suggestion (adding 4 spaces) fixes 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.

Done

@@ -372,8 +380,7 @@ void incflo::WritePlotFile()
if(m_plt_error_w) ncomp += 1;
#endif

// Error in nodal pressure (computed vs exact)
if(m_plt_error_p) ncomp += 1;
// Error in nodal pressure (computed vs exact) if(m_plt_error_p) ncomp += 1;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Did you mean to comment out the option m_plt_error_p? If so, maybe an Abort should be added if the inputs file tries to set this?

Real y_ctr = cyl_center[1];
Real z_ctr = cyl_center[2];

// Remove particles that are outside of the cylindner
Copy link
Collaborator

@cgilet cgilet Apr 29, 2024

Choose a reason for hiding this comment

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

It seems like maybe this part where particles outside a cylinder are removed is specific to a particular problem? Maybe a switch would be appropriate here? But then you'd probably want to also supply additional bcs for the particles (since now it seems only top and bottom reflect bcs exist)? ... Just trying to think about gotchas if another user wants particles, but perhaps a comment or warning is good enough for now.

@asalmgren asalmgren merged commit 011b26a into AMReX-Fluids:development Apr 29, 2024
15 checks passed
@asalmgren asalmgren deleted the add_particles branch April 29, 2024 17:56
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