CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM CC Toolkits for Fluid-Structure Interaction (https://www.cfd-online.com/Forums/openfoam-cc-toolkits-fluid-structure-interaction/)
-   -   Finding Q and vorticity for FSI case (https://www.cfd-online.com/Forums/openfoam-cc-toolkits-fluid-structure-interaction/241871-finding-q-vorticity-fsi-case.html)

MFWilliams March 24, 2022 05:32

Finding Q and vorticity for FSI case
 
Hello all,


I am stuck trying to post process the results of my FSI simulation to try get data for Q and vorticity.



I have managed to get wall shear stress data by using 'wallShearStresss -region fluid', but that does not work for Q or vorticity and I get the output:
Code:

options:
  -DebugSwitches <key1=val1,key2=val2,...>
  -DimensionedConstants <key1=val1,key2=val2,...>
  -InfoSwitches <key1=val1,key2=val2,...>
  -OptimisationSwitches <key1=val1,key2=val2,...>
  -Tolerances <key1=val1,key2=val2,...>
  -case <dir>      specify alternate case directory, default is the cwd
  -constant        include the 'constant/' dir in the times list
  -dict <dictionary name>
  -dumpControlSwitches
  -latestTime      select the latest time
  -newTimes        select the new times
  -noFunctionObjects
                    do not execute functionObjects
  -noWrite
  -noZero          exclude the '0/' dir from the times list, has precedence
                    over the -withZero option
  -parallel        run in parallel
  -roots <(dir1 .. dirN)>
                    slave root directories for distributed running
  -time <ranges>    comma-separated time ranges - eg, ':10,20,40:70,1000:'
  -srcDoc          display source code in browser
  -doc              display application documentation in browser
  -help            print the usage

Using: foam-extend-4.1 (see www.foam-extend.org)
Build: 4.1-70b064d0f326


Please can somebody please help me to find Q and vorticity from an already completed simulation.


Best regards
Merlin

bigphil March 24, 2022 08:00

Inconveniently, many of the utilities do not yet have the "-region" option.
So your options are:
  • Make a copy of the utility of interest and add the "-region" option in the code and compile the utility with a new name e.g. myWallShearStress and place it in FOAM_USER_APPBIN
  • Or, temporarily move the fluid fields from the fluid region to the main/default region, then run the utility on the case (no need for "-region") then move the fields back, e.g. see some example bash code below

Example bash code for option 2 to move fluid region fields to the main/default region:
Code:

#!/bin/bash                                                                                                                                                                                               

for i in $(foamListTimes)
do
    echo "${i}"
    cd "${i}"
    mv fluid/* .
    cd ..
done

Then run the utility.

Example bash code for option 2 to move main/default fields back to the fluid region:
Code:

#!/bin/bash                                                                                                                                                                                               

shopt -s extglob

for i in $(foamListTimes)
do
    echo "${i}"
    cd "${i}"
    mv !(solid|fluid) fluid/
    cd ..
done


MFWilliams March 29, 2022 12:20

Dear Mr Cardiff,


Thank you very much for this response. Sadly I already used option 2 and had to go through and move the files individually and this would have saved a lot of time. But I will absolutely use it again if I need to.



Thank you for your help
Merlin


All times are GMT -4. The time now is 14:27.