Extraction of impulsion field through modifying source code

src.zip (448.8 KB)
I’m trying to extract impulsion field by modifying source codes.

In detail:

  1. Initialize impulsion field as 0.0.
  2. Calculate impulsion vectors when parcels collide with walls for each parcels.
  3. Save the sum of impulsion vectors for each “boundary cells” (or wall cells) in which the impulsion happened.
  4. Write an output file when the time step is reached, with the impulsion field.

After a simulation with this process, the impulsion field is expected to have values along only in the wall cells.

inputs.zip (3.5 KB)

But this code gives me the results shown in the capture below.

I think the step 3. (indexing) logic is the problem, but I cannot find what is the problem.

Let me know where is wrong in my logic.

Modified file list:

Also, let me know if it causes some problems.

Thank you for you all reading this.

@DOGEONOH We mentioned your post at the meeting today but don’t really know how to help. A few random thing…

  1. I’m not a developer, you jumped right into the code and I’m not going to be able to help with that. sorry.
  2. the developers expressed some (justified) reluctance to unzip a mystery src.zip file from an unknown user
  3. could you express mathematically exactly what you’re trying to extract from the code?

Thanks

Thanks for your reply.

I attached

  1. pptx file (Modified.zip) including captures of all modifications,
  2. zip file of inputs file (inputs.zip), for execution.

In 25th slide, there are simple calculation codes of impulsion,
and other modifications are of initialization and writing output file about impulsion data variable.
What I focused in was data saving cell, which is outermost or no-slip wall boundary cell.

I needed to identify with which point the parcels collide. So I made an algorithm to accomplish this, see 24th slide. After finding “collision cell,” stack the impulsion vector in the identified cell.
Through this algorithm, the data should be stacked in only the outermost cells, but not in the inner cells. But the result told me “inner cells have data too.”

I couldn’t find the problem.. Please let me know how I can fix this.

Thank you for reading.

inputs.zip (3.5 KB)

Modified.zip (3.6 MB)

I’m sorry, @DOGEONOH , but PowerPoint screen captures of modified code are a very awkward way to look at code. It would be much better to attach output of git diff

Also, as @wdf said, it would be helpful to have some mathematical details. You said you are trying to “calculate impulsion vectors when parcels collide with walls for each parcels”, what is the equation you are using to calculate this?

Thanks.

– Charles