CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Using OpenFOAM to run a 2D convection-diffusion simulation of a compressible steady-s (https://www.cfd-online.com/Forums/openfoam/239224-using-openfoam-run-2d-convection-diffusion-simulation-compressible-steady-s.html)

foadsf October 26, 2021 08:57

Using OpenFOAM to run a 2D convection-diffusion simulation of a compressible steady-s
 
Following this question, I'm thinking of using OpenFOAM to run a series of simulations measuring the amount of net heat transferred through a relatively small hole in a thin isolating wall, between two half infinite spaces:

https://i.stack.imgur.com/c0n8H.png

assumptions:
  • The problem is 2D
  • I'm interested in steady-state results
  • The hot area is actively heated and the cold area is actively cooled. So at distances far away from the hole, the temperatures are constant T1 and T2, in the hot and cold areas, respectively.
  • D, the height of the hole, is relatively negligible compared to the dimensions of the two spaces
  • Fluid is a compressible ideal gas, i.e., air
  • We may ignore radiation, but we need to consider convection, conduction, diffusion...
  • The wall's thickness is negligible, but it is fully isolating

What I would like to know is that given T1, T2, and D, what is the net heat transferred through the hole.


Things I am not sure how to do:
  1. Is it possible to have a hyperbolic 2D mesh? It seems like the natural coordinate system for my problem.
  2. What solver should I use? I think I need to use either of the options rhoSimpleFoam, buoyantSimpleFoam, ... I am not sure if the flow will be laminar or turbulent, and surprisingly enough there are no laminar and steady-state solvers!
  3. What boundary conditions should I implement to represent active heating/cooling and the fact that D is insignificant compared to the dimensions of the two spaces?
  4. How to measure to total heat transferred through the hole? I think this should be done in the post-processing software (e.g., ParaView)


I used to use OpenFOAM a couple of years ago but the knowledge has completely faded away now. I'm basically not sure where to start and how to follow from there. I would appreciate it if you could help me get it started.

s1291 October 26, 2021 11:59

1) What do you mean by having a hyperbolic 2D mesh? the mesh is extruded using a hyperbolic marching from the walls? if so why should that matter?

2) I've never used CHT (conjugate heat transfer) before, but I believe that you need to use a CHT solver such as chtMultiRegionFoam.

3) I think you need to use a source term for heating/cooling. You can use fvOptions for that (using scalarSemiImplicitSource ?).

4) I am not sure but I maybe there are some function objects for that purpose.

Regards

foadsf December 6, 2021 05:19

Implementing the geometry in blockMeshDict
 
1 Attachment(s)
as a follow-up, I first tried modeling the problem in Elmer here. Sadly Elmer doesn't seem to be very capable when it comes to compressive and turbulent flow, I'm being told.

Now I want to try OpenFOAM again. To start I have implemented the geometry

https://i.imgur.com/eFXs9DB.png

in blockMesh/blockMeshDict (see the blockMeshDict.zip file attached here). Now there are some issues that I am not sure about:
  • Can I have both sides of a face as two different boundary conditions? I believe it is called "internal boundary condition". for example in the picture above, (6 4 16 18) and (18 16 4 6) both are isolating walls (∇q = 0) in my boundary condition. Is this acceptable?
  • Can I have a big face, covering multiple blocks? For example in the above example, face (0 5 3 2) covers all existing six blocks. Is this OK, or do I have to define six different boundary faces for each hex block?
  • I need my mesh to be finer around the hole in the middle. How can/should I change the blockMeshDict file and the simpleGrading parameters to do so?

and in general, are there any other points that I have missed? Thanks for your support in advance.

foadsf December 7, 2021 04:21

fixed some syntax error but it still doesn't generate the mesh
 
1 Attachment(s)
So far I have fixed several syntax mistakes. But the mesh still doesn't compile:

Code:

/*---------------------------------------------------------------------------*\
  =========                |
  \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox
  \\    /  O peration    | Website:  https://openfoam.org
    \\  /    A nd          | Version:  8
    \\/    M anipulation  |
\*---------------------------------------------------------------------------*/
/*  Windows 32 and 64 bit porting by blueCAPE: http://www.bluecape.com.pt  *\
|  Based on Windows porting (2.0.x v4) by Symscape: http://www.symscape.com  |
\*---------------------------------------------------------------------------*/
Build  : 8-53cd1468e263
Exec  : C:/Users/FOOBAR~1/Desktop/BLUECF~1/OpenFOAM-8/platforms/mingw_w64GccDPInt32Opt/bin/blockMesh.exe
Date  : Dec 07 2021
Time  : 10:10:16
Host  : "..."
PID    : 14556
I/O    : uncollated
Case  : C:/Users/foobar/Desktop/NatConvHole
nProcs : 1
SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 10)
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Creating block mesh from
    "system/blockMeshDict"
Using #calcEntry at line 31 in file "C:/Users/foobar/Desktop/NatConvHole/system/blockMeshDict"
Using #codeStream with "C:/Users/foobar/Desktop/NatConvHole/dynamicCode/platforms/mingw_w64GccDPInt32Opt/lib/libcodeStream_bb2ab769c7dc73e86d95f4cb26e7041d546c2e6f.so"
Creating new library in "dynamicCode/_bb2ab769c7dc73e86d95f4cb26e7041d546c2e6f/platforms/mingw_w64GccDPInt32Opt/lib/libcodeStream_bb2ab769c7dc73e86d95f4cb26e7041d546c2e6f.so"
Invoking "wmake -s libso C:/Users/foobar/Desktop/NatConvHole/dynamicCode/_bb2ab769c7dc73e86d95f4cb26e7041d546c2e6f"

C:\Users\foobar\Desktop\NatConvHole>sh.exe -c "wmake -s libso C:/Users/foobar/Desktop/NatConvHole/dynamicCode/_bb2ab769c7dc73e86d95f4cb26e7041d546c2e6f"
wmake libso C:/Users/foobar/Desktop/NatConvHole/dynamicCode/_bb2ab769c7dc73e86d95f4cb26e7041d546c2e6f
    ln: ./lnInclude
    wmkdep: codeStreamTemplate.C
    Ctoo: codeStreamTemplate.C
$(C:/Users/FOOBAR~1/Desktop/BLUECF~1/OpenFOAM-8/wmake/scripts/makeReinterpretExePath windres) Make/mingw_w64GccDPInt32Opt/version_of_build.rc Make/mingw_w64GccDPInt32Opt/version_of_build.o
    ld: /c/Users/foobar/Desktop/NatConvHole/dynamicCode/platforms/mingw_w64GccDPInt32Opt/lib/libcodeStream_bb2ab769c7dc73e86d95f4cb26e7041d546c2e6f.dll
    cv2pdb: /c/Users/foobar/Desktop/NatConvHole/dynamicCode/platforms/mingw_w64GccDPInt32Opt/lib/libcodeStream_bb2ab769c7dc73e86d95f4cb26e7041d546c2e6f.dll
C:/Users/foobar/Desktop/NatConvHole/dynamicCode/platforms/mingw_w64GccDPInt32Opt/lib/libcodeStream_bb2ab769c7dc73e86d95f4cb26e7041d546c2e6f.pdb: cannot load PDB helper DLL
Error occurred with cv2pdb, have stripped binary as a workaround.
Using #calcEntry at line 40 in file "C:/Users/foobar/Desktop/NatConvHole/system/blockMeshDict"
Using #codeStream with "C:/Users/foobar/Desktop/NatConvHole/dynamicCode/platforms/mingw_w64GccDPInt32Opt/lib/libcodeStream_0dacf6e2b2c7b448a15a6c4785b99d9461616f91.so"
Creating new library in "dynamicCode/_0dacf6e2b2c7b448a15a6c4785b99d9461616f91/platforms/mingw_w64GccDPInt32Opt/lib/libcodeStream_0dacf6e2b2c7b448a15a6c4785b99d9461616f91.so"
Invoking "wmake -s libso C:/Users/foobar/Desktop/NatConvHole/dynamicCode/_0dacf6e2b2c7b448a15a6c4785b99d9461616f91"

C:\Users\foobar\Desktop\NatConvHole>sh.exe -c "wmake -s libso C:/Users/foobar/Desktop/NatConvHole/dynamicCode/_0dacf6e2b2c7b448a15a6c4785b99d9461616f91"
wmake libso C:/Users/foobar/Desktop/NatConvHole/dynamicCode/_0dacf6e2b2c7b448a15a6c4785b99d9461616f91
    ln: ./lnInclude
    wmkdep: codeStreamTemplate.C
    Ctoo: codeStreamTemplate.C
$(C:/Users/FOOBAR~1/Desktop/BLUECF~1/OpenFOAM-8/wmake/scripts/makeReinterpretExePath windres) Make/mingw_w64GccDPInt32Opt/version_of_build.rc Make/mingw_w64GccDPInt32Opt/version_of_build.o
    ld: /c/Users/foobar/Desktop/NatConvHole/dynamicCode/platforms/mingw_w64GccDPInt32Opt/lib/libcodeStream_0dacf6e2b2c7b448a15a6c4785b99d9461616f91.dll
    cv2pdb: /c/Users/foobar/Desktop/NatConvHole/dynamicCode/platforms/mingw_w64GccDPInt32Opt/lib/libcodeStream_0dacf6e2b2c7b448a15a6c4785b99d9461616f91.dll
C:/Users/foobar/Desktop/NatConvHole/dynamicCode/platforms/mingw_w64GccDPInt32Opt/lib/libcodeStream_0dacf6e2b2c7b448a15a6c4785b99d9461616f91.pdb: cannot load PDB helper DLL
Error occurred with cv2pdb, have stripped binary as a workaround.
Using #calcEntry at line 42 in file "C:/Users/foobar/Desktop/NatConvHole/system/blockMeshDict"
Using #codeStream with "C:/Users/foobar/Desktop/NatConvHole/dynamicCode/platforms/mingw_w64GccDPInt32Opt/lib/libcodeStream_14e88731353dbdb7d49e0cda1faa7bfafef87455.so"
Creating new library in "dynamicCode/_14e88731353dbdb7d49e0cda1faa7bfafef87455/platforms/mingw_w64GccDPInt32Opt/lib/libcodeStream_14e88731353dbdb7d49e0cda1faa7bfafef87455.so"
Invoking "wmake -s libso C:/Users/foobar/Desktop/NatConvHole/dynamicCode/_14e88731353dbdb7d49e0cda1faa7bfafef87455"

C:\Users\foobar\Desktop\NatConvHole>sh.exe -c "wmake -s libso C:/Users/foobar/Desktop/NatConvHole/dynamicCode/_14e88731353dbdb7d49e0cda1faa7bfafef87455"
wmake libso C:/Users/foobar/Desktop/NatConvHole/dynamicCode/_14e88731353dbdb7d49e0cda1faa7bfafef87455
    ln: ./lnInclude
    wmkdep: codeStreamTemplate.C
    Ctoo: codeStreamTemplate.C
$(C:/Users/FOOBAR~1/Desktop/BLUECF~1/OpenFOAM-8/wmake/scripts/makeReinterpretExePath windres) Make/mingw_w64GccDPInt32Opt/version_of_build.rc Make/mingw_w64GccDPInt32Opt/version_of_build.o
    ld: /c/Users/foobar/Desktop/NatConvHole/dynamicCode/platforms/mingw_w64GccDPInt32Opt/lib/libcodeStream_14e88731353dbdb7d49e0cda1faa7bfafef87455.dll
    cv2pdb: /c/Users/foobar/Desktop/NatConvHole/dynamicCode/platforms/mingw_w64GccDPInt32Opt/lib/libcodeStream_14e88731353dbdb7d49e0cda1faa7bfafef87455.dll
C:/Users/foobar/Desktop/NatConvHole/dynamicCode/platforms/mingw_w64GccDPInt32Opt/lib/libcodeStream_14e88731353dbdb7d49e0cda1faa7bfafef87455.pdb: cannot load PDB helper DLL
Error occurred with cv2pdb, have stripped binary as a workaround.
Creating block edges
No non-planar block faces defined
Creating topology blocks
Creating topology patches

Creating block mesh topology


--> FOAM FATAL ERROR:
face 1 in patch 0 does not have neighbour cell face: 4(12 17 5 0)

    From function Foam::labelList Foam::polyMesh::facePatchFaceCells(const faceList&, const labelListList&, const faceListList&, Foam::label) const
    in file meshes/polyMesh/polyMeshFromShapeMesh.C at line 118.

FOAM aborting

Generating stack trace...


Backtrace:
        ZN10StackTraceC1Ev [0x626c1855+0x25]
                module: C:\Users\FOOBAR~1\Desktop\BLUECF~1\ThirdParty-8\platforms\mingw_w64GccDPInt32\lib\libstack_trace.dll
        ZN4Foam5error10printStackERNS_7OstreamE [0x6c30ae5a+0x23a]
                module: C:\Users\FOOBAR~1\Desktop\BLUECF~1\OpenFOAM-8\platforms\mingw_w64GccDPInt32Opt\lib\libOpenFOAM.dll
        ZN4Foam5error5abortEv [0x6c0c68b1+0x211]
                module: C:\Users\FOOBAR~1\Desktop\BLUECF~1\OpenFOAM-8\platforms\mingw_w64GccDPInt32Opt\lib\libOpenFOAM.dll
        ZNK4Foam8polyMesh18facePatchFaceCellsERKNS_4ListINS_4faceEEERKNS1_INS1_IiEEEERKNS1_IS3_EEi [0x6c26d96c+0x2fc]
                module: C:\Users\FOOBAR~1\Desktop\BLUECF~1\OpenFOAM-8\platforms\mingw_w64GccDPInt32Opt\lib\libOpenFOAM.dll
        ZN4Foam8polyMesh11setTopologyERKNS_4ListINS_9cellShapeEEERKNS1_INS1_INS_4faceEEEEERKNS1_INS_4wordEEERNS1_IiEESG_RiSH_RNS1_INS_4cellEEE [0x6c26e0a0+0x6a0]
                module: C:\Users\FOOBAR~1\Desktop\BLUECF~1\OpenFOAM-8\platforms\mingw_w64GccDPInt32Opt\lib\libOpenFOAM.dll
        ZN4Foam8polyMeshC1ERKNS_8IOobjectEONS_5FieldINS_6VectorIdEEEERKNS_4ListINS_9cellShapeEEERKNS9_INS9_INS_4faceEEEEERKNS9_INS_4wordEEERKNS_7PtrListINS_10dictionaryEEERKSJ_ST_b [0x6c271629+0x7a9]
                module: C:\Users\FOOBAR~1\Desktop\BLUECF~1\OpenFOAM-8\platforms\mingw_w64GccDPInt32Opt\lib\libOpenFOAM.dll
        ZN4Foam9blockMesh14createTopologyERKNS_12IOdictionaryERKNS_4wordE [0x67e22b6d+0x11ad]
                module: C:\Users\FOOBAR~1\Desktop\BLUECF~1\OpenFOAM-8\platforms\mingw_w64GccDPInt32Opt\lib\libblockMesh.dll
        ZN4Foam9blockMeshC1ERKNS_12IOdictionaryERKNS_4wordE [0x67e1c49d+0x51d]
                module: C:\Users\FOOBAR~1\Desktop\BLUECF~1\OpenFOAM-8\platforms\mingw_w64GccDPInt32Opt\lib\libblockMesh.dll
        (No symbol) [0x406c1e]
                module: C:\Users\FOOBAR~1\Desktop\BLUECF~1\OpenFOAM-8\platforms\mingw_w64GccDPInt32Opt\bin\blockMesh.exe
        (No symbol) [0x4013c1]
                module: C:\Users\FOOBAR~1\Desktop\BLUECF~1\OpenFOAM-8\platforms\mingw_w64GccDPInt32Opt\bin\blockMesh.exe
        (No symbol) [0x4014f6]
                module: C:\Users\FOOBAR~1\Desktop\BLUECF~1\OpenFOAM-8\platforms\mingw_w64GccDPInt32Opt\bin\blockMesh.exe
        BaseThreadInitThunk [0x7ffb55217034+0x14]
                module: C:\WINDOWS\System32\KERNEL32.DLL
        RtlUserThreadStart [0x7ffb55c62651+0x21]
                module: C:\WINDOWS\SYSTEM32\ntdll.dll

P.S. I am following up on this issue, here on the OpenCFD GitHub repository.

night-hawk December 7, 2021 07:05

Quote:

Originally Posted by foadsf (Post 818045)
So far I have fixed several syntax mistakes. But the mesh still doesn't compile:

Code:

/*---------------------------------------------------------------------------*\
  =========                |
  \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox
  \\    /  O peration    | Website:  https://openfoam.org
    \\  /    A nd          | Version:  8
    \\/    M anipulation  |
\*---------------------------------------------------------------------------*/
/*  Windows 32 and 64 bit porting by blueCAPE: http://www.bluecape.com.pt  *\
|  Based on Windows porting (2.0.x v4) by Symscape: http://www.symscape.com  |
\*---------------------------------------------------------------------------*/
Build  : 8-53cd1468e263
Exec  : C:/Users/FOOBAR~1/Desktop/BLUECF~1/OpenFOAM-8/platforms/mingw_w64GccDPInt32Opt/bin/blockMesh.exe
Date  : Dec 07 2021
Time  : 10:10:16
Host  : "..."
PID    : 14556
I/O    : uncollated
Case  : C:/Users/foobar/Desktop/NatConvHole
nProcs : 1
SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 10)
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Creating block mesh from
    "system/blockMeshDict"
Using #calcEntry at line 31 in file "C:/Users/foobar/Desktop/NatConvHole/system/blockMeshDict"
Using #codeStream with "C:/Users/foobar/Desktop/NatConvHole/dynamicCode/platforms/mingw_w64GccDPInt32Opt/lib/libcodeStream_bb2ab769c7dc73e86d95f4cb26e7041d546c2e6f.so"
Creating new library in "dynamicCode/_bb2ab769c7dc73e86d95f4cb26e7041d546c2e6f/platforms/mingw_w64GccDPInt32Opt/lib/libcodeStream_bb2ab769c7dc73e86d95f4cb26e7041d546c2e6f.so"
Invoking "wmake -s libso C:/Users/foobar/Desktop/NatConvHole/dynamicCode/_bb2ab769c7dc73e86d95f4cb26e7041d546c2e6f"

C:\Users\foobar\Desktop\NatConvHole>sh.exe -c "wmake -s libso C:/Users/foobar/Desktop/NatConvHole/dynamicCode/_bb2ab769c7dc73e86d95f4cb26e7041d546c2e6f"
wmake libso C:/Users/foobar/Desktop/NatConvHole/dynamicCode/_bb2ab769c7dc73e86d95f4cb26e7041d546c2e6f
    ln: ./lnInclude
    wmkdep: codeStreamTemplate.C
    Ctoo: codeStreamTemplate.C
$(C:/Users/FOOBAR~1/Desktop/BLUECF~1/OpenFOAM-8/wmake/scripts/makeReinterpretExePath windres) Make/mingw_w64GccDPInt32Opt/version_of_build.rc Make/mingw_w64GccDPInt32Opt/version_of_build.o
    ld: /c/Users/foobar/Desktop/NatConvHole/dynamicCode/platforms/mingw_w64GccDPInt32Opt/lib/libcodeStream_bb2ab769c7dc73e86d95f4cb26e7041d546c2e6f.dll
    cv2pdb: /c/Users/foobar/Desktop/NatConvHole/dynamicCode/platforms/mingw_w64GccDPInt32Opt/lib/libcodeStream_bb2ab769c7dc73e86d95f4cb26e7041d546c2e6f.dll
C:/Users/foobar/Desktop/NatConvHole/dynamicCode/platforms/mingw_w64GccDPInt32Opt/lib/libcodeStream_bb2ab769c7dc73e86d95f4cb26e7041d546c2e6f.pdb: cannot load PDB helper DLL
Error occurred with cv2pdb, have stripped binary as a workaround.
Using #calcEntry at line 40 in file "C:/Users/foobar/Desktop/NatConvHole/system/blockMeshDict"
Using #codeStream with "C:/Users/foobar/Desktop/NatConvHole/dynamicCode/platforms/mingw_w64GccDPInt32Opt/lib/libcodeStream_0dacf6e2b2c7b448a15a6c4785b99d9461616f91.so"
Creating new library in "dynamicCode/_0dacf6e2b2c7b448a15a6c4785b99d9461616f91/platforms/mingw_w64GccDPInt32Opt/lib/libcodeStream_0dacf6e2b2c7b448a15a6c4785b99d9461616f91.so"
Invoking "wmake -s libso C:/Users/foobar/Desktop/NatConvHole/dynamicCode/_0dacf6e2b2c7b448a15a6c4785b99d9461616f91"

C:\Users\foobar\Desktop\NatConvHole>sh.exe -c "wmake -s libso C:/Users/foobar/Desktop/NatConvHole/dynamicCode/_0dacf6e2b2c7b448a15a6c4785b99d9461616f91"
wmake libso C:/Users/foobar/Desktop/NatConvHole/dynamicCode/_0dacf6e2b2c7b448a15a6c4785b99d9461616f91
    ln: ./lnInclude
    wmkdep: codeStreamTemplate.C
    Ctoo: codeStreamTemplate.C
$(C:/Users/FOOBAR~1/Desktop/BLUECF~1/OpenFOAM-8/wmake/scripts/makeReinterpretExePath windres) Make/mingw_w64GccDPInt32Opt/version_of_build.rc Make/mingw_w64GccDPInt32Opt/version_of_build.o
    ld: /c/Users/foobar/Desktop/NatConvHole/dynamicCode/platforms/mingw_w64GccDPInt32Opt/lib/libcodeStream_0dacf6e2b2c7b448a15a6c4785b99d9461616f91.dll
    cv2pdb: /c/Users/foobar/Desktop/NatConvHole/dynamicCode/platforms/mingw_w64GccDPInt32Opt/lib/libcodeStream_0dacf6e2b2c7b448a15a6c4785b99d9461616f91.dll
C:/Users/foobar/Desktop/NatConvHole/dynamicCode/platforms/mingw_w64GccDPInt32Opt/lib/libcodeStream_0dacf6e2b2c7b448a15a6c4785b99d9461616f91.pdb: cannot load PDB helper DLL
Error occurred with cv2pdb, have stripped binary as a workaround.
Using #calcEntry at line 42 in file "C:/Users/foobar/Desktop/NatConvHole/system/blockMeshDict"
Using #codeStream with "C:/Users/foobar/Desktop/NatConvHole/dynamicCode/platforms/mingw_w64GccDPInt32Opt/lib/libcodeStream_14e88731353dbdb7d49e0cda1faa7bfafef87455.so"
Creating new library in "dynamicCode/_14e88731353dbdb7d49e0cda1faa7bfafef87455/platforms/mingw_w64GccDPInt32Opt/lib/libcodeStream_14e88731353dbdb7d49e0cda1faa7bfafef87455.so"
Invoking "wmake -s libso C:/Users/foobar/Desktop/NatConvHole/dynamicCode/_14e88731353dbdb7d49e0cda1faa7bfafef87455"

C:\Users\foobar\Desktop\NatConvHole>sh.exe -c "wmake -s libso C:/Users/foobar/Desktop/NatConvHole/dynamicCode/_14e88731353dbdb7d49e0cda1faa7bfafef87455"
wmake libso C:/Users/foobar/Desktop/NatConvHole/dynamicCode/_14e88731353dbdb7d49e0cda1faa7bfafef87455
    ln: ./lnInclude
    wmkdep: codeStreamTemplate.C
    Ctoo: codeStreamTemplate.C
$(C:/Users/FOOBAR~1/Desktop/BLUECF~1/OpenFOAM-8/wmake/scripts/makeReinterpretExePath windres) Make/mingw_w64GccDPInt32Opt/version_of_build.rc Make/mingw_w64GccDPInt32Opt/version_of_build.o
    ld: /c/Users/foobar/Desktop/NatConvHole/dynamicCode/platforms/mingw_w64GccDPInt32Opt/lib/libcodeStream_14e88731353dbdb7d49e0cda1faa7bfafef87455.dll
    cv2pdb: /c/Users/foobar/Desktop/NatConvHole/dynamicCode/platforms/mingw_w64GccDPInt32Opt/lib/libcodeStream_14e88731353dbdb7d49e0cda1faa7bfafef87455.dll
C:/Users/foobar/Desktop/NatConvHole/dynamicCode/platforms/mingw_w64GccDPInt32Opt/lib/libcodeStream_14e88731353dbdb7d49e0cda1faa7bfafef87455.pdb: cannot load PDB helper DLL
Error occurred with cv2pdb, have stripped binary as a workaround.
Creating block edges
No non-planar block faces defined
Creating topology blocks
Creating topology patches

Creating block mesh topology


--> FOAM FATAL ERROR:
face 1 in patch 0 does not have neighbour cell face: 4(12 17 5 0)

    From function Foam::labelList Foam::polyMesh::facePatchFaceCells(const faceList&, const labelListList&, const faceListList&, Foam::label) const
    in file meshes/polyMesh/polyMeshFromShapeMesh.C at line 118.

FOAM aborting

Generating stack trace...


Backtrace:
        ZN10StackTraceC1Ev [0x626c1855+0x25]
                module: C:\Users\FOOBAR~1\Desktop\BLUECF~1\ThirdParty-8\platforms\mingw_w64GccDPInt32\lib\libstack_trace.dll
        ZN4Foam5error10printStackERNS_7OstreamE [0x6c30ae5a+0x23a]
                module: C:\Users\FOOBAR~1\Desktop\BLUECF~1\OpenFOAM-8\platforms\mingw_w64GccDPInt32Opt\lib\libOpenFOAM.dll
        ZN4Foam5error5abortEv [0x6c0c68b1+0x211]
                module: C:\Users\FOOBAR~1\Desktop\BLUECF~1\OpenFOAM-8\platforms\mingw_w64GccDPInt32Opt\lib\libOpenFOAM.dll
        ZNK4Foam8polyMesh18facePatchFaceCellsERKNS_4ListINS_4faceEEERKNS1_INS1_IiEEEERKNS1_IS3_EEi [0x6c26d96c+0x2fc]
                module: C:\Users\FOOBAR~1\Desktop\BLUECF~1\OpenFOAM-8\platforms\mingw_w64GccDPInt32Opt\lib\libOpenFOAM.dll
        ZN4Foam8polyMesh11setTopologyERKNS_4ListINS_9cellShapeEEERKNS1_INS1_INS_4faceEEEEERKNS1_INS_4wordEEERNS1_IiEESG_RiSH_RNS1_INS_4cellEEE [0x6c26e0a0+0x6a0]
                module: C:\Users\FOOBAR~1\Desktop\BLUECF~1\OpenFOAM-8\platforms\mingw_w64GccDPInt32Opt\lib\libOpenFOAM.dll
        ZN4Foam8polyMeshC1ERKNS_8IOobjectEONS_5FieldINS_6VectorIdEEEERKNS_4ListINS_9cellShapeEEERKNS9_INS9_INS_4faceEEEEERKNS9_INS_4wordEEERKNS_7PtrListINS_10dictionaryEEERKSJ_ST_b [0x6c271629+0x7a9]
                module: C:\Users\FOOBAR~1\Desktop\BLUECF~1\OpenFOAM-8\platforms\mingw_w64GccDPInt32Opt\lib\libOpenFOAM.dll
        ZN4Foam9blockMesh14createTopologyERKNS_12IOdictionaryERKNS_4wordE [0x67e22b6d+0x11ad]
                module: C:\Users\FOOBAR~1\Desktop\BLUECF~1\OpenFOAM-8\platforms\mingw_w64GccDPInt32Opt\lib\libblockMesh.dll
        ZN4Foam9blockMeshC1ERKNS_12IOdictionaryERKNS_4wordE [0x67e1c49d+0x51d]
                module: C:\Users\FOOBAR~1\Desktop\BLUECF~1\OpenFOAM-8\platforms\mingw_w64GccDPInt32Opt\lib\libblockMesh.dll
        (No symbol) [0x406c1e]
                module: C:\Users\FOOBAR~1\Desktop\BLUECF~1\OpenFOAM-8\platforms\mingw_w64GccDPInt32Opt\bin\blockMesh.exe
        (No symbol) [0x4013c1]
                module: C:\Users\FOOBAR~1\Desktop\BLUECF~1\OpenFOAM-8\platforms\mingw_w64GccDPInt32Opt\bin\blockMesh.exe
        (No symbol) [0x4014f6]
                module: C:\Users\FOOBAR~1\Desktop\BLUECF~1\OpenFOAM-8\platforms\mingw_w64GccDPInt32Opt\bin\blockMesh.exe
        BaseThreadInitThunk [0x7ffb55217034+0x14]
                module: C:\WINDOWS\System32\KERNEL32.DLL
        RtlUserThreadStart [0x7ffb55c62651+0x21]
                module: C:\WINDOWS\SYSTEM32\ntdll.dll

P.S. I am following up on this issue, here on the OpenCFD GitHub repository.

Since you are using openFoam on windows, I will suggest you to enable WSL2

foadsf December 7, 2021 07:23

Quote:

Originally Posted by night-hawk (Post 818058)
Since you are using openFoam on windows, I will suggest you to enable WSL2

I don't have the admin rights to install WSL, as I have explained here.

s1291 December 7, 2021 07:43

Quote:

Can I have both sides of a face as two different boundary conditions? I believe it is called "internal boundary condition". for example in the picture above, (6 4 16 18) and (18 16 4 6) both are isolating walls (∇q = 0) in my boundary condition. Is this acceptable?
If I am not mistaken, you are talking about a baffle (a thin wall).

Quote:

Can I have a big face, covering multiple blocks? For example in the above example, face (0 5 3 2) covers all existing six blocks. Is this OK, or do I have to define six different boundary faces for each hex block?
I need my mesh to be finer around the hole in the middle. How can/should I change the blockMeshDict file and the simpleGrading parameters to do so?
One way (which I think is much easier) is to create a single block with increasing resolution towards the center of the block. Then create two baffles to represent the internal walls.

foadsf December 7, 2021 08:07

1 Attachment(s)
Quote:

Originally Posted by s1291 (Post 818064)
One way (which I think is much easier) is to create a single block with increasing resolution towards the center of the block. Then create two baffles to represent the internal walls.

I already solved the second issue, as it would cause the

Code:

--> FOAM FATAL ERROR:
face 1 in patch 0 does not have neighbour cell face: 4(12 17 5 0)

    From function Foam::labelList Foam::polyMesh::facePatchFaceCells(const faceList&, const labelListList&, const faceListList&, Foam::label) const
    in file meshes/polyMesh/polyMeshFromShapeMesh.C at line 118.

FOAM aborting

error, as discussed here. Check the attachment.

Quote:

Originally Posted by s1291 (Post 818064)
If I am not mistaken, you are talking about a baffle (a thin wall).

the first issue causes the

Code:

--> FOAM FATAL ERROR:
Trying to specify a boundary face 4(16 4 6 18) on the face on cell 2 which is either an internal face or already belongs to some other patch.  This is face 0 of patch 2 named isoWalls.

    From function void Foam::polyMesh::setTopology(const cellShapeList&, const faceListList&, const wordList&, Foam::labelList&, Foam::labelList&, Foam::label&, Foam::label&, Foam::cellList&)
    in file meshes/polyMesh/polyMeshFromShapeMesh.C at line 324.

FOAM aborting

I didn't know about baffles in OpenFOAM. Seems like an interesting way to solve the issue.

s1291 December 7, 2021 08:43

I have tested your blockMeshDict with OpenFOAM8, OpenFOAM9, and OpenFOAM v2106 and it works without any issues.

BTW, your file line ending is \r\n, Please try to run:

Code:

dos2unix blockMeshDict
then run blockMesh utility again.

foadsf December 7, 2021 09:17

I don't have the dos2unix package installed and as you may see in the comments of this post, I am not able to install anything inside the MSYS2:

Code:

pacman -Ss dos2unix
error: mingw32: signature from "David Macek <david.macek.0@gmail.com>" is unknown trust
error: mingw64: signature from "David Macek <david.macek.0@gmail.com>" is unknown trust
error: msys: signature from "David Macek <david.macek.0@gmail.com>" is unknown trust
error: database 'mingw32' is not valid (invalid or corrupted database (PGP signature))
error: database 'mingw64' is not valid (invalid or corrupted database (PGP signature))
error: database 'msys' is not valid (invalid or corrupted database (PGP signature))

maybe these PowerShell oneliners can help.

what I also need to figure out is how to define a faceZone in a topoSetDict file and use the createBaffles command to create the internal thin-walled boundary conditions. (described here)

s1291 December 7, 2021 09:58

Try sed:

Code:

sed -i.bak 's/\r$//' blockMeshDict
If it is not available, use something like notepad++:

From the "Edit" menu, select "EOL Conversion" -> "UNIX/OSX Format".

To find some examples on how to create a faceZoneSet, run:

Code:

find $FOAM_TUTORIALS -name 'topoSetDict' -exec grep -Hi 'faceZone' {} \;
If that doesn't work, here is the output on my Machine (I have switched to OF8 and hope you will have the same dir structures under blueCFD):

Code:

/opt/openfoam8/tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/system/topoSetDict:        type    faceZoneSet;
/opt/openfoam8/tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/system/topoSetDict:        source  setToFaceZone;
/opt/openfoam8/tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/system/topoSetDict:        type    faceZoneSet;
/opt/openfoam8/tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/system/topoSetDict:        source  setToFaceZone;
/opt/openfoam8/tutorials/multiphase/interFoam/RAS/damBreakPorousBaffle/system/topoSetDict:        type    faceZoneSet;
/opt/openfoam8/tutorials/multiphase/interFoam/RAS/damBreakPorousBaffle/system/topoSetDict:        source  setsToFaceZone;
/opt/openfoam8/tutorials/lagrangian/reactingParcelFoam/filter/system/topoSetDict:    // Create faceZone from cycLeft
/opt/openfoam8/tutorials/lagrangian/reactingParcelFoam/filter/system/topoSetDict:        type    faceZoneSet;
/opt/openfoam8/tutorials/lagrangian/reactingParcelFoam/filter/system/topoSetDict:        source  setToFaceZone;
/opt/openfoam8/tutorials/lagrangian/reactingParcelFoam/filter/system/topoSetDict:    // Create faceZone from cycRight
/opt/openfoam8/tutorials/lagrangian/reactingParcelFoam/filter/system/topoSetDict:        type    faceZoneSet;
/opt/openfoam8/tutorials/lagrangian/reactingParcelFoam/filter/system/topoSetDict:        source  setToFaceZone;
/opt/openfoam8/tutorials/lagrangian/reactingParcelFoam/splashPanel/system/topoSetDict:        type    faceZoneSet;
/opt/openfoam8/tutorials/lagrangian/reactingParcelFoam/splashPanel/system/topoSetDict:        source  setToFaceZone;
/opt/openfoam8/tutorials/lagrangian/reactingParcelFoam/cylinder/system/topoSetDict:        type    faceZoneSet;
/opt/openfoam8/tutorials/lagrangian/reactingParcelFoam/cylinder/system/topoSetDict:        source  setToFaceZone;
/opt/openfoam8/tutorials/incompressible/pimpleFoam/RAS/TJunctionFan/system/topoSetDict:        type    faceZoneSet;
/opt/openfoam8/tutorials/incompressible/pimpleFoam/RAS/TJunctionFan/system/topoSetDict:        source  setsToFaceZone;
/opt/openfoam8/tutorials/incompressible/pimpleFoam/RAS/TJunctionFan/system/topoSetDict:        type    faceZoneSet;
/opt/openfoam8/tutorials/incompressible/pimpleFoam/RAS/TJunctionFan/system/topoSetDict:        source  setToFaceZone;
/opt/openfoam8/tutorials/incompressible/pimpleFoam/RAS/oscillatingInletACMI2D/system/topoSetDict:    // Create faceZone for patch couple1
/opt/openfoam8/tutorials/incompressible/pimpleFoam/RAS/oscillatingInletACMI2D/system/topoSetDict:        type    faceZoneSet;
/opt/openfoam8/tutorials/incompressible/pimpleFoam/RAS/oscillatingInletACMI2D/system/topoSetDict:        source  setToFaceZone;
/opt/openfoam8/tutorials/incompressible/pimpleFoam/RAS/oscillatingInletACMI2D/system/topoSetDict:    // Create faceZone for patch couple2
/opt/openfoam8/tutorials/incompressible/pimpleFoam/RAS/oscillatingInletACMI2D/system/topoSetDict:        type    faceZoneSet;
/opt/openfoam8/tutorials/incompressible/pimpleFoam/RAS/oscillatingInletACMI2D/system/topoSetDict:        source  setToFaceZone;

You need to check those tutorials.

s1291 December 7, 2021 10:16

I hope the following will solve your installation issues with pacman on MSYS2:

Code:

pacman -S msys2-keyring
Source:

this thread on github
.

foadsf December 8, 2021 09:36

some updates
 
A couple of minor updates:

- The MSYS2 folks tried helping me here on the Discord server. The MSYS2 issues are resolved but the missing libstdc++-6.dll and msmpi.dll libraries are still persistent.
- Opened a new issue here on the OpenFOAM GitLab repository.
- To search the content of the textual files in the Windows cmd terminal, one can use the native command:

Code:

findstr /s /i /c:"<string>" "*.*" | more

foadsf December 10, 2021 04:12

some questions answered on OpenFOAM Discord
 
Some of the original questions have been answered here on OpenFOAM Discord.

Tobi December 12, 2021 08:08

As I was pinged in Twitter here are the following comments:
  • You can combine one block with two others in blockMesh. Therefore, you need to define things in mergeFaces (not sure about the correct keyword so you can check the blockMeshDict in /etc/caseDicts/annonated/...)
  • If you need a finer mesh inside the "D" hole-area, you need a separated block here. However the refinement will go into the large left and right area. Therefore, I would prefer another way of meshing: create a single block and built some simple geometry. Use snappyHexMesh for meshing the guy.
  • The story about baffle is not the one you would need if you have the blockMesh as given in your picture. You simply define both patches as walls - done.
  • We commonly talk about baffles when we switch internal faces into something else, e.g., walls or cyclic patches. Commonly you create a faceZone (a selection of internal faces). This faceZone can be used by the createBaffles utility to duplicate the internal faces (so we have one face owned by the neighbor cell and one face owned by the owner cell; neigbor and owner nomenclature is based on the internal face). Doing so, we get the posibility to specify two different boundary conditions for the two patches (identical to you blockMesh stuff); by the way
  • As some of your problems are Windows related - no comment to that one; as already suggested WLS2 or Linux directly
  • Honestly, I donīt understand why you should use chtMulti..Foam solver as you donīt have multiple regions, right? Depending on your underlying physics, you have to use rhoPimpleFoam or buoyantPimpleFoam. If the temperature differences are not too large, you can use the Boussinesq approximation as well. However not sure what you want to simulate? What is the driving force that pushes your fluid through the small gap? If both sides are at same pressure, I have no idea what should drive the flow from one side through the other because we actually need some pressure gradient, donīt we? Maybe we have some terms in the energy equation that I am not aware of right now which would introduce some dp here. No idea.
  • Analyzing the heat flux through the gap: either codedFunctionObject or maybe some available function objects.
However, having a left hot and a right cold domain that is connected with a small gap should not be a big deal to simulate in OpenFOAM.

foadsf December 13, 2021 16:57

Thanks a lot for the kind response. I went through your points one by one:

Quote:

Originally Posted by Tobi (Post 818356)
You can combine one block with two others in blockMesh. Therefore, you need to define things in mergeFaces (not sure about the correct keyword so you can check the blockMeshDict in /etc/caseDicts/annonated/...)

I think my point was not well communicated. Studying this reference page, the mergePatchPairs list is used when there are blocks with matching faces that do not share the same vertices. Canonically one should avoid such a situation, by just sharing the vertices between the blocks and then ignoring those matching faces in the boundary condition patches.

What I wanted to do was to, for example using this image as the reference, write (0 1 6 10) instead of two (0 1 7 11) and (7 6 10 11), which doesn't seem to be possible.


Quote:

Originally Posted by Tobi (Post 818356)
If you need a finer mesh inside the "D" hole-area, you need a separated block here. However the refinement will go into the large left and right area. Therefore, I would prefer another way of meshing: create a single block and built some simple geometry. Use snappyHexMesh for meshing the guy.


I am not sure if I understand this point. Maybe you can be kind to elaborate?


Quote:

Originally Posted by Tobi (Post 818356)
The story about baffle is not the one you would need if you have the blockMesh as given in your picture. You simply define both patches as walls - done. We commonly talk about baffles when we switch internal faces into something else, e.g., walls or cyclic patches. Commonly you create a faceZone (a selection of internal faces). This faceZone can be used by the createBaffles utility to duplicate the internal faces (so we have one face owned by the neighbor cell and one face owned by the owner cell; neigbor and owner nomenclature is based on the internal face). Doing so, we get the posibility to specify two different boundary conditions for the two patches (identical to you blockMesh stuff); by the way

so you are telling me that it is OK to define the zero thickness walls surrounding the hole as:


Code:

    isoWalls
    {
        type wall;
        faces
        (
            (16 4 6 18)
            //(18 6 4 16)
            (19 7 1 13)
            //(13 1 7 19)
        );
    }

regardless of which direction the normal is pointing? I don't think that's gonna work. I have tried it above and this is the problem.







Quote:

Originally Posted by Tobi (Post 818356)
As some of your problems are Windows related - no comment to that one; as already suggested WLS2 or Linux directly

Microsoft's WSL is sadly not an option as I don't have admin rights on my work machine. I hope one day we have a PortableApps package for OpenFOAM compiled with MVSC.


Quote:

Originally Posted by Tobi (Post 818356)
Honestly, I donīt understand why you should use chtMulti..Foam solver as you donīt have multiple regions, right? Depending on your underlying physics, you have to use rhoPimpleFoam or buoyantPimpleFoam. If the temperature differences are not too large, you can use the Boussinesq approximation as well.

This much I had also figured out as suggested in the first post. Given that the temreture difference isn't much in my case, I think buoyantPimpleFoam seems the reasonable option. But the computational overhead of rhoPimpleFoam also doesn't seem to be much. So I might try both.


Quote:

Originally Posted by Tobi (Post 818356)
However not sure what you want to simulate? What is the driving force that pushes your fluid through the small gap? If both sides are at same pressure, I have no idea what should drive the flow from one side through the other because we actually need some pressure gradient, donīt we? Maybe we have some terms in the energy equation that I am not aware of right now which would introduce some dp here. No idea.

the driving force causing the convection is buoyancy. Basically as the imaginary experiment starts heat travels trough the hole due to conduction and diffusion. By time some air in the cold area gets hotters and travels upward, and vice versa.

https://i.imgur.com/1jFCcdN.png

Thanks for your support again. I am gonna try the above points and come back to report here.

JNSN December 14, 2021 03:30

Hi,


for generating some local refinement, you can simply generate a cell set with topoSet and refine that with refineMesh. No need to use snappyHexMesh


Best,
Jan


All times are GMT -4. The time now is 00:56.