MiguelMValero / CONES

CONES: This git repository aims to couple the CFD software OpenFOAM with any other kind of open-source codes. It is currently employed to carry out sequential Data Assimilation techniques and, more specifically, an Ensemble Kalman Filter (EnKF). The communications between the EnKF and OpenFOAM are performed by a coupler called CWIPI.
6 stars 1 forks source link

Merge Miguel & Lucas' branches #7

Closed MiguelMValero closed 3 months ago

MiguelMValero commented 1 year ago

Hello! This issue is to tell you that I finished merging Lucas' and my branch. It's uploaded on the master branch. I would kindly ask you that, in case you want to contribute to the "master" branch, merge or rebase your branch with the "master". I tried the code with the cavity case and the plane channel, and it works well. However, I had to change many things. Here, I am summarizing some of them, but my intention is to upload the user guide with the newest modifications:

  1. I changed all switch variables from "int" to "float". Pay attention to the variable "cwipiVerbose" because if you do not change its declaration in the solvers, it will not work.
  2. The "malloc" declarations are changed to "calloc" declarations.
  3. There are some new inputs in the configuration file and many new outputs inside the folder "results". The latter is explained in the file: https://www.overleaf.com/read/xrxgckrgjqst
    • I added the global friction coefficient as an observation since it has proven to work (not for the cavity test!)
    • I took off the cwipiSymmetry switch.
    • There is a new variable to define the way in which the confidence of the observations is defined: "typeInputs" (0 corresponds to absolute values, 1 corresponds to percentages, and 2 corresponds to the potential function (in elaboration)).
    • There is a new variable to define the type of inflation: "typeInfl" (0 corresponds to stochastic, and 1 corresponds to deterministic). If anybody wants to switch it off, typeInf = 1, and the values of both lambdas = 1.
    • About the error, I continued using $L_2$, but I think it's worth exploring other alternatives (I will do it when I have some time). An error in absolute value and a normalized error are defined for EACH VARIABLE $(u_x, u_y, u_z, p, C_f)$
    • The "cellIDs" file inside the folder "results" gives the IDs of the cells where the local observations are.
    • The file apparently has no bugs (deadlocks, MPI errors, segmentation fault...) when finalizing CWIPI and MPI for the cavity test (it needs more testing for the plane channel or other cases where the initial time is not equal to 0).
  4. The code needs an urgent restructuration (possibly more modular) because there are some functions that start becoming very heavy ("KF"). In the same way, it might be a good idea to divide the "cwipiPstream" folder into several depending on the test case employed.
  5. All of you have direct access to merge on the "master" branch, and I encourage you to do it if you have good proposals. But every time that you upload it, please, open an issue explaining the changes (and I will also include them in the user guide later).
  6. I think it would be a good idea to develop a function (similar to the command "sed" in shell) to read the configuration file no matter the order in which the inputs are set.

These things do not mean that modifications are not allowed. I just wanted to have a common starting point for further implementations like mesh decomposition. Of course, if you have any proposals, you are welcome to expose them, and I will try to work on them as soon as possible!

Kind regards, Miguel