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:
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:
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. |
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 |
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:
and in general, are there any other points that I have missed? Thanks for your support in advance. |
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:
/*---------------------------------------------------------------------------*\ |
Quote:
|
Quote:
|
Quote:
Quote:
|
1 Attachment(s)
Quote:
Code:
--> FOAM FATAL ERROR: Quote:
Code:
--> FOAM FATAL ERROR: |
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 |
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 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) |
Try sed:
Code:
sed -i.bak 's/\r$//' blockMeshDict 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' {} \; Code:
/opt/openfoam8/tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/system/topoSetDict: type faceZoneSet; |
I hope the following will solve your installation issues with pacman on MSYS2:
Code:
pacman -S msys2-keyring this thread on github. |
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 |
some questions answered on OpenFOAM Discord
Some of the original questions have been answered here on OpenFOAM Discord.
|
As I was pinged in Twitter here are the following comments:
|
Thanks a lot for the kind response. I went through your points one by one:
Quote:
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:
I am not sure if I understand this point. Maybe you can be kind to elaborate? Quote:
Code:
isoWalls Quote:
Quote:
Quote:
https://i.imgur.com/1jFCcdN.png Thanks for your support again. I am gonna try the above points and come back to report here. |
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. |