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

Combination of interFoam and chtMultiRegionFoam

Register Blogs Community New Posts Updated Threads Search

Like Tree5Likes
  • 1 Post By mheinz
  • 1 Post By marupio
  • 3 Post By mheinz

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 18, 2016, 08:49
Default Combination of interFoam and chtMultiRegionFoam
  #1
New Member
 
Join Date: Jan 2016
Posts: 19
Rep Power: 10
mheinz is on a distinguished road
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
The strange thing is that I am fully aware of the fact that my thermal conductivity is defined as a surfaceScalarField and it worked beautifully this way. Below you find the definition of my energy equation:

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();
The definition of k1 and k2 looks like the following:

Code:
k1Fluid.set
(
    i,
    new dimensionedScalar
    (
        "k1",
        dimensionSet( 1, 1,-3,-1,0,0,0),
        transportPropertiesFluid[i].subDict("phase1").lookup("k")
    )
);
The error occurs when the fvScalarMatrix is constructed.

I am thankful for any suggestions.

Michael
Kummi likes this.
mheinz is offline   Reply With Quote

Old   February 18, 2016, 11:33
Default
  #2
Senior Member
 
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 22
marupio is on a distinguished road
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.
mheinz likes this.
__________________
~~~
Follow me on twitter @DavidGaden
marupio is offline   Reply With Quote

Old   February 18, 2016, 13:25
Default
  #3
New Member
 
Join Date: Jan 2016
Posts: 19
Rep Power: 10
mheinz is on a distinguished road
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.
mheinz is offline   Reply With Quote

Old   May 11, 2016, 12:33
Default
  #4
New Member
 
Yaoyina
Join Date: Sep 2014
Posts: 7
Rep Power: 11
yaoyina is on a distinguished road
Dear mheinz,
Did you successfully combine the interFoam and chtMultiRegionFoam? Can you share with us if possible ?
Thank you so much in advance!
yaoyina is offline   Reply With Quote

Old   May 12, 2016, 11:39
Default
  #5
New Member
 
Join Date: Jan 2016
Posts: 19
Rep Power: 10
mheinz is on a distinguished road
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.
Kummi, Nostradamus and Mehdi04 like this.
mheinz is offline   Reply With Quote

Old   May 12, 2016, 13:43
Default
  #6
New Member
 
Yaoyina
Join Date: Sep 2014
Posts: 7
Rep Power: 11
yaoyina is on a distinguished road
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!
yaoyina is offline   Reply With Quote

Old   May 28, 2020, 21:23
Default
  #7
Member
 
Sam
Join Date: May 2019
Posts: 64
Rep Power: 6
saj216 is on a distinguished road
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
saj216 is offline   Reply With Quote

Old   August 16, 2020, 22:08
Default
  #8
New Member
 
wanghongjie
Join Date: Apr 2020
Posts: 28
Rep Power: 6
wanghongjie is on a distinguished road
Quote:
Originally Posted by yaoyina View Post
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!
Do you have a solution? I am also looking for a cht-solver for one solid and one fluid region with a two-phase flow. If possible, could you share the experience?Thanks!
wanghongjie is offline   Reply With Quote

Old   August 16, 2020, 22:11
Default
  #9
New Member
 
wanghongjie
Join Date: Apr 2020
Posts: 28
Rep Power: 6
wanghongjie is on a distinguished road
Quote:
Originally Posted by mheinz View Post
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.
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 Con/Eva process. Could you share your expericence?
wanghongjie is offline   Reply With Quote

Old   April 12, 2022, 06:30
Default
  #10
Member
 
Mohammad Reza
Join Date: Sep 2015
Posts: 44
Rep Power: 10
Bana is on a distinguished road
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
Bana is offline   Reply With Quote

Old   April 13, 2022, 12:40
Default
  #11
Member
 
Mohammad Reza
Join Date: Sep 2015
Posts: 44
Rep Power: 10
Bana is on a distinguished road
Quote:
Originally Posted by mheinz View Post
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
The strange thing is that I am fully aware of the fact that my thermal conductivity is defined as a surfaceScalarField and it worked beautifully this way. Below you find the definition of my energy equation:

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();
The definition of k1 and k2 looks like the following:

Code:
k1Fluid.set
(
    i,
    new dimensionedScalar
    (
        "k1",
        dimensionSet( 1, 1,-3,-1,0,0,0),
        transportPropertiesFluid[i].subDict("phase1").lookup("k")
    )
);
The error occurs when the fvScalarMatrix is constructed.

I am thankful for any suggestions.

Michael
Hello Heinz,

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:
  PtrList<IOdictioanrythermodynamicPropertiesFluid(fluidRegions.size()); 
and produces the following error:

PHP Code:
 error‘IOdictioanry’ was not declared in this scope 
I also have added IOdictionary.H in to the main solver and I am using foram-extend 4.1. Can you perhaps help me with this problem?

Regards,
Bana
Bana is offline   Reply With Quote

Reply


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
Combine CHTmultiRegion and InterFoam Nazanin OpenFOAM Programming & Development 30 June 17, 2022 04:41


All times are GMT -4. The time now is 12:10.