uw-comphys / openccm

OpenCCM is a CFD-based compartment modelling software package. It is primarily intended for convection dominated reactive flows which feature a weak or one-way coupling between the reactive species and the carrier fluid, i.e. the reaction does not substantially influence the fluid flow over the course of the simulation.
https://uw-comphys.github.io/openccm/
GNU Lesser General Public License v2.1
0 stars 3 forks source link

JOSS review #37

Open luohancfd opened 1 month ago

luohancfd commented 1 month ago

Hi authors! I have a few comments regarding to the review.

Alex-Vasile commented 1 month ago

NetworkX The package is currently listed as an optional requirement as it isn't needed for the main functionality of the package. It's only needed for certain optional post processing functionality, specifically if network_diagram is set to True, which is the current default.

RTD I will look into incorporating that calculation script into the OpenCMP example provided, as that example and the simulation from the paper are derived from the same source.

Symlink I will take a look and test alternatives for symlinking. I'm thinking automatically falling back to a plain file copy, and displaying a warning, would be preferable to throwing the error.

This would let the user know that a faster alternative is available, but does not force them to run with admins privileges, which may be an impossible expectation in certain corporate engineering settings. And it would generally be less risky for the user to not have to run it with admin privileges.

Alex-Vasile commented 1 week ago

@luohancfd Hi there, let me know if the changes in #38 properly address your above comments.

luohancfd commented 15 hours ago

@Alex-Vasile

I'm struggling with the example cases and need your help to address them.

  1. examples/OpenCMP: I assume config_Stokes generates and initial guess, config_INS is for single specie transient incompressible flow simulation, config_MCINS is for multi-species one. Although the usage of OpenCMP is beyond the topic of this repo, it's better to document that. I ran the config_Stokes case successfully. But the config_INS case took extensive time. Is it really necessary to run to 5000s? The same reason applies to the config_MCINS. I found I can still run the compartment modeling part with the time_range reduced to 30s and get similar plot by running analysis.py. If it's really necessary, please provide an example output. I found you have results published https://www.sciencedirect.com/science/article/pii/S0098135424000681?via%3Dihub for config_INS but nothing for config_MCINS. Besides, I'm a little confused why you can compare the compartment modeling with the config_MCINS. In the compartment modeling, it seems you are modeling an almost irrevisble reaction Na2CO3 + CaCl2 -> 2NaCl + CaCO3 (I assume this is gas phase reaction). But I couldn't understand what the case config_MCINS is doing. According to this tutorial case https://opencmp.io/tutorials/tutorial_8.html, you are solving an additional mass conservation equation as a. But I couldn't find a similar [SURFACE_RXN] block. You do have a block named [FUNCTIONS]/source in file model_config, but it's 0 for a. I personally feel it's OK to not explain every details of a case, especially when the case is targeted for a specific academic usage. But if you decide to publish your code, it's better to let the user understand what is going on for the example cases.
  2. examples/OpenFOAM: I built OpenFOAM-12 download link https://openfoam.org/download/12-source/, sha256 are listed here in case it matters : e59fad54c62e64f1bb89dbaebe5f99a76dc0a6a91d9aad86042a7c4cef6d0744 OpenFOAM-12.tar.gz 8159763451f714387a3846e9c09717533f293107204a3ad470e4acbaa8ce356b ThirdParty-12.tar.gz. I didn't change the mesh. So I just renamed folder "_0" to "0", and invoke foamRun (step 5 in your instruction). I didn't see any difference of T and Vc for 0 and 300. Is that the expected behavior? In you instruction, you mentioned
    1. Open controlDict, comment out the solve line with incompressibleFluid and uncomment the two lines below it defining a new solve and subSulver, finally uncomment the #includeFunc scalarTransport line at the bottom of the file.

But the file you posted https://github.com/uw-comphys/openccm/blob/a18be55ddb1fb0f0f501c3f7d38c4b68cab9b51f/examples/OpenFOAM/pipe_with_recirc/system/controlDict#L19-L24

has already uncommented the lines.

If this is a mistake, please fix it. Also, please provide a tagged frozen version for review. While I'm writting this comment, I see a new PR get merged.

  1. pytests: I failed to run the tests due to missing files from the examples folder. Please correct the examples, or provide independent test files that don't rely on other data/folder.
Alex-Vasile commented 2 hours ago

@luohancfd

  1. I looked into it a bit more, and I'll include some of the pre-computed files. To clarify some of your other points.

    • Yes, the Stokes solve is used as an initial condition for the INS solve.
    • No, INS is for only the hydrodynamics with no species transport. MCINS is for n-component reactive flows coupled with INS for hydrodynamics. Here Stokes and INS are used to find the steady state velocity profile in this domain, which one exists. That steady-state velocity profile is then fixed, to speed up the computation, and used by MCINS to calculate the species transport.
    • The time range for Stokes and INS were leftover from when those simulations were transient, the program solves directly for the steady-state flow profile. The value for the time was irrelevant since it wasn't used. I have removed it as it may confuse others. The time it takes to solve the INS simulation is dictated by the size of the resulting matrix and how many non-linear iterations are required to obtain the steady-state.
    • There are two compartmental model configuration files inside pipe_recird_2d:
      1. CONFIG: Creates a compartmental model and then runs an inert tracer simualtion on it for calculating residence time. This is the same as the CFD simulation described by CONFIG_MCINS. This simulation is what gets compared to the CFD results.
      2. CONFIG_W_RXN: This also creates a compartmental model but it shows how to run a reactive species simulation, using a reversible reaction and chemical specie variable names. This is simulation is not compared to any CFD.
  2. The 0/ directory contains the pre-computed steady-state results. The instructions state that if you wish to use these results and go straight to running the inert tracer CFD simulation to skip to step 13. I have changed the wording to make this more clear.

  3. The tests should have all of the data they need, I updated them in another PR to generate any input data they need. However, They need to be run from inside the pytest folder. #43 addresses this issue. Once that's merged the tests can be run using the openccm-tests entry point from any directory.

See #49 for changed related to these comments.