Repository navigation
Issue #9051: advective fluxes at mesh interfaces with refinement - #16744
Closed
ghaffari-eng wants to merge 1 commit into
Closed
ghaffari-eng wants to merge 1 commit into
ghaffari-eng wants to merge 1 commit into
Conversation
…erfaces with refinement At an interface between a coarse and a fine mesh, the second ghost cell is a copy of the first, so each mesh limits its face value of rho*Z with first-order upwinding where gas flows into it, and the two meshes compute different face values. They moved different amounts of each species through the interface, and the total mass in a sealed box drifted, also with UGLMAT. In each stage of the time step: - Before DENSITY, each mesh sends its face values and the normal velocities DENSITY uses at the interface (MESH_EXCHANGE code 25), and the mesh downstream of the interface takes the face values of the upstream mesh: the fine faces take the coarse face value where gas flows into the fine mesh, and the coarse face takes the flux-weighted average of the fine face values where gas flows into the coarse mesh. Faces with flow in both directions keep their own values. - After DENSITY, each mesh sends the advective fluxes and normal velocities it used at the interface (code 24), and the coarse mesh corrects its flux in the interface cell by the sum over the fine faces of u_fine*(phi_fine - phi_coarse), weighted by area, where phi is the face value (a variant of the refluxing of Berger and Colella 1989). Density, mass fractions and temperature of that cell are updated before the usual exchange of species. Where the coarse velocity equals the area-weighted average of the fine velocities (UGLMAT), both meshes move the same mass. A difference of the normal velocities (FFT, within VELOCITY_TOLERANCE) is not moved into the coarse cell, which would then get more or less gas than its own velocity field makes room for and change its temperature. The mass error left is the velocity difference times the face value, the same kind of error as between meshes with the same cell size, and is controlled by VELOCITY_TOLERANCE. New MISC parameter REFLUX_MESH_INTERFACES (default T). Not applied where meshes overlap, at PERIODIC FLOW ONLY boundaries, with complex geometry or cylindrical coordinates, or where the correction would take a density out of bounds. Cases without refinement are not affected.
Contributor
|
@ghaffari-eng I am going to close this PR because I don't liked PRs handing out for any length of time. However, I will use your branch to test once I get time. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #9051: mass at mesh interfaces with refinement
From what I can see, at an interface between a coarse and a fine mesh the two meshes compute different face values of ρZ (the second ghost cell is a copy of the first, so each side is first order where the flow enters it), and they move different amounts of each species through the interface. Total mass in a sealed box drifts, also with UGLMAT.
The change, in each stage of the time step:
Where the coarse velocity equals the area-weighted average of the fine ones (UGLMAT), both meshes move the same mass. A difference of the normal velocities (FFT, within VELOCITY_TOLERANCE) is not moved into the coarse cell, which would then get more or less gas than its own velocity field makes room for and change its temperature. The mass error left with FFT should be the velocity difference times the face value, the same kind of error as between meshes with the same cell size; in my runs it follows VELOCITY_TOLERANCE.
New MISC parameter
REFLUX_MESH_INTERFACES(default T). Not applied where meshes overlap, at PERIODIC FLOW ONLY boundaries, with GEOM or cylindrical coordinates, or where the correction would take a density out of bounds. Cases without refinement should not be affected (bit for bit the same in the cases I ran). Tech Guide (Mass chapter, flux matching) and User Guide (mesh alignment, MISC table) updated.Results: see #9051.
Checks, master and this branch on the same machine:
species_conservation_1to_4,simple_duct,shunn3_4mesh_64,dancing_eddies_default): output identical to master.random_meshes,obst_coarse_fine_interface,dancing_eddies_uglmat_refine,duct_flow_uglmat_refine,dancing_eddies_embed,geom_stretched_grid,ns2d_16_emb_1to2_refinement,ns2d_16_int_1to2_refinement,race_test_1,race_test_4): all run to the end.random_meshes,dancing_eddies_embed,geom_stretched_gridandns2d_16_emb_1to2_refinementare identical to master;obst_coarse_fine_interfacekeeps its pressure result;race_testgives the same result with 1 and 4 threads.