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

Combine CHTmultiRegion and InterFoam

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 12, 2022, 10:19
Default
  #21
Senior Member
 
Kumaresh
Join Date: Oct 2016
Posts: 349
Rep Power: 11
Kummi is on a distinguished road
Send a message via Yahoo to Kummi
Hello Bana,
I haven't worked with interFoam solver. In case of multi-region modelling, your case should be straight forward. For 3 solids, you can implement the same default solid model solving heat conduction equation. In fluid region, create your fields, meshes and respective equations. It might be hard in the beginning, but your efforts will pay off.
Good luck
Kummi is offline   Reply With Quote

Old   April 12, 2022, 12:55
Default
  #22
Member
 
Mohammad Reza
Join Date: Sep 2015
Posts: 44
Rep Power: 10
Bana is on a distinguished road
Quote:
Originally Posted by Kummi View Post
Hello Bana,
I haven't worked with interFoam solver. In case of multi-region modelling, your case should be straight forward. For 3 solids, you can implement the same default solid model solving heat conduction equation. In fluid region, create your fields, meshes and respective equations. It might be hard in the beginning, but your efforts will pay off.
Good luck
Thank you Kummi for your comment,

I am not using interFoam too. I am dealing with cavitatingFoam as the fluid solver.

I know that the solid part of the solver can remain untouched, but for the createFluidFields.H file I have a primary problem with converting one of the dictionaries of createFields.H of cavitatingFoam to ptrList. As you said this conversion for a lot of Models and fields were completely straightforward and I did not have any problem by using analogy.

Here is where I am currently stuck:
for baratropicCompressibilityModel in createFields.H file of cavitatingFoam we have:

PHP Code:
 autoPtr<barotropicCompressibilityModelpsiModel =
        
barotropicCompressibilityModel::New
        (
            
thermodynamicProperties,
            
gamma
        
); 
thermodynamicProperties is defined in readThermodynamicProperties.H of cavitatingFoam as an IOdictionary:

PHP Code:
IOdictionary thermodynamicProperties
    
(
        
IOobject
        
(
            
"thermodynamicProperties",
            
runTime.constant(),
            
mesh,
            
IOobject::MUST_READ_IF_MODIFIED,
            
IOobject::NO_WRITE
        
)
    ); 

to incorporate these two in createFluidFields of chtMultiRegionFoam, I need to create something like PtrList<...>thermodynamicPropertiesFluid and then pass it to barotropicCompressibilityModel in forAll loop.

clearly the following line produces error:

PHP Code:
PtrList<IOdictionarythermodynamicPropertiesFluid(fluidRegions.size()); 
PHP Code:
errorno matching function for call to ‘Foam::PtrList<Foam::dictionary>::set(Foam::label&, Foam::IOobject)
        
); 
I searched to find how to pass IOdictionary to ptrList but did not find anything yet.

Then I think I should add following code to the forAll loop of createFluidFields.H too:

PHP Code:
thermodynamicPropertiesFluid.set
       
(
         
i,
         
IOobject
         
(
             
"thermodynamicProperties",
             
runTime.constant(),
             
fluidRegions[i],
             
IOobject::MUST_READ_IF_MODIFIED,
             
IOobject::NO_WRITE
         
)
       );

       
compressibility.set  //added
       
(
         
i,
         new 
barotropicCompressibilityModel
         
(
           
thermodynamicPropertiesFluid[i],
           
gammaFluid[i]
         )
       ); 

I appreciate it if you or anyone who has a similar experience in dealing with this solver can suggest an idea about this coding problem.

**Note: I am using Foam-Extend 4.1.

With thanks and appreciation,
Bana
Bana is offline   Reply With Quote

Old   April 13, 2022, 00:44
Default
  #23
Senior Member
 
Kumaresh
Join Date: Oct 2016
Posts: 349
Rep Power: 11
Kummi is on a distinguished road
Send a message via Yahoo to Kummi
Hi, I have one major thing to comment here.
Quote:
PtrList<basicSolidThermo> thermos(solidRegions.size());
PtrList<basicRhoThermo> thermoFluid(fluidRegions.size());
Here basicSolidThermo and basicRhoThermo are classes.
If you pass IOdictionary, OpenFOAM have no clue to access your solver. The reason why you get the error.
I hope this first step will get rid of your half of a problem atleast.
Thank you
Bana likes this.
Kummi is offline   Reply With Quote

Old   April 13, 2022, 12:23
Default
  #24
Member
 
Mohammad Reza
Join Date: Sep 2015
Posts: 44
Rep Power: 10
Bana is on a distinguished road
Quote:
Originally Posted by Kummi View Post
Hi, I have one major thing to comment here.
Here basicSolidThermo and basicRhoThermo are classes.
If you pass IOdictionary, OpenFOAM have no clue to access your solver. The reason why you get the error.
I hope this first step will get rid of your half of a problem atleast.
Thank you
But IOdictionary is a class too, Isn't it? like BasicPsiThermo and etc.
I do not know how to make a PtrList of IOdictionary ...
Bana is offline   Reply With Quote

Old   April 13, 2022, 14:10
Default
  #25
Senior Member
 
Kumaresh
Join Date: Oct 2016
Posts: 349
Rep Power: 11
Kummi is on a distinguished road
Send a message via Yahoo to Kummi
Hello Bana,
Sorry I didn't mention clearly.
In my case, I have implemented pyrolysis (solid with reaction), so I have used Ptrlist as,
Quote:
PtrList<regionModels:: pyrolysisModels:: pyrolysisModel>tpyrolysis(pyrosolidRegions.size());
// Populate pyrosolid field pointer lists
forAll(pyrosolidRegions, i)
{
Info<< " Adding Pyrolysis model\n" << endl;
tpyrolysis.set (i, regionModels:: pyrolysisModels:: pyrolysisModel:: New(pyrosolidRegions[i]));
}
regionModels:: pyrolysisModels:: pyrolysisModel ==> Pointer ACCESS my source file.
I'm attaching the snap of my header file here. You may get the clear idea. Hope this is useful. And give such a try too.
Thank you
Attached Images
File Type: png Check.PNG (69.7 KB, 9 views)
Kummi is offline   Reply With Quote

Old   April 14, 2022, 07:59
Default
  #26
Member
 
Mohammad Reza
Join Date: Sep 2015
Posts: 44
Rep Power: 10
Bana is on a distinguished road
Quote:
Originally Posted by Kummi View Post
Hello Bana,
Sorry I didn't mention clearly.
In my case, I have implemented pyrolysis (solid with reaction), so I have used Ptrlist as,

regionModels:: pyrolysisModels:: pyrolysisModel ==> Pointer ACCESS my source file.
I'm attaching the snap of my header file here. You may get the clear idea. Hope this is useful. And give such a try too.
Thank you
Tnak you Kummi.

I found the source of error.

I didn't pay attention to the line of error! In fact the declaration of PtrList was ok and I needed to change the following in forAll loop:

PHP Code:
thermodynamicPropertiesFluid.set
      
(
          
i,
          new 
IOdictionary
          
(
              
IOobject
              
(
                  
"thermodynamicProperties",
                  
runTime.constant(),
                  
fluidRegions[i],
                  
IOobject::MUST_READ_IF_MODIFIED,
                  
IOobject::NO_WRITE
              
)
          )
      ); 
Kummi likes this.
Bana is offline   Reply With Quote

Old   June 16, 2022, 06:15
Default coupling icoFoam (plus energy equation) solver with CHT multiregion
  #27
New Member
 
khaoula
Join Date: Nov 2020
Posts: 6
Rep Power: 5
khaoula louali is on a distinguished road
Hello everyone,

I would like to ask about a solver that can couple coFoam (after introducing the energy equation in this solver) and chtMultiRegionFoam, because I want to add a solid part to the studied model. i have some difficulties in compiling , any body have experience about this?? or another way,just add solid region in my base solver??which way is better??

Regards, [/QUOTE]
khaoula louali is offline   Reply With Quote

Old   June 16, 2022, 07:43
Default
  #28
Senior Member
 
Kumaresh
Join Date: Oct 2016
Posts: 349
Rep Power: 11
Kummi is on a distinguished road
Send a message via Yahoo to Kummi
Quote:
Originally Posted by khaoula louali View Post
Hello everyone,

I would like to ask about a solver that can couple coFoam (after introducing the energy equation in this solver) and chtMultiRegionFoam, because I want to add a solid part to the studied model. i have some difficulties in compiling , any body have experience about this?? or another way,just add solid region in my base solver??which way is better??

Regards,
Kindly keep your questions straight and clear.
Thank you
Kummi is offline   Reply With Quote

Old   June 16, 2022, 09:56
Default coupling icoFoam solver with chtMultiRegionFoam
  #29
New Member
 
khaoula
Join Date: Nov 2020
Posts: 6
Rep Power: 5
khaoula louali is on a distinguished road
Hello,
I am studying on regenerator which consists of two regions solid and fluid.So, I'm trying to develop new solver which combines two preexisting solvers (icoFoam and chtMultiRegionFoam) for solving a system of equations : Continuity, momentum and energy equations of fluid and solid. if someone could help me i will be grateful.
Best Regards


khaoula louali is offline   Reply With Quote

Old   June 17, 2022, 00:02
Default
  #30
Senior Member
 
Kumaresh
Join Date: Oct 2016
Posts: 349
Rep Power: 11
Kummi is on a distinguished road
Send a message via Yahoo to Kummi
Hello khaoula,
Let me know how far you struggled to combine two solvers. Have you checked any forum pages related to this and given a try ? If then, kindly update what you have tried and if any error post it here. I believe helping you along from the efforts you made is worth enough. These posts might be helpful to you.
Combine CHTmultiRegion and InterFoam
How to couple two solvers for simulation of two regions?
Feel free to ask !
Thank you
Kummi is offline   Reply With Quote

Old   June 17, 2022, 04:41
Default
  #31
New Member
 
Join Date: Feb 2022
Posts: 25
Rep Power: 4
theBananaTrick is on a distinguished road
Hi,

What boundary condition would you use to couple the phases? compressible::turbulentTemperatureCoupledBaffleMix ed[https://www.openfoam.com/documentati...ield_8H.html]? Or something similar to turbulentTemperatureTwoPhaseRadCoupledMixedFvPatch ScalarField.H [https://www.openfoam.com/documentati...Field_8H.html]


Best Regards
theBananaTrick 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



All times are GMT -4. The time now is 03:30.