CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM

Using OpenFOAM to run a 2D convection-diffusion simulation of a compressible steady-s

Register Blogs Community New Posts Updated Threads Search

Like Tree7Likes
  • 1 Post By s1291
  • 1 Post By s1291
  • 1 Post By s1291
  • 1 Post By s1291
  • 1 Post By foadsf
  • 2 Post By Tobi

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 26, 2021, 09:57
Default Using OpenFOAM to run a 2D convection-diffusion simulation of a compressible steady-s
  #1
Member
 
Foad
Join Date: Aug 2017
Posts: 58
Rep Power: 9
foadsf is on a distinguished road
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:



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.
foadsf is offline   Reply With Quote

Old   October 26, 2021, 12:59
Default
  #2
Member
 
s1291's Avatar
 
Join Date: Aug 2017
Location: Algeria
Posts: 98
Rep Power: 9
s1291 is on a distinguished road
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
parthigcar likes this.
s1291 is offline   Reply With Quote

Old   December 6, 2021, 06:19
Default Implementing the geometry in blockMeshDict
  #3
Member
 
Foad
Join Date: Aug 2017
Posts: 58
Rep Power: 9
foadsf is on a distinguished road
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



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.
Attached Files
File Type: zip blockMeshDict.zip (1,021 Bytes, 1 views)

Last edited by foadsf; December 7, 2021 at 06:59.
foadsf is offline   Reply With Quote

Old   December 7, 2021, 05:21
Default fixed some syntax error but it still doesn't generate the mesh
  #4
Member
 
Foad
Join Date: Aug 2017
Posts: 58
Rep Power: 9
foadsf is on a distinguished road
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.
Attached Files
File Type: zip blockMeshDict.zip (1,019 Bytes, 3 views)

Last edited by foadsf; December 7, 2021 at 06:59.
foadsf is offline   Reply With Quote

Old   December 7, 2021, 08:05
Default
  #5
Member
 
Ashutosh
Join Date: Jul 2021
Location: India
Posts: 76
Rep Power: 5
night-hawk is on a distinguished road
Quote:
Originally Posted by foadsf View Post
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
night-hawk is offline   Reply With Quote

Old   December 7, 2021, 08:23
Default
  #6
Member
 
Foad
Join Date: Aug 2017
Posts: 58
Rep Power: 9
foadsf is on a distinguished road
Quote:
Originally Posted by night-hawk View Post
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.
foadsf is offline   Reply With Quote

Old   December 7, 2021, 08:43
Default
  #7
Member
 
s1291's Avatar
 
Join Date: Aug 2017
Location: Algeria
Posts: 98
Rep Power: 9
s1291 is on a distinguished road
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 likes this.
__________________
"When in doubt, use brute force." -- Ken Thompson
s1291 is offline   Reply With Quote

Old   December 7, 2021, 09:07
Default
  #8
Member
 
Foad
Join Date: Aug 2017
Posts: 58
Rep Power: 9
foadsf is on a distinguished road
Quote:
Originally Posted by s1291 View Post
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 View Post
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.
Attached Files
File Type: zip blockMeshDict.zip (1.1 KB, 2 views)
foadsf is offline   Reply With Quote

Old   December 7, 2021, 09:43
Default
  #9
Member
 
s1291's Avatar
 
Join Date: Aug 2017
Location: Algeria
Posts: 98
Rep Power: 9
s1291 is on a distinguished road
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 likes this.
__________________
"When in doubt, use brute force." -- Ken Thompson
s1291 is offline   Reply With Quote

Old   December 7, 2021, 10:17
Default
  #10
Member
 
Foad
Join Date: Aug 2017
Posts: 58
Rep Power: 9
foadsf is on a distinguished road
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)
foadsf is offline   Reply With Quote

Old   December 7, 2021, 10:58
Default
  #11
Member
 
s1291's Avatar
 
Join Date: Aug 2017
Location: Algeria
Posts: 98
Rep Power: 9
s1291 is on a distinguished road
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.
foadsf likes this.
__________________
"When in doubt, use brute force." -- Ken Thompson

Last edited by s1291; December 7, 2021 at 12:58.
s1291 is offline   Reply With Quote

Old   December 7, 2021, 11:16
Default
  #12
Member
 
s1291's Avatar
 
Join Date: Aug 2017
Location: Algeria
Posts: 98
Rep Power: 9
s1291 is on a distinguished road
I hope the following will solve your installation issues with pacman on MSYS2:

Code:
pacman -S msys2-keyring
Source:

this thread on github
.
__________________
"When in doubt, use brute force." -- Ken Thompson
s1291 is offline   Reply With Quote

Old   December 8, 2021, 10:36
Default some updates
  #13
Member
 
Foad
Join Date: Aug 2017
Posts: 58
Rep Power: 9
foadsf is on a distinguished road
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
s1291 likes this.
foadsf is offline   Reply With Quote

Old   December 10, 2021, 05:12
Default some questions answered on OpenFOAM Discord
  #14
Member
 
Foad
Join Date: Aug 2017
Posts: 58
Rep Power: 9
foadsf is on a distinguished road
Some of the original questions have been answered here on OpenFOAM Discord.
foadsf is offline   Reply With Quote

Old   December 12, 2021, 09:08
Default
  #15
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
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.
clapointe and foadsf like this.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   December 13, 2021, 17:57
Default
  #16
Member
 
Foad
Join Date: Aug 2017
Posts: 58
Rep Power: 9
foadsf is on a distinguished road
Thanks a lot for the kind response. I went through your points one by one:

Quote:
Originally Posted by Tobi View Post
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 View Post
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 View Post
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 View Post
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 View Post
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 View Post
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.



Thanks for your support again. I am gonna try the above points and come back to report here.
foadsf is offline   Reply With Quote

Old   December 14, 2021, 04:30
Default
  #17
Senior Member
 
JNSN's Avatar
 
Jan
Join Date: Jul 2009
Location: Hamburg
Posts: 143
Rep Power: 20
JNSN is on a distinguished road
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
JNSN is offline   Reply With Quote

Reply

Tags
compressible, convection, openfoam, steady-state


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Frequently Asked Questions about Installing OpenFOAM wyldckat OpenFOAM Installation 3 November 14, 2023 12:58
4th Two-Day Meeting on Simulation of IC Engines Using the OpenFOAM technology lucchini OpenFOAM Announcements from Other Sources 0 October 16, 2019 08:50
Can not run OpenFOAM in parallel in clusters, help! ripperjack OpenFOAM Running, Solving & CFD 5 May 6, 2014 16:25
How do i run Compressible Simulation? Jerker CFX 6 November 26, 2007 17:28
transient simulation: natural convection problem? Basics CFX 3 September 25, 2002 10:42


All times are GMT -4. The time now is 23:54.