Custom option from shared library does not execute addsup
Summary
Custom coded option, placed in an shared library, is loaded and constructed from solver. But addsup are not executed in all time steps. Exact same code as scalarCodedSource is executed as aspected.
Steps to reproduce
Run the example case and take an look to the solver log file. Code for scalarCodedSource and custom coded option are identical and applied to bottomAir region.
Example case
Minimum example: example_1.zip
Directory code contains the wmake project to build the shared library.
Minimum example (attached file) was constructed from v2012 $FOAM_TUTORIALS/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater .
What is the current bug behaviour?
The addSup method of the option is not executed by the solver.
What is the expected correct behavior?
The addSup method of the option is executed by the solver at all timesteps.
Relevant logs and/or images
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2012 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
Build : 308af39136-20210426 OPENFOAM=2012 patch=210414
Arch : "LSB;label=32;scalar=64"
Exec : chtMultiRegionFoam
Date : May 31 2021
Time : 23:01:05
Host : e10491f6fb91
PID : 3822
I/O : uncollated
Case : /data
nProcs : 1
trapFpe: Floating point exception trapping enabled (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 5, maxFileModificationPolls 20)
allowSystemOperations : Allowing user-supplied system call operations
...
Adding fvOptions
Creating finite volume options from "constant/fvOptions"
Selecting finite volume options type scalarCodedSource
Source: codedSource1
- selecting all cells
- selected 3952 cell(s) with volume 0.0007786667
Selecting finite volume options type myCustomCodeOption
Source: codedSource2
- selecting all cells
- selected 3952 cell(s) with volume 0.0007786667
Constructor: myCustomCodeOption
*** Reading fluid mesh thermophysical properties for region topAir
...
Solving for fluid region bottomAir
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
DILUPBiCGStab: Solving for Ux, Initial residual = 1, Final residual = 9.813842e-11, No Iterations 1
DILUPBiCGStab: Solving for Uy, Initial residual = 1, Final residual = 4.796629e-11, No Iterations 1
DILUPBiCGStab: Solving for Uz, Initial residual = 1, Final residual = 1.290181e-10, No Iterations 1
Using dynamicCode for fvOption::sourceTime at line 20 in "/data/constant/bottomAir/fvOptions.codedSource1"
Could not load > "/data/dynamicCode/platforms/linux64GccDPInt32Opt/lib/libsourceTime_e97fe6ced1b0ca40c9289d9da8b1add0a8482aa2.so"
/data/dynamicCode/platforms/linux64GccDPInt32Opt/lib/libsourceTime_e97fe6ced1b0ca40c9289d9da8b1add0a8482aa2.so: cannot open shared object file: No such file or directory
Creating new library in "dynamicCode/sourceTime/platforms/linux64GccDPInt32Opt/lib/libsourceTime_e97fe6ced1b0ca40c9289d9da8b1add0a8482aa2.so"
Invoking wmake libso /data/dynamicCode/sourceTime
wmake libso /data/dynamicCode/sourceTime
ln: ./lnInclude
dep: codedFvOptionTemplate.C
Ctoo: codedFvOptionTemplate.C
ld: /data/dynamicCode/sourceTime/../platforms/linux64GccDPInt32Opt/lib/libsourceTime_e97fe6ced1b0ca40c9289d9da8b1add0a8482aa2.so
Selecting finite volume options type sourceTime
Source: sourceTime
- selecting all cells
- selected 3952 cell(s) with volume 0.0007786667
Hello scalarCodedSource.
DILUPBiCGStab: Solving for h, Initial residual = 0.9999996, Final residual = 1.079829e-10, No Iterations 1
Min/max T:300 300
GAMG: Solving for p_rgh, Initial residual = 0.8519038, Final residual = 0.008084614, No Iterations 5
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors (bottomAir): sum local = 1.199034e-05, global = 2.856298e-15, cumulative = 2.856298e-15
GAMG: Solving for p_rgh, Initial residual = 0.259271, Final residual = 7.494411e-08, No Iterations 23
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors (bottomAir): sum local = 2.862262e-06, global = 1.923892e-15, cumulative = 4.78019e-15
...
Solving for fluid region bottomAir
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
DILUPBiCGStab: Solving for Ux, Initial residual = 0.9504684, Final residual = 1.315995e-11, No Iterations 1
DILUPBiCGStab: Solving for Uy, Initial residual = 0.3615856, Final residual = 7.315234e-12, No Iterations 1
DILUPBiCGStab: Solving for Uz, Initial residual = 0.375026, Final residual = 6.384547e-12, No Iterations 1
Hello scalarCodedSource.
DILUPBiCGStab: Solving for h, Initial residual = 0.9992415, Final residual = 8.874669e-11, No Iterations 1
Min/max T:299.9998 300.6861
...
Environment information
- OpenFOAM version : v2021
- Operating system : archlinux, centos in docker container
- Hardware info : AMD Ryzen, docker container env.
- Compiler : gcc
Possible fixes
atm.
Edited by Thomas Enzinger