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

On chtMultiRegionTwoPhaseEulerFoam to develop chtMultiRegionCompressibleInterFoam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 13, 2022, 06:31
Default On chtMultiRegionTwoPhaseEulerFoam to develop chtMultiRegionCompressibleInterFoam
  #1
New Member
 
Join Date: Feb 2022
Posts: 25
Rep Power: 4
theBananaTrick is on a distinguished road
Hello to all,

Following the post in compressibleInterFoam with conjugated heat transfer I started developing a chtMultiRegionCompressibleInterFoam with OFv2106

However, upon checking chtMultiRegionTwoPhaseEulerFoam I got several doubts regarding the solver. If anyone can give me hand with it, I would highly appreciate it.

1. Shound't the name of the solver be chtMultiRegionReactingTwoPhaseEulerFoam? It is solving the "YEqns". There are two solvers in ${FOAM_SOLVERS}/multiphase named twoPhaseEulerFoam. One accounts for reactions, the other does not.

2. Where is the initialMassFluid being used?
It is being calculated in line 284 of createFluidFields.H

Code:
initialMassFluid[i] =
        fvc::domainIntegrate(phaseSystemFluid[i].rho()).value();
and in line 44 of setRegionFluidFields.H assigned to a variable called initialMass. But where is it being used in the calculations?


3.
Any particular reason for compressibleInterFoam not using the pRefCell, pRefValue? And where is it being used in chtMultiRegionTwoPhaseEulerFoam ?

Finally, I would like to know how to compute the Courant number for a multiRegion case where dt can is based on the Courant number and Alpha Courant number.
In compressibleInterFoam, ignoring LTS, this is being calculated and defined from line 104-106 of compressibleInterFoam.C

Code:
src/finiteVolume/cfdTools/incompressible/CourantNo.H
scalar CoNum = 0.0;
scalar meanCoNum = 0.0;
{
   scalarField sumPhi
   (
       fvc::surfaceSum(mag(phi))().primitiveField()
   );

   CoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();

   meanCoNum =
       0.5*(gSum(sumPhi)/gSum(mesh.V().field()))*runTime.deltaTValue();
}

Info<< "Courant Number mean: " << meanCoNum   << " max: " << CoNum << endl;


applications/solvers/multiphase/VoF/alphaCourantNo.H
scalar maxAlphaCo
(
   runTime.controlDict().get<scalar>("maxAlphaCo")
);

scalar alphaCoNum = 0.0;
scalar meanAlphaCoNum = 0.0;

if (mesh.nInternalFaces())
{
   scalarField sumPhi
   (
       mixture.nearInterface()().primitiveField()
      *fvc::surfaceSum(mag(phi))().primitiveField()
   );

   alphaCoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();

   meanAlphaCoNum =
       0.5*(gSum(sumPhi)/gSum(mesh.V().field()))*runTime.deltaTValue();
}

Info<< "Interface Courant Number mean: " << meanAlphaCoNum   << " max: " << alphaCoNum << endl;

applications/solvers/multiphase/VoF/setDeltaT.H
if (adjustTimeStep)
{
   scalar maxDeltaTFact =
       min(maxCo/(CoNum + SMALL), maxAlphaCo/(alphaCoNum + SMALL));

   scalar deltaTFact = min(min(maxDeltaTFact, 1.0 + 0.1*maxDeltaTFact), 1.2);

   runTime.setDeltaT
   (
       min
       (
           deltaTFact*runTime.deltaTValue(),
           maxDeltaT
       )
   );

   Info<< "deltaT = " <<  runTime.deltaTValue() << endl;
}
For the multiRegion case with this do: (?)
Code:
   scalar CoNum = -GREAT;
   scalar alphaCoNum = -GREAT;
   scalar maxAlphaCo = -GREAT;

   forAll(fluidRegions, regionI)
   {
       scalar CoNumI = 0.0;
       scalarField sumPhi
       (
           fvc::surfaceSum(mag(phiFluid[regionI]))().primitiveField()
       );

       CoNumI = 0.5*gMax(sumPhi/fluidRegions[regionI].V().field())*runTime.deltaTValue();
       CoNum = max(CoNumI, CoNum);

       // Calculation of alphaCourant.H from applications/solvers/multiphase/VoF/alphaCourantNo.H
       maxAlphaCo = max(maxAlphaCo, fluidRegions[regionI].time().controlDict().get<scalar>("maxAlphaCo"));

       scalar alphaCoNumI = 0.0;

       if (fluidRegions[regionI].nInternalFaces())
       {
           scalarField sumPhi
           (
               mixtureFluid[regionI].nearInterface()().primitiveField()
               *fvc::surfaceSum(mag(phiFluid[regionI]))().primitiveField()
           );

           alphaCoNumI = 0.5*gMax(sumPhi/fluidRegions[regionI].V().field())*runTime.deltaTValue();
       }

       alphaCoNum = max(alphaCoNumI, alphaCoNum);
   }

Last edited by theBananaTrick; April 21, 2022 at 07:58.
theBananaTrick is offline   Reply With Quote

Old   April 18, 2024, 19:28
Default
  #2
New Member
 
Oscar Zagal
Join Date: Jan 2024
Posts: 10
Rep Power: 2
oscar_zagal is on a distinguished road
Hello there

With respect your first question, there are no boundary conditions about species, then I don't understand why the solver solves that equation, did you find the reason?
oscar_zagal 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 develop code that scales well without having access to supercomputers? aerosayan Main CFD Forum 18 May 21, 2022 20:33
How to develop OpenFOAM with CMake and popular IDEs cosscholar OpenFOAM Programming & Development 0 March 16, 2022 15:17
How to develop a LES interMixingFoam case Wais OpenFOAM Pre-Processing 0 April 29, 2014 22:05
[ICEM] can't develop good grid anawana ANSYS Meshing & Geometry 0 April 26, 2014 07:45
Did someone develop a CIP solver tachioka OpenFOAM Running, Solving & CFD 0 October 10, 2007 10:17


All times are GMT -4. The time now is 11:26.