|
[Sponsors] |
June 14, 2019, 11:30 |
Initial conditions and boundary conditions
|
#1 |
Senior Member
Raza Javed
Join Date: Apr 2019
Location: Germany
Posts: 183
Rep Power: 7 |
Hello Everyone,
I have one question relating to initial conditions and boundary conditions. I am using chtMultiRegionSimpleFoam and my openfoam version is 4.1. I am putting my boundary conditions for pressure, velocity and temperature in system/region_name/changeDictionaryDict. And I also have p, T and U in '0' directory. what are these files? Are they initial conditions? because in openfoam tutorials, some cases don't have this system/region_name/changeDictionaryDict, and they are putting boundary conditions in 0 directory. I am little bit confused here that where to assign boundary conditions and where initial conditions? And is it necessary that the format of entries in changeDictionaryDict be same as entries in 0 directory? for example, if I talk about temperature, The temperature boundary condition entry in my changeDictionaryDict is below: changeDictionaryDict Code:
T { internalField uniform 300; boundaryField { inlet { type fixedValue; value $internalField; } outlet { type zeroGradient; value $internalField; } "fluid_to_box" { type compressible::turbulentTemperatureCoupledBaffleMixed; Tnbr T; kappaMethod fluidThermo; value uniform 300; } } } And in the zero directory, it is as follows: 0/T: Code:
dimensions [0 0 0 1 0 0 0]; internalField uniform 300; boundaryField { ".*" { type calculated; value uniform 300; } frontAndBack { type empty; } } I shall be very thankful if someone can help me in understanding this. Thank you |
|
June 20, 2019, 03:40 |
|
#2 |
Member
Ingo Riess
Join Date: Jun 2019
Location: Switzerland
Posts: 40
Rep Power: 7 |
For an explanation of the content of the "0"-folder (initial conditions), there is a youtube tutorial here:
https://www.youtube.com/watch?v=qfX_bJUjdOk&t=98s Actually, I did not come across the changeDictionaryDict in my endeavours to learn OpenFoam. |
|
June 20, 2019, 04:42 |
|
#3 |
Senior Member
Yann
Join Date: Apr 2012
Location: France
Posts: 1,236
Rep Power: 29 |
This is something specific to the chtMultiRegion tutorials. In several of these tutorials, it starts with a series of default variable files (p, U, T, etc) in the 0 folder and the changeDictionary function is used to edit these files to set the appropriate boundary conditions for each region.
The changeDictionaryDict snippet you have posted basically says that when you execute the changeDictionary command, it will modify the 0/region_name/T file with the values from the changeDictionaryDict. The other (simpler) way to do it is to directly write the values in the 0/region_name/T. For most of the solvers, boundary conditions / initialisation values are in the 0 folder, each variable having its own file. chtMultiRegion is different because well... there are several regions, each one having its own set of boundary conditions. This is why there are 0/region_name folders. I suggest you to read the Allrun scripts to see what is the workflow to run the case in order to understand which operations are performed. |
|
June 20, 2019, 06:01 |
|
#4 | |
Senior Member
Raza Javed
Join Date: Apr 2019
Location: Germany
Posts: 183
Rep Power: 7 |
Quote:
Hi, Thank you so much for your reply. Yes you are right about the functionality of changeDictionaryDict. what actually happens is that, when I RUN the Allclean , then in 0 folder only the files U,T,p,epsilon,k,aphat etc left. No region folders inside because I cleaned everything. for example, I am putting the U file from 0 directory, all others are also same. 0/U: Code:
dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 0); boundaryField { ".*" { type calculated; value uniform (0 0 0); } } This is understandable. Now, the confusion is, where are we putting the initial values for our simulation? |
||
June 20, 2019, 06:20 |
|
#5 |
Member
Ingo Riess
Join Date: Jun 2019
Location: Switzerland
Posts: 40
Rep Power: 7 |
Do you have one folder "region_name" or do you use the region_name as a wildcard for the various regions in your model?
If you look in the tutorials of chtMultiRegionFoam/multiRegionHeater, you'll find multiple files changeDicionaryDict in the various folders per region. Each changeDicionaryDict contains the initial conditions for one region. The Allrun.pre script creates the BC for the "0"-Folder. |
|
June 20, 2019, 06:23 |
|
#6 |
Senior Member
Yann
Join Date: Apr 2012
Location: France
Posts: 1,236
Rep Power: 29 |
The initial values for each variable are located in the 0/region_name folder.
From your previous example of the T file: Code:
internalField uniform 300; This means the internalField, aka the volume mesh, has an initial temperature set to 300K Then, you have the same thing on walls/patches : Code:
outlet { type zeroGradient; value $internalField; } The boundary condition on the outlet patch is a type zeroGradient and the initial value in the same as the one set for the internalField : 300K. Depending on the nature of the boundary condition, the "value" entry can ether be an initial value which will be overwritten at the first time step, or a value which will remain during the simulation, for instance with the fixedValue boundary condition: Code:
inlet { type fixedValue; value $internalField; } Here the inlet patch is set to a fixedValue of 300K and it won't change during simulation. |
|
June 20, 2019, 06:26 |
|
#7 | ||
Senior Member
Raza Javed
Join Date: Apr 2019
Location: Germany
Posts: 183
Rep Power: 7 |
Quote:
I am using region_name as a wildcard for various regions(box, fluid etc.) Quote:
Yes I checked now, and in each region, it has changeDictionaryDict, in that file is it defining boundary conditions OR initial conditions? |
|||
June 20, 2019, 06:45 |
|
#9 |
Senior Member
Raza Javed
Join Date: Apr 2019
Location: Germany
Posts: 183
Rep Power: 7 |
||
June 20, 2019, 06:46 |
|
#10 | |
Senior Member
Raza Javed
Join Date: Apr 2019
Location: Germany
Posts: 183
Rep Power: 7 |
Quote:
Yes. Now, I got it. Thank you so much. |
||
Tags |
boundary conditions, initial conditions, openfoam |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
transsonic nozzle with rhoSimpleFoam | Unseen | OpenFOAM Running, Solving & CFD | 8 | July 1, 2022 07:54 |
mesh file for flow over a circular cylinder | Ardalan | Main CFD Forum | 7 | December 15, 2020 14:06 |
Wrong multiphase flow at rotating interface | Sanyo | CFX | 14 | February 7, 2017 18:19 |
simpleFoam error - "Floating point exception" | mbcx4jc2 | OpenFOAM Running, Solving & CFD | 12 | August 4, 2015 03:20 |
Low Mixing time Problem | Mavier | CFX | 5 | April 29, 2013 01:00 |