|
[Sponsors] |
Configuration of boundary conditions and fvOptions file |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 26, 2019, 06:13 |
Configuration of boundary conditions and fvOptions file
|
#1 |
Senior Member
Raza Javed
Join Date: Apr 2019
Location: Germany
Posts: 183
Rep Power: 7 |
Hello everyone,
I am implementing the chtMultiRegionSimpleFoam. My geometry consists of three solid regions (Hot, Cold and Pipe). Hot box and Cold box are connected using pipe between them. I am making one box hot by generating the heat source using fvOptions file. My fvOptions file is given below: Code:
heatSource { type scalarSemiImplicitSource; active true; scalarSemiImplicitSourceCoeffs { selectionMode all; // all, cellSet, cellZone, points // cellZone heatSrc; //cellSet hotFace; volumeMode absolute; // specific; injectionRateSuSp { h (1000 0); } } } According to my understanding the power that I am putting in the fvOptions file (h (1000 0)) is related to the temperature change by the formula below: Q = k*A*(delta T)/L where A is the area of the pipe, k is thermal conductivity and L is the length of the pipe, and delta-T is the temperature gradient. when I put the power as Q in the above relation, it doesn't give me the same temperature gradient as I got in simulation. I don't know where is the mistake OR what I am doing wrong? I have checked various threads on this forum about using fvOptions, and most of them are saying that you can put directly your power in fvOptions like I did above. After checking all the possibilities I deduced that there might be a problem with my boundary conditions. I am giving my changeDictionaryDict file of all the three regions below: Cold box Code:
T { internalField uniform 300; defaultFaces { type patch; } boundaryField { "defaultFaces" { type zeroGradient; } "Cold_to_.*" { type compressible::turbulentTemperatureCoupledBaffleMixed; Tnbr T; kappaMethod solidThermo; kappaName none; value uniform 300; } } } Pipe Code:
T { internalField uniform 300; defaultFaces { type patch; } boundaryField { "defaultFaces" { type zeroGradient; } "pipe_to_.*" { type compressible::turbulentTemperatureCoupledBaffleMixed; Tnbr T; kappaMethod solidThermo; kappaName none; value uniform 300; } } } Code:
T { internalField uniform 300; defaultFaces { type patch; } boundaryField { "defaultFaces" { type zeroGradient; } "Hot_to_.*" { type compressible::turbulentTemperatureCoupledBaffleMixed; Tnbr T; kappaMethod solidThermo; kappaName none; value uniform 300; } } } Do I have any problem with the boundary conditions? OR fvOptions file? I would be really thankful if someone can figure out where is the mistake. I would be glad to give any further information if required. Thank you |
|
April 26, 2019, 10:45 |
|
#2 |
Senior Member
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,760
Rep Power: 66 |
h(1000 0) with volumeMode absolute means there is a h (energy) source of 1000 W in every cell. That means you have to add up 1000 W times the number of cells affected. You also used selectionMode all which means every single cell in your domain has this heat source (including the cold box).
How do you calculate Q from h (1000 0)? You are specifying Power per cell, not total power. And are you sure you want to apply the source to all cells? |
|
April 26, 2019, 11:05 |
|
#3 |
Senior Member
Raza Javed
Join Date: Apr 2019
Location: Germany
Posts: 183
Rep Power: 7 |
Thank you so much for your reply.
I am sorry I am new to openfoam... I want to make only my hot box a heat source (Does it mean that all the cells of hot box will have a separate heat source?). and I have a power of 1000W but I exactly don't know that how to introduce that power into fvOptions file (or how to configure fvOption) file for it, so that I can be sure that my temperature gradient in the pipe is relating to the power I have given... I didn't calculate the power from Q, I just want to create a heat source that takes this power (1000W) as input and gives temperature as output, and that temperature will be transferred to cold box through pipe. But exactly don't know how to achieve it. |
|
April 26, 2019, 11:12 |
|
#4 |
Senior Member
Raza Javed
Join Date: Apr 2019
Location: Germany
Posts: 183
Rep Power: 7 |
Here is the result of the simulation, when I run my case.
|
|
April 26, 2019, 11:29 |
|
#5 |
Senior Member
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,760
Rep Power: 66 |
You want a total power of 1000 W, but right now you are specifying 1000 W per cell.
You are using selectionMode all; Use selectionMode cellSet; or selectionMode cellZone; and then specify the proper cellSet or cellZone representing the hot region. volumeMode absolute; specifies the raw heat source in W. volumeMode specific; specifies the volumetric source in W/m^3. Probably volumeMode specific is closer to what you want. You need to know the total volume of the hot region to figure out what number to specify. |
|
April 26, 2019, 11:40 |
|
#6 | |
Senior Member
Raza Javed
Join Date: Apr 2019
Location: Germany
Posts: 183
Rep Power: 7 |
I have edited my fvoptions file like this:
Code:
heatSource { type scalarSemiImplicitSource; active true; scalarSemiImplicitSourceCoeffs { selectionMode cellZone; // all, cellSet, cellZone, points cellZone Hot; //cellSet c1; volumeMode specific; // specific; injectionRateSuSp { h (1000 0); } } } Code:
Adding fvOptions Creating finite volume options from "constant/fvOptions" Selecting finite volume options model type scalarSemiImplicitSource Source: heatSource - selecting cells using cellZone Hot - selected 4478 cell(s) with volume 900000 Code:
0: Hot is cellZone 1: Cold is cellZone 2: pipe is cellZone Constructing mesh with non-default patches of size: --> FOAM Warning : From function Foam::polyMesh::polyMesh(const Foam::IOobject&, const Foam::Xfer<Foam::Field<Foam::Vector<double> > >&, const cellShapeList&, const faceListList&, const wordList&, const wordList&, const Foam::word&, const Foam::word&, const wordList&, bool) in file meshes/polyMesh/polyMeshFromShapeMesh.C at line 595 Found 7280 undefined faces in mesh; adding to default patch. Adding cell and face zones Cell Zone Hot 4478 Cell Zone Cold 4287 Cell Zone pipe 5524 End Quote:
Code:
Solving for solid region Cold DICPCG: Solving for h, Initial residual = 0.002070642, Final residual = 2.278098e-05, No Iterations 2 Min/max T:300.008 303.1053 ExecutionTime = 13.88 s ClockTime = 14 s End Now I just want to verify this temperature change by hand calculation. |
||
April 26, 2019, 11:54 |
|
#7 |
Senior Member
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,760
Rep Power: 66 |
You've specified 1000 W/m^3 over a volume of 900 000 m^3. That's not a Q of 1000W but 900 MW!
Also, does 900000 m^3 sound like the right volume for your hot box? Maybe you forgot to scale the mesh at some point? |
|
April 26, 2019, 12:16 |
|
#8 | ||
Senior Member
Raza Javed
Join Date: Apr 2019
Location: Germany
Posts: 183
Rep Power: 7 |
Thank you so much.
Quote:
And if I put the value of "h" as (0.001 0) then the simulation looks like in the attached image. Quote:
My volume is so high because my hot box dimensions are 300m*300m*10m. |
|||
May 2, 2019, 12:32 |
|
#9 |
Senior Member
Raza Javed
Join Date: Apr 2019
Location: Germany
Posts: 183
Rep Power: 7 |
Hello LuckyTran,
My version of OpenFoam is 4.1. I have one question. I have searched alot on this forum and almost everywhere else. No one even encountered this error. Probably, I am doing a very stupid mistake. I am using topoSetDict to make a faceSet from a patch, and then I want to make cellSet using that faceSet. My topoSetDict file is given below: Code:
actions ( { name hot1; type faceSet; action new; source patchToFace; sourceInfo { name "hotFace"; } } // Select based on faceSet { name hotcell; type cellSet; action new; source faceToCell; sourceInfo { set hot1; // Name of faceSet //option neighbour; // cell with neighbour in faceSet //option owner; // ,, owner option any; // cell with any face in faceSet //option all; // cell with all faces in faceSet } } Code:
Create time Create polyMesh for time = 0 Reading topoSetDict Time = 0 mesh not changed. Created faceSet hot1 Applying source patchToFace Adding all faces of patch hotFace ... Found matching patch hotFace with 253 faces. faceSet hot1 now size 253 Created cellSet hotcell Applying source faceToCell Adding cells according to faceSet hot1 ... cellSet hotcell now size 253 End Code:
--> FOAM FATAL ERROR: Illegal content 8200 of set:hotcell of type cellSet Value should be between 0 and 6396 From function void Foam::topoSet::check(Foam::label) in file sets/topoSets/topoSet.C at line 189. FOAM aborting #0 Foam::error::printStack(Foam::Ostream&) at ??:? #1 Foam::error::abort() at ??:? #2 Foam::topoSet::check(int) at ??:? #3 Foam::cellSet::cellSet(Foam::polyMesh const&, Foam::word const&, Foam::IOobject::readOption, Foam::IOobject::writeOption) at ??:? #4 Foam::fv::cellSetOption::setCellSet() at ??:? #5 Foam::fv::cellSetOption::cellSetOption(Foam::word const&, Foam::word const&, Foam::dictionary const&, Foam::fvMesh const&) at ??:? #6 Foam::fv::option::adddictionaryConstructorToTable<Foam::fv::SemiImplicitSource<double> >::New(Foam::word const&, Foam::word const&, Foam::dictionary const&, Foam::fvMesh const&) at ??:? #7 Foam::fv::option::New(Foam::word const&, Foam::dictionary const&, Foam::fvMesh const&) at ??:? #8 Foam::fv::optionList::reset(Foam::dictionary const&) at ??:? #9 Foam::fv::optionList::optionList(Foam::fvMesh const&, Foam::dictionary const&) at ??:? #10 Foam::fv::options::options(Foam::fvMesh const&) at ??:? #11 ? at ??:? #12 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6" #13 ? at ??:? Aborted (core dumped) Thank you |
|
May 3, 2019, 11:47 |
|
#10 |
Senior Member
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,760
Rep Power: 66 |
If you're only applying the heat source to the cells that are adjacent to a patch anyway... why not just use a heat flux boundary condition instead of trying to jack the volumetric heat source?
Maybe post what you did to get to the error. Some context would help.... I see that the error is complaining you're trying to assign cell number 8200 to the set hotcell and it can't because there are only 6396 cells and cell 8200 doesn't exist. I have no idea under what circumstances this can happen without some clues. |
|
May 3, 2019, 11:57 |
|
#11 |
Member
Priyanka P
Join Date: Apr 2019
Location: Germany
Posts: 40
Rep Power: 7 |
Hi..
Thank you so much for your reply. Actually I am making heat source using fvOptions, and I am putting power in fvOptions to generate heat source. Now I want to have a heat source on one face. For that I created a faceSet. as you can see below in the figure (red face) Then I made cellSet from that faceSet. But that is something different. it is the red face with some triangular cells with it. you can see in the figure also. My problem is that I just want one face of a solid to be a heat source using fvOptions, and fvOptions should take power as a parameter. Last edited by priyankap; May 3, 2019 at 12:13. Reason: I am Raza Javed's colleague, we are working on the same project, so I am replying instead of him, as he is currently not here |
|
May 3, 2019, 12:10 |
|
#12 |
Member
Priyanka P
Join Date: Apr 2019
Location: Germany
Posts: 40
Rep Power: 7 |
Hi,
I am attaching dropbox link to my case also, If you can find time to have a look, I would be highly thankful. Thank you so much. https://www.dropbox.com/sh/3fy3k575f...MLiNQ-WOa?dl=0 |
|
May 3, 2019, 12:24 |
|
#13 | |
Senior Member
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,760
Rep Power: 66 |
Quote:
Yes I understand that, hence my complaint. A heat source on a face is just a heat flux. The heat flux BC is wayyy easier to do. Why not just do that? You need to stop trying to make up your own language because that makes it really hard for anyone trying to help you because they don't know your language. Cells are not faces and faces are not cells! Let me tell you what you are doing... You marked the faces on your patch. You then marked the cells that are adjacent to this patch. You created a cellSet of the cells adjacent to the patch. These are cells, with volumes, not faces. You are now generating a heat source in this cellSet... which is not the same adding heat through faces. You can never apply a volumetric heat flux through a face. I'm not going to open your files. If you can't find the time to explain what you did, I am unwilling to spend the time to look at them. More importantly, I have no freakin clue what commands you type into the terminal to encounter the errors. |
||
May 3, 2019, 12:29 |
|
#14 |
Member
Priyanka P
Join Date: Apr 2019
Location: Germany
Posts: 40
Rep Power: 7 |
Thank you for your reply.
I am sorry I am asking you this. but I don't have so much experience in Openfoam. Can you please guide me a little about how can I use heatflux BC on one face? Can I use the power of 65 W to give heat flux boundary condition on one face? Thank you |
|
May 3, 2019, 13:16 |
|
#15 |
Member
Priyanka P
Join Date: Apr 2019
Location: Germany
Posts: 40
Rep Power: 7 |
I am sorry to annoy you with wrong language here. I am new to OpenFoam and hence not very familiar with the names.
Also, I realized that it was a wrong way to make a cellSet from the faceSet. I sent you my files because I felt I was unable to explain my problem correctly. I will try to explain you as good as I can. 1. I created a geomerty with 3 regions: i) hot , ii) cold and iii) pipe in salome. 2. In region "hot" , I defined a face called hotFace. 3. Now I import this geometry as unv file in openfoam. and ran Code:
ideasUnvToFoam heatTransfer_new.unv Code:
topoSet Code:
actions ( { name hot1; type faceSet; action new; source patchToFace; sourceInfo { name "hotFace"; } } //cellSet { name hotcell; type cellSet; action new; source faceToCell; sourceInfo { set hot1; option any; } } Code:
splitMeshRegions -cellZones -overwrite | tee log.splitMeshRegions 8. Based on the boundary file inside constant/region_name/polyMesh folder, I changed the changeDictionaryDict file. 9. I added fvOptions file in region "hot" which is given below: Code:
heatSource { type scalarSemiImplicitSource; active true; scalarSemiImplicitSourceCoeffs { selectionMode cellSet; // all, cellSet, cellZone, points //cellZone hot; cellSet hotcell; volumeMode specific; // absolute; injectionRateSuSp { h (2600 0); } } } Code:
#!/bin/sh cd ${0%/*} || exit 1 # run from this directory # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions #runApplication blockMesh ideasUnvToFoam heatTransfer_new.unv | tee log.ideasUnvToFoam runApplication topoSet | tee log.topoSet splitMeshRegions -cellZones -overwrite | tee log.splitMeshRegions mv /home/openfoam/run/heatTransfer_new/constant/polyMesh/sets /home/openfoam/run/heatTransfer_new/constant/hot/polyMesh # remove fluid fields from solid regions (important for post-processing) for i in cold hot pipe do rm -f 0*/$i/{mut,alphat,epsilon,k,U,p_rgh} done for i in cold hot pipe do changeDictionary -region $i > log.changeDictionary.$i 2>&1 done #-- Run on single processor #runApplication `getApplication` chtMultiRegionSimpleFoam | tee log.chtMultiRegionSimpleFoam ## Decompose #runApplication decomposePar -allRegions # ## Run #runParallel `getApplication` 4 # ## Reconstruct #runApplication reconstructPar -allRegions echo echo "creating files for paraview post-processing" echo paraFoam -touchAll # ----------------------------------------------------------------- end-of-file I tried my best to explain my problem here. Please let me know if you can't understand something. Thanks a lot for taking out time for this. |
|
May 3, 2019, 16:37 |
|
#16 |
Senior Member
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,760
Rep Power: 66 |
Ok but at which point do you get the error.... You actually gave me an all run script and are asking me to find it?
|
|
May 3, 2019, 17:35 |
|
#17 |
Member
Priyanka P
Join Date: Apr 2019
Location: Germany
Posts: 40
Rep Power: 7 |
Thank you for your reply.
I am getting this error when fvOption tries to select finite volume options. But if I am unable to explain it, I am attaching the error log below: Code:
Adding fvOptions Creating finite volume options from "system/fvOptions" Selecting finite volume options model type scalarSemiImplicitSource Source: heatSource - selecting cells using cellSet hotcell --> FOAM FATAL ERROR: Illegal content 8200 of set:hotcell of type cellSet Value should be between 0 and 6396 From function void Foam::topoSet::check(Foam::label) in file sets/topoSets/topoSet.C at line 189. FOAM aborting Thank you |
|
Tags |
boundary conditions, fvoption, openfoam, power, temperature |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Issues on the simulation of high-speed compressible flow within turbomachinery | dowlee | OpenFOAM Running, Solving & CFD | 11 | August 6, 2021 07:40 |
Appropriate boundary conditions using buoyantBoussenesqPimpleFoam | sturgeon | OpenFOAM Running, Solving & CFD | 5 | August 7, 2020 05:06 |
Interface boundary conditions in chtMultiRegionFoam | bibin.sme | OpenFOAM Running, Solving & CFD | 8 | April 27, 2020 11:12 |
Divergence while using cyclic boundary conditions in twoPhaseEulerFoam | shanvach | OpenFOAM Running, Solving & CFD | 0 | April 25, 2019 14:01 |
[mesh manipulation] patch splitting for different boundary conditions | vaina74 | OpenFOAM Meshing & Mesh Conversion | 12 | April 3, 2019 15:45 |