|
[Sponsors] |
Combination of interFoam and chtMultiRegionFoam |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
February 18, 2016, 08:49 |
Combination of interFoam and chtMultiRegionFoam
|
#1 |
New Member
Join Date: Jan 2016
Posts: 19
Rep Power: 10 |
Hello together,
I am working on the implementation of a modified version of interFoam as the fluid solver in chtMultiRegionFoam to study two-phase flow with conjugate heat transfer to or from a solid body. First of all, the implementation of the energy equation in interFoam works fine. When I make the necessary changes in the fluid part of chtMultiRegionFoam everything compiles without an error. But when I try to run a testcase, I get the following error message: Code:
lookup of k from objectRegistry fluid successful but it is not a volScalarField, it is a surfaceScalarField Code:
const surfaceScalarField alpha1f ( min(max(fvc::interpolate(alpha1), scalar(0), scalar(1)) ); surfaceScalarField k ("k", alpha1f*k1 + (scalar(1)-alpha1f)*k2); fvScalarMatrix TEqn ( fvm::ddt(rhoCp,T) + fvm::div(rhoPhiCp,T) - fvm::laplacian(k,T) ); TEqn.solve(); Code:
k1Fluid.set ( i, new dimensionedScalar ( "k1", dimensionSet( 1, 1,-3,-1,0,0,0), transportPropertiesFluid[i].subDict("phase1").lookup("k") ) ); I am thankful for any suggestions. Michael |
|
February 18, 2016, 11:33 |
|
#2 |
Senior Member
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 22 |
Which part of the code is looking it up in the registry? It is probably a boundary condition.
I think many parts of OF assume k to be a volScalarField - a bit of hard-coding. In fact, I think 'k' is created by the turbulence models, and if you create it at the application level, things get confused. Try giving it an alternate name.
__________________
~~~ Follow me on twitter @DavidGaden |
|
February 18, 2016, 13:25 |
|
#3 |
New Member
Join Date: Jan 2016
Posts: 19
Rep Power: 10 |
It was indeed a boundary condition that was expecting "k" (defined for the boundary condition in the changeDictionaryDict) to be a volScalarField. After creating the volScalarField "k" via createFluidFields.H and renaming the thermal conductivity in my energy equation to "kf" it works fine.
Thanks for your help, you basically nailed it with your first idea. |
|
May 12, 2016, 11:39 |
|
#5 |
New Member
Join Date: Jan 2016
Posts: 19
Rep Power: 10 |
Hi.
I did manage to couple the two solvers. First I have to say that I cannot share my final solver, since it is heavily modified to incorporate several effects and it is not published that way. But I can share basic knowledge for the coupling. In principle I changed the complete fluid part of the chtMultiRegionFoam solver. As consequence, a new boundary condition type needs to be implemented too. Since the motivation for my solver is based on the investigation of one fluid and one solid region, I reduced the multiregion-coupling to two regions which leads to an easier implementation of the coupled boundary conditions. Hence, the chtMultiRegionFoam solver only served me as a basis, since this is my first project with OpenFOAM. As part of the process, I created several sub-models for which I can provide parts of the source code. So what exactly are you looking for? An acutal MULTIregion solver with interFoam as the fluid solver or a cht-solver for one solid and one fluid region with a two-phase flow? For the latter I can also provide a coupled Dirichlet-Neumann boundary condition with the respective implementation of an additional iteration loop for the convergence of the two energy equations. Regards, Michael PS: I am very busy at the moment but I will try to provide further information as soon as possible. |
|
May 12, 2016, 13:43 |
|
#6 |
New Member
Yaoyina
Join Date: Sep 2014
Posts: 7
Rep Power: 11 |
Hi,
Thank you so much for your reply! At first, I am looking for a cht-solver for one solid and one fluid region with a two-phase flow. I want to simulate the heat transfer process in both fluid and solid regions during the droplet impact process. Second, as the cht-solver if for compressible flows and interFoam is incompressible flows, how should I replace the fluid part of chat-solver with the interFoam solver? Third, can you share the part source codes of coupled Dirichlet-Neumann boundary condition and several sub-models you mentioned above ? Last, Thank you so much, anyway! |
|
May 28, 2020, 21:23 |
|
#7 |
Member
Sam
Join Date: May 2019
Posts: 64
Rep Power: 6 |
Hello,
I know this is a very old post. Is it possible to elaborate on how you achieved this as I am trying to achieve something very similar? Including the coupling BC. Thanks, Sam |
|
August 16, 2020, 22:08 |
|
#8 | |
New Member
wanghongjie
Join Date: Apr 2020
Posts: 28
Rep Power: 6 |
Quote:
|
||
August 16, 2020, 22:11 |
|
#9 | |
New Member
wanghongjie
Join Date: Apr 2020
Posts: 28
Rep Power: 6 |
Quote:
|
||
April 12, 2022, 06:30 |
|
#10 |
Member
Mohammad Reza
Join Date: Sep 2015
Posts: 44
Rep Power: 10 |
Hello All,
Since I was interested in modeling one two-phase fluid region and a multi-solid region with three different solids, I was wondering if it is possible to reduce the whole fluid part of chtMuliregionFoam to only one fluid region and get id of the ptrLists and looping around the fluid regions? Thanks |
|
April 13, 2022, 12:40 |
|
#11 | |
Member
Mohammad Reza
Join Date: Sep 2015
Posts: 44
Rep Power: 10 |
Quote:
By having a look at your piece of code I noticed that you have used a pointer list of IOdictionary in your createFluidFields.H file which is transportPropertiesFluid. I am trying to do the same but it does not let me pass IOdictionary class in to a PtrList like this: PHP Code:
PHP Code:
Regards, Bana |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Combine CHTmultiRegion and InterFoam | Nazanin | OpenFOAM Programming & Development | 30 | June 17, 2022 04:41 |