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

Results of the boundary integral (B_INT) are not written for each time step #309

Open
1 task done
ktbolt opened this issue Dec 4, 2024 · 1 comment
Open
1 task done
Assignees
Labels
bug Something isn't working

Comments

@ktbolt
Copy link
Collaborator

ktbolt commented Dec 4, 2024

Description

The results of the boundary integral (B_INT) are only written for the first time step and not for the remaining time steps.

Reproduction

For a fluids simulation add the following lines to the solver XML file

   <Output type="B_INT" >
     <Pressure> true </Pressure>
   </Output>

The B_NS_Pressure_average.txt file contains only a single set of values

 lumen_inlet  lumen_outlet  lumen_wall
 1.249e+01  1.249e+01  3.766e+02 

Expected behavior

Values should be written for each time step.

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct and Contributing Guidelines
@ktbolt ktbolt added the bug Something isn't working label Dec 4, 2024
@ktbolt ktbolt self-assigned this Dec 4, 2024
@ktbolt
Copy link
Collaborator Author

ktbolt commented Dec 11, 2024

The values in the B_NS_Pressure_average.txt file were actually face areas, values would follow later.

The original code used a std::vector<bool> wtn(3) to implicitly indicate output for spatial[0], boundary[1] or volume[2]. When in the code you are wondering what wtn might mean and see its obscure use like

if (!output.wtn[0]) {

for (int i = 0; i < 2; i++) {
  if (!wtn[i]) {
    continue;
  }

  if (i == 0) {

I've replaced std::vector<bool> wtn(3) with an OutputOptions class encapsulating Booleans for spatial, boundary and volume output types so you can do lEq.output[k].options.boundary_integral = true rather than lEq.output[k].wtn[1] = true.

The code originally computed and wrote both boundary and volume quantities in a single function. I've separated that code into two functions. I've also added a time step and time to the values written. For example: B_NS_Pressure_average.txt file

# svMultiPhysics boundary integral results file. 
# Quantities represent averaged scalar or flux values over each mesh face.
#        
# Format 
# ------ 
# face areas: [list of mesh face areas]  
# step time [list of mesh face names] 
# [time step] [time] [list of computed values for each mesh face]
face areas:  2.957e+00  2.973e+00  4.644e+01 
step   time   lumen_inlet  lumen_outlet  lumen_wall 
 1   5.0000000000e-03  4.6318356113e+02  1.3745997101e+02  3.0236471504e+02 
 2   1.0000000000e-02  -6.7384998121e+01  1.7091915172e+02  4.8689056707e+01 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant