View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003744 | OpenFOAM | Bug | public | 2021-10-22 18:42 | 2021-10-27 23:50 |
Reporter | millszg | Assigned To | henry | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Platform | GNU/Linux | OS | Ubuntu | OS Version | 15.04 |
Fixed in Version | dev | ||||
Summary | 0003744: Unable to use codedFunction2 for the binary diffusion terms in the thermophysical transport models | ||||
Description | When attempting to use a codedFunction2 for the binary diffusion terms in the thermophysical transport model, the code is unable to compile because the dictionary key which contains a dash (i.e. H2-H) is used in the name of the generated functions. I am new to using codedFunction2, so I'm not sure if it is possible to specify the name to use for the generated function, but if not, its likely not possible to use codedFunction2 in the current implementation. Currently I have implemented changes in the code to use an underscore instead of a dash in the binary diffusion term keys. This allows for codedFunction2 to be used as the generated names no longer have an illegal character in them, but I have not tested to make sure it doesn't break other parts of the code. | ||||
Steps To Reproduce | I believe this will occur anytime codedFunction2 is used for a binary diffusion term in the thermophysicalTransport file. Specifically for me, using the following in thermophysicalTransport with reactingFoam produced errors relating to the function name (which contained H2-H) when the dynamic code was being compiled: simulationType laminar; laminar { model FickianFourier; mixtureDiffusionCoefficients no; D { H2-H { type coded; code #{ return x * sqrt(x) / y * (0.00300504 + x * (5.57725e-06 + x * (-6.00278e-09 + x * (3.45469e-12 + x * (-7.73951e-16))))); #}; } } When I updated the code in | ||||
Additional Information | By changing lines 116 and 117 in Fickian.C from: const word nameij(species[i] + '-' + species[j]); const word nameji(species[j] + '-' + species[i]); to: const word nameij(species[i] + '_' + species[j]); const word nameji(species[j] + '_' + species[i]); and updating the binary diffusion keys in thermophysicalTransport to use underscores as well, the dynamic code was able to compile and reactingFoam was able to run without issues. | ||||
Tags | No tags attached. | ||||
|
Try this in OpenFOAM-dev: commit ad28cb49b553efb43f036b424bd8b5d0c0022c7c (HEAD -> master, origin/master, origin/HEAD) Author: Henry Weller <http://cfd.direct> Date: Sun Oct 24 11:38:55 2021 +0100 codedBase: Added support for '-' in entry names by mapping '-' to '_' in the generation of the code name. Resolves bug-report https://bugs.openfoam.org/view.php?id=3744 |