-
Notifications
You must be signed in to change notification settings - Fork 10
Shared layer surface area function #33
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
base: main
Are you sure you want to change the base?
Conversation
… test for function and fixed function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking really good! I'm still working through the math, but I had a couple requests that maybe could be addressed in the meantime?
!! into layers. Phases in each layer are specified by the user. Phase configuration | ||
!! within each layer follows "fractional volume overlap". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since these are the comments that will become part of the documentation, please describe the fractional volume overlap with the most detail here, including any references.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have explicit references for the formulas used within atmospheric sciences publications. I can maybe try to look at phase separation literature within another discipline?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that's necessary, just describing the algorithms is fine. I was thinking you had found a paper that recommended this approach, but I probably misunderstood.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found a few experimental SOA papers that show aerosol configurations where this approach would be applicable
src/aero_rep_solver.c
Outdated
case AERO_REP_SINGLE_PARTICLE: | ||
aero_rep_single_particle_get_interface_layer_surface_area__m2( | ||
model_data, aero_phase_idx_first, aero_phase_idx_second, surface_area_layer, | ||
partial_deriv, aero_rep_int_data, aero_rep_float_data, aero_rep_env_data); | ||
break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also include an update to the modal/binned representation that returns values consistent with there being no common interfaces among condensed phases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function computes the surface area of an interface between two phases. For the modal/binned representation, should it return a surface area of 0 since two phases do not share an interface?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function does not determine if 2 phases are in adjacent layers (that was done in Fortran)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! I think we'll need to work a little on the partial derivative calculations. I added a comment, but we can talk more in person to work through the math if it would help.
* The surface area interface that exists between two specified phases within | ||
* the modal/binned aerosol representation always returns zero. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* The surface area interface that exists between two specified phases within | |
* the modal/binned aerosol representation always returns zero. | |
* The surface area interface that exists between two specified phases within | |
* the modal/binned aerosol representation always returns zero, because no | |
* specific internal structure is assumed for phases within modes or bins. |
aero_phase_idx_first -= NUM_PHASE_(i_section); | ||
if (aero_phase_idx_first < 0) { | ||
*surface_area = 0.0; | ||
*surface_area = 4.0 * 3.14159265359 * pow(EFFECTIVE_RADIUS_(i_section, i_bin), 2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be removed?
aero_phase_idx_first <= LAYER_PHASE_END_(i_layer) && | ||
i_phase_count == aero_phase_idx_first) { | ||
layer_first = i_layer; | ||
phase_model_data_id_first = PHASE_MODEL_DATA_ID_(i_layer, i_phase); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If phase_model_idx_first
and phase_model_idx_second
can be figured out during initialization, could these be returned from the fortran function that returns pairs of indices for adjacent phases?
*partial_deriv = | ||
2.0 * f_first * f_second * pow(radius, -1.0) * (*partial_deriv); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like it does not account for d f_first/d X
and d f_second/d X
where X are condensed-phase species concentrations.
…d surface_area funtion in modal/binned c code -- needs work
To transfer mass between layers, the diffusion rxn will require diffusion fluxes multiplied by the inter-facial area shared between the layers. The mass transfer between layers is based on the flux equations described in Shiraiwa et al. (2012). This PR adds the surface area computation to the single particle aerosol representation.
This function, a prerequisite for the diffusion rxn, computes the surface area of the inter-facial layer considered. The diffusion rxn has not yet been added to the code. The function inputs include the aero_phase_idx_first and aero_phase_idx_second associated with the inner and outer layer phase considered in the mass transfer, respectively. These input phases are output from the adjacent_phases function, which checks if two phases are in adjacent layers and indicates associated phase pairs (index_pairs variable).
When multiple phases exist in the same layer, the surface area shared by the adjacent phases considered will scale according to volume occupied by a phases in their associated layers. The phase configuration chosen is known as "fractional volume overlap", meaning the surface area is multiplied by the fractional overlap
f_first * f_second * total_interface_surface_area
wheref_first = volume_phase_first / volume_total_layer_first
andf_second = volume_phase_second / volume_total_layer_second
.