Set non-uniform initial condition of alphaPorosity #201
chairmanmao256
started this conversation in
General
Replies: 1 comment 1 reply
-
You cant use the same indices for serial and parallel cases. Check this post: #102 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello! I'm here again!
This time, I'm here to ask how to set a non-uniform initial condition of alphaPorosity. I've already taken a few steps to achieve this goal. But I met some problems.
I'd like to set alphaPorosity to 1e4 in all cells within the box defined by myself. I managed to get all the cell-index (global index) of the cells that locate in the box. The index-list is stored in a file called: 'cells.txt', which is as follows:
Then I use this index-list to set the initial value of alphaPorosity in
runScript.py
:Everything is OK when I run DAFoam using only one core. (i.e. The alphaPorosity is set to 1e4 in the box specified by myself.) However, if I run DAFoam in parallel mode, the real initial field of alphaPorosity is by no means similar to the initial field I want to set.(i.e. The alphaPosority distributes randomly in the entire field instead of accumulating in the box specified by myself.)
I believe that the function
setFieldValue4GlobalCellI
has something to do with this problem. [As I understanded, the function just change theglobalIndex
(read from the alphaPorosity arrayalphaPorosity0
specified inrunScript.py
) tolocalIndex
.] But I can't tell where the problem is.Thank you!
Beta Was this translation helpful? Give feedback.
All reactions