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

New MultiRegionSolver using chtMultiRegionSimpleFoam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 9, 2017, 03:30
Default New MultiRegionSolver using chtMultiRegionSimpleFoam
  #1
Member
 
Saleh Abuhanieh
Join Date: Nov 2017
Posts: 83
Rep Power: 8
Saleh Abuhanieh is on a distinguished road
Hi Foamers,

I am trying to modify a very simple standard solver (electrostaticFoam) to able to solve multi Region cases.
until now I did the following:
- created the required multi region geometry using salome
- converted the unv file using ideasUnvToFoam then separated the regions using splitMeshRegions -cellZonesOnly -overwrite
- finally, the case folder contains the required regions and inter-regions boundaries.

now for similar solvers, I found (may be I am wrong) it only in the heat transfer solvers. I've copied the chtMultiRegionSimpleFoam, renamed and compiled to be able to manipulate it.

I decided to run it first in my case to see from where I need to start changing the solver.

the output was as follow:

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create solid mesh for region SubSimulationDomain_InternalVacuum for time = 0

Create solid mesh for region SubSimulationDomain_MetalShields for time = 0

Create solid mesh for region SubSimulationDomain_ExternalVacuum for time = 0

Create solid mesh for region SubSimulationDomain_Insulator for time = 0

*** Reading solid mesh thermophysical properties for region SubSimulationDomain_InternalVacuum

Adding to thermos



--> FOAM FATAL ERROR:
cannot find file "/home/salehabuhanieh/OpenFOAM/salehabuhanieh-dev-debug/run/Case2Run/constant/SubSimulationDomain_InternalVacuum/thermophysicalProperties"

From function virtual Foam::autoPtr<Foam::ISstream> Foam::fileOperations::uncollatedFileOperation::rea dStream(Foam::regIOobject&, const Foam::fileName&, const Foam::word&, bool) const

the error message is very clear, the file thermophysicalProperties is not there, I didn't put it since it is not required in my case. In my case I need to read simple file only with two parameters physicalProperties.

after that, I tracked the solver files, I found the line in createSolidFields.H


// Initialise solid field pointer lists

PtrList<coordinateSystem> coordinates(solidRegions.size());

PtrList<solidThermo> thermos(solidRegions.size());

PtrList<radiation::radiationModel> radiations(solidRegions.size());

PtrList<fv:ptions> solidHeatSources(solidRegions.size());

PtrList<volScalarField> betavSolid(solidRegions.size());

PtrList<volSymmTensorField> aniAlphas(solidRegions.size());



List<bool> residualReachedSolid(solidRegions.size(), true);

List<bool> residualControlUsedSolid(solidRegions.size(), false);



// Populate solid field pointer lists

forAll(solidRegions, i)

{

Info<< "*** Reading solid mesh thermophysical properties for region "

<< solidRegions[i].name() << nl << endl;



Info<< " Adding to thermos\n" << endl;

thermos.set(i, solidThermo::New(solidRegions[i]));



Info<< " Adding to radiations\n" << endl;

radiations.set(i, radiation::radiationModel::New(thermos[i].T()));



Info<< " Adding fvOptions\n" << endl;

solidHeatSources.set

(

i,

new fv:ptions(solidRegions[i])

);



if (!thermos[i].isotropic())

{

Info<< " Adding coordinateSystems\n" << endl;

coordinates.set

(

i,

coordinateSystem::New(solidRegions[i], thermos[i])

);



tmp<volVectorField> tkappaByCp =

thermos[i].Kappa()/thermos[i].Cp();



aniAlphas.set

(

i,

new volSymmTensorField

(

IOobject

(

"Anialpha",

runTime.timeName(),

solidRegions[i],

IOobject::NO_READ,

IOobject::NO_WRITE

),

solidRegions[i],

dimensionedSymmTensor

(

"zero",

tkappaByCp().dimensions(),

Zero

),

zeroGradientFvPatchSymmTensorField::typeName

)

);



aniAlphas[i].primitiveFieldRef() =

coordinates[i].R().transformVector(tkappaByCp());

aniAlphas[i].correctBoundaryConditions();



}



IOobject betavSolidIO

(

"betavSolid",

runTime.timeName(),

solidRegions[i],

IOobject::MUST_READ,

IOobject::AUTO_WRITE

);



if (betavSolidIO.typeHeaderOk<volScalarField>(true))

{

betavSolid.set

(

i,

new volScalarField(betavSolidIO, solidRegions[i])

);

}

else

{

betavSolid.set

(

i,

new volScalarField

(

IOobject

(

"betavSolid",

runTime.timeName(),

solidRegions[i],

IOobject::NO_READ,

IOobject::NO_WRITE

),

solidRegions[i],

dimensionedScalar("1", dimless, scalar(1))

)

);

}

}

actually, non of the parameters which are included in this file are required in my case.

my understanding that I want to create ptrList similar to solidThermo.

I found the source code for solidThermo but I don't know how to change it and compile it correctly.

I tried to ignore the lines in createSolidFields.H and to read this file differently, I had errors related to ptrList.

I need your help please
Saleh Abuhanieh is offline   Reply With Quote

Old   December 12, 2017, 00:25
Default
  #2
Member
 
Saleh Abuhanieh
Join Date: Nov 2017
Posts: 83
Rep Power: 8
Saleh Abuhanieh is on a distinguished road
I hope I've explained the case well
Saleh Abuhanieh 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
how to use setFields in multiregionsolver lg88 OpenFOAM 18 June 12, 2022 19:57
MultiregionSolver mm.abdollahzadeh OpenFOAM Running, Solving & CFD 1 April 1, 2012 09:22


All times are GMT -4. The time now is 07:02.