CFD Online Logo CFD Online URL
Home > Forums > General Forums > Main CFD Forum

Attempt to develop LTSchtMultiRegionFoam

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Search this Thread Display Modes
Old   March 10, 2021, 12:37
Default Attempt to develop LTSchtMultiRegionFoam
New Member
Wilson Filho
Join Date: Dec 2020
Location: Minas Gerais, Brasil
Posts: 7
Rep Power: 5
wilsonrcf is on a distinguished road
Hello guys.

I current working a conjugated heat transfer case. I want to make a steady-state analysis. The problem is that the solution is taking too long to converge. My residuals do converge, but the max/min temperature don't converge even with 10000 iterations!!!

My case is based in a Fluent simulation done by a Brazilian teacher. He uses pseudo-transient (Local time step) to speed-up his analysis.

In OpenFOAM we have the option of using LTS by changing the ddtSchemes to localEuler in fvSchemes. The problem is that the solver must be able to do a LTS descritezation. This is the case for pimpleFoam and reactingFoam , but not for chtMultiRegionFoam.

So, I tried to add the LTS option into chtMultiRegionFoam, by looking at the files of pimpleFoam and reactingFoam. The changes I've done:

1- I copied chtMultiRegionFoam directory, changed all chtMultiRegionFoam entries to LTSchtMultiRegionFoam and $(FOAM_APPBIN) to $(FOAM_USER_APPBIN).

2- I made the following changes to the code of LTSchtMultiRegionFoam.C:
//Before the main loop I add
#include "localEulerDdtScheme.H"
#include "fvcSmooth.H"

//Inside the main loop I put these includes inside an if statement:
if (!LTS)
#include "compressibleMultiRegionCourantNo.H"
#include "solidRegionDiffusionNo.H"
#include "setInitialMultiRegionDeltaT.H"

//Inside while(, I put some includes inside the else statement end add #include "setRDeltaT.H" to the if statement.
if (LTS)
#include "setRDeltaT.H"
#include "compressibleMultiRegionCourantNo.H"
#include "solidRegionDiffusionNo.H"
#include "setMultiRegionDeltaT.H"

3 - Also I copied setRDeltaT.H from pimpleFoam files. And then I changed pimple to pimples (Look at LTSchtMultiRegion pimpleMultiRegionControl pimples(fluidRegions, solidRegions); ) in const dictionary& pimpleDict = pimple.dict();. Because I don't have pimple inside LTSchtMultiRegionFoam, but instead pimples.

4-In createFields.H I added to the first line:
#include "createRDeltaT.H"

But I have two errors, when I executed wmake. This my log.wmake:

Making dependency list for source file LTSchtMultiRegionFoam.C
Making dependency list for source file solidRegionDiffNo.C
Making dependency list for source file compressibleCourantNo.C
g++ -std=c++11 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3 -DNoRepository -ftemplate-depth-100 -I. -I./fluid -I./solid -I./porousFluid -I./porousSolid -I./include -I/opt/openfoam7/src/meshTools/lnInclude -I/opt/openfoam7/src/sampling/lnInclude -I/opt/openfoam7/src/finiteVolume/lnInclude -I/opt/openfoam7/src/finiteVolume/cfdTools -I/opt/openfoam7/src/transportModels/compressible/lnInclude -I/opt/openfoam7/src/thermophysicalModels/basic/lnInclude -I/opt/openfoam7/src/thermophysicalModels/specie/lnInclude -I/opt/openfoam7/src/thermophysicalModels/reactionThermo/lnInclude -I/opt/openfoam7/src/thermophysicalModels/solidThermo/lnInclude -I/opt/openfoam7/src/thermophysicalModels/chemistryModel/lnInclude -I/opt/openfoam7/src/ODE/lnInclude -I/opt/openfoam7/src/combustionModels/lnInclude -I/opt/openfoam7/src/TurbulenceModels/turbulenceModels/lnInclude -I/opt/openfoam7/src/TurbulenceModels/compressible/lnInclude -I/opt/openfoam7/src/radiationModels/lnInclude -I/opt/openfoam7/src/regionModels/regionModel/lnInclude -IlnInclude -I. -I/opt/openfoam7/src/OpenFOAM/lnInclude -I/opt/openfoam7/src/OSspecific/POSIX/lnInclude -fPIC -c fluid/compressibleCourantNo.C -o /opt/openfoam7/platforms/linux64GccDPInt32Opt/applications/solvers/heatTransfer/LTSchtMultiRegionFoam/fluid/compressibleCourantNo.o
g++ -std=c++11 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3 -DNoRepository -ftemplate-depth-100 -I. -I./fluid -I./solid -I./porousFluid -I./porousSolid -I./include -I/opt/openfoam7/src/meshTools/lnInclude -I/opt/openfoam7/src/sampling/lnInclude -I/opt/openfoam7/src/finiteVolume/lnInclude -I/opt/openfoam7/src/finiteVolume/cfdTools -I/opt/openfoam7/src/transportModels/compressible/lnInclude -I/opt/openfoam7/src/thermophysicalModels/basic/lnInclude -I/opt/openfoam7/src/thermophysicalModels/specie/lnInclude -I/opt/openfoam7/src/thermophysicalModels/reactionThermo/lnInclude -I/opt/openfoam7/src/thermophysicalModels/solidThermo/lnInclude -I/opt/openfoam7/src/thermophysicalModels/chemistryModel/lnInclude -I/opt/openfoam7/src/ODE/lnInclude -I/opt/openfoam7/src/combustionModels/lnInclude -I/opt/openfoam7/src/TurbulenceModels/turbulenceModels/lnInclude -I/opt/openfoam7/src/TurbulenceModels/compressible/lnInclude -I/opt/openfoam7/src/radiationModels/lnInclude -I/opt/openfoam7/src/regionModels/regionModel/lnInclude -IlnInclude -I. -I/opt/openfoam7/src/OpenFOAM/lnInclude -I/opt/openfoam7/src/OSspecific/POSIX/lnInclude -fPIC -c solid/solidRegionDiffNo.C -o /opt/openfoam7/platforms/linux64GccDPInt32Opt/applications/solvers/heatTransfer/LTSchtMultiRegionFoam/solid/solidRegionDiffNo.o
g++ -std=c++11 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3 -DNoRepository -ftemplate-depth-100 -I. -I./fluid -I./solid -I./porousFluid -I./porousSolid -I./include -I/opt/openfoam7/src/meshTools/lnInclude -I/opt/openfoam7/src/sampling/lnInclude -I/opt/openfoam7/src/finiteVolume/lnInclude -I/opt/openfoam7/src/finiteVolume/cfdTools -I/opt/openfoam7/src/transportModels/compressible/lnInclude -I/opt/openfoam7/src/thermophysicalModels/basic/lnInclude -I/opt/openfoam7/src/thermophysicalModels/specie/lnInclude -I/opt/openfoam7/src/thermophysicalModels/reactionThermo/lnInclude -I/opt/openfoam7/src/thermophysicalModels/solidThermo/lnInclude -I/opt/openfoam7/src/thermophysicalModels/chemistryModel/lnInclude -I/opt/openfoam7/src/ODE/lnInclude -I/opt/openfoam7/src/combustionModels/lnInclude -I/opt/openfoam7/src/TurbulenceModels/turbulenceModels/lnInclude -I/opt/openfoam7/src/TurbulenceModels/compressible/lnInclude -I/opt/openfoam7/src/radiationModels/lnInclude -I/opt/openfoam7/src/regionModels/regionModel/lnInclude -IlnInclude -I. -I/opt/openfoam7/src/OpenFOAM/lnInclude -I/opt/openfoam7/src/OSspecific/POSIX/lnInclude -fPIC -c LTSchtMultiRegionFoam.C -o /opt/openfoam7/platforms/linux64GccDPInt32Opt/applications/solvers/heatTransfer/LTSchtMultiRegionFoam/LTSchtMultiRegionFoam.o
In file included from createFields.H:1,
from LTSchtMultiRegionFoam.C:62:
/opt/openfoam7/src/finiteVolume/lnInclude/createRDeltaT.H: In function ‘int main(int, char**)’:
/opt/openfoam7/src/finiteVolume/lnInclude/createRDeltaT.H:1:39: error: ‘mesh’ was not declared in this scope
1 | bool LTS = fv::localEulerDdt::enabled(mesh);
In file included from LTSchtMultiRegionFoam.C:83:
setRDeltaT.H:32:29: error: ‘phi’ was not declared in this scope
32 | fvc::surfaceSum(mag(phi))()()
make: *** [/opt/openfoam7/wmake/rules/General/transform:26: /opt/openfoam7/platforms/linux64GccDPInt32Opt/applications/solvers/heatTransfer/LTSchtMultiRegionFoam/LTSchtMultiRegionFoam.o] Erro 1

For the error "‘mesh’ was not declared in this scope" I think we have to do some something similar tho pimples, once we don't have #include "createMesh.H", but instead #include "createMeshes.H". As chtMultiRegionFoam deals with multiregion mesh, it's expected that we have meshes instead of mesh.

For the error ‘phi’ was not declared in this scope, I think that I'm missing some include. And it's not correctPhi.H, because I've tried this one and the error message it's the same.

I also checked the options includes and librarys, but it seems ok to me.

I couldn't figure this out guys. That's why I'm here. It would be a pleasure to handle to you a multi region solver that could deal with localEuler ddtScheme. But I'm not so good at programming, so I hope that someone better than me take I look at this and shine some lights in how to solve these errors.

Link for download the solver:
Link for download the case:
wilsonrcf is offline   Reply With Quote

Old   April 8, 2021, 20:14
New Member
Daniel W Theobald
Join Date: Feb 2017
Posts: 10
Rep Power: 9
pm11dt is on a distinguished road
Did you manage to make any progress with this?

I am also working on this dev problem at moment maybe we can work together?

Essentially, this issue you point out opens a can of worms.

The first issue is a line that sets a bool variable (yes or no conditional) based on if you have localEuler ddt scheme set in fvSchemes. Normally, for say a single-phase single region case like in rhoPimpleFoam, it would check to the mesh data to check this. Here we can have many meshes, one for each fluid and solid regions which is technically infinite, so which does it check?

Moreover, this issue of having many meshes (regions) makes it very non-trivial to make the conversion to LTS solver. For example, I think you need to create a trDeltaT field (the local time-step) for each region which I'm trying to do in setRegionsFluidFields.H and createFluidMeshes.H (same for solid versions of the .H).

Also w.r.t the phi issue, does it not need to point to phi for each fluid region? Again this is an issue of many regions/meshes.

Also, there needs to be a control for the local timestep for the solid regions based on diffusion number maxDi in setRDeltaT.H .

I think you understand but look at the LTS code additions and see if they actually make sense in the multiregion case, compare against rhoPimpleFoam, interFoam, reactingEulerFoam (all of which have LTS built in) but all only use one mesh.

I am making progress and I will update if get anything to compile, this is something I'm doing out of curiosity though so may drop it.

Maybe it is something we can bring up with the developers?
pm11dt is offline   Reply With Quote


chtmultiregionfoam, errors, localeuler, lts, pseudo-transient

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
whats the cause of error? immortality OpenFOAM Running, Solving & CFD 13 March 24, 2021 07:15
Parallel run: bool ipstream::init attempt to run parallel on 1 processor SarahLee OpenFOAM Running, Solving & CFD 2 January 11, 2017 03:24
[ICEM] can't develop good grid anawana ANSYS Meshing & Geometry 0 April 26, 2014 07:45
[General] 2 datas on one plot Akuji ParaView 46 December 1, 2013 14:06
is internalField(U) equivalent to zeroGradient? immortality OpenFOAM Running, Solving & CFD 7 March 29, 2013 01:27

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