|
[Sponsors] |
Adding 2-Phase Fluid (interFoam) to chtMultiRegionFoam - issues initializing alpha |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 21, 2021, 16:39 |
Adding 2-Phase Fluid (interFoam) to chtMultiRegionFoam - issues initializing alpha
|
#1 |
Member
Kellis
Join Date: Mar 2017
Posts: 39
Rep Power: 9 |
Foamers,
Good afternoon. I am in the process of modifying chtMultiRegionFoam (in OF 1806) to model an incompressible, two-phase fluid. I am doing this in several steps, and have already modified the solver for incompressible flow. Now, I am nearly done adding in the code from interFoam to allow for two phases to be solved, but am experiencing issues with the createAlphaFluxes.H file. When compiling, I get the following error: Code:
./multiRegionVoF/createAlphaFluxes.H:47:59: error: array must be initialized with a brace-enclosed initializer alphaPhi10HeaderList[i].typeHeaderOk<surfaceScalarField>(); Code:
// createAlphaFluxes.H PtrList<IOobject> alphaPhi10HeaderList(fluidRegions.size()); PtrList<bool> alphaRestartList(fluidRegions.size()); PtrList<surfaceScalarField> alphaPhi10List(fluidRegions.size()); PtrList<surfaceScalarField> talphaPhi1Corr0List(fluidRegions.size()); forAll(fluidRegions, i) { alphaPhi10HeaderList.set ( i, new IOobject ( IOobject ( IOobject::groupName("alphaPhi0", alpha1l[i].group()), runTime.timeName(), fluidRegions[i], IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE ), fluidRegions[i] ) ); // this line trips error const bool alphaRestartList[i] = alphaPhi10HeaderList[i].typeHeaderOk<surfaceScalarField>(); // more stuff below here ... } Code:
... alphaRestartList.set ( i, new const bool ( "alphaRestart", alphaPhi10HeaderList[i].typeHeaderOk<surfaceScalarField>(true) ) ); ... Thanks, Kellis |
|
October 15, 2021, 06:17 |
|
#2 |
New Member
XinZhou
Join Date: Apr 2018
Posts: 11
Rep Power: 8 |
Hi,Kellis,have you solved this problem?
|
|
October 15, 2021, 10:39 |
|
#3 |
Member
Kellis
Join Date: Mar 2017
Posts: 39
Rep Power: 9 |
Yes, I have had the code working for some time now. I'm not exactly sure what I changed to get past this issue, but below is the working code in the createAlphaFluxes.H file where I was having issues.
Best of luck, Kellis Code:
PtrList<IOobject> alphaPhi10HeaderList(fluidRegions.size()); PtrList<bool> alphaRestartList(fluidRegions.size()); PtrList<surfaceScalarField> alphaPhi10List(fluidRegions.size()); Info << " Creating alpha fluxes\n" << endl; forAll(fluidRegions, i) { alphaPhi10HeaderList.set ( i, new IOobject ( IOobject ( IOobject::groupName("alphaPhi0", alpha1l[i].group()), runTime.timeName(), fluidRegions[i], IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE ), fluidRegions[i] ) ); IOobject alphaRestartTmp = alphaPhi10HeaderList[i]; const bool alphaRestartListTmp = alphaRestartTmp.typeHeaderOk<surfaceScalarField>(true); alphaRestartList.set ( i, new bool(alphaRestartListTmp) ); if (alphaRestartList[i]) { Info << "Restarting alpha" << endl; } // MULES flux from previous time-step alphaPhi10List.set ( i, new surfaceScalarField ( "alphaPhi10Header", phiFluid[i]*fvc::interpolate(alpha1l[i]) ) ); tmp<surfaceScalarField> talphaPhi1Corr0; Info << " Done creating alpha fluxes\n" << endl; } |
|
Tags |
alpha, cht, interfoam, vof |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem with running chtMultiRegionFoam after using setSet utility | Victor | OpenFOAM | 12 | March 24, 2023 01:01 |
[swak4Foam] mass conservation of solid phase violated when using groovyBC with twoPhaseEulerFoam | xpqiu | OpenFOAM Community Contributions | 8 | June 17, 2015 03:08 |
Adding an energy source term to a phase with reactions | lxlxlxt | Fluent Multiphase | 0 | February 10, 2014 21:42 |
compressible two phase flow in CFX4.4 | youngan | CFX | 0 | July 2, 2003 00:32 |
Terrible Mistake In Fluid Dynamics History | Abhi | Main CFD Forum | 12 | July 8, 2002 10:11 |