|
[Sponsors] |
Error while using forAllIter macro in own equation file |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 27, 2015, 12:12 |
Error while using forAllIter macro in own equation file
|
#1 |
Member
Anurag
Join Date: Aug 2014
Location: Germany
Posts: 57
Rep Power: 12 |
I want to solve an additional set of equations in multiphaseEulerFoam for my case, so I made a new file called DQMOMEqns_New.H.
But when I compile, I get some errors: Code:
DQMOMEqns_New.H: In function ‘int main(int, char**)’: DQMOMEqns_New.H:42:43: error: ‘phases_’ was not declared in this scope forAllIter(PtrDictionary<phaseModel>, phases_, iter) ^ /home/m/OpenFOAM/OpenFOAM-2.3.x/src/OpenFOAM/lnInclude/UList.H:443:37: note: in definition of macro ‘forAllIter’ Container::iterator iter = (container).begin(); \ ^ In file included from multiphaseEulerPbeFoam.C:91:0: DQMOMEqns_New.H:66:60: error: ‘phi1’ was not declared in this scope surfaceScalarField phir[phasei](phase.phi() - phi1()); ^ DQMOMEqns_New.H:66:61: error: variable-sized object ‘phir’ may not be initialized surfaceScalarField phir[phasei](phase.phi() - phi1()); ^ DQMOMEqns_New.H:72:43: error: no matching function for call to ‘div(Foam::surfaceScalarField [(((sizetype)(((ssizetype)phasei) + -1)) + 1)], Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&)’ + fvm::div(phir,weight[phasei]) ^ Code:
int phasei = 0; forAllIter(PtrDictionary<phaseModel>, phases_, iter) { phaseModel& phase = iter(); volScalarField& alpha = phase; if (phasei == 0) { surfaceScalarField phi1 = phase.phi(); sumAlpha = alpha; } phasei++; } |
|
April 29, 2015, 17:08 |
|
#2 |
Senior Member
Kent Wardle
Join Date: Mar 2009
Location: Illinois, USA
Posts: 219
Rep Power: 21 |
instead of phases_ use fluid.phases()
|
|
April 30, 2015, 13:05 |
|
#3 |
Member
Anurag
Join Date: Aug 2014
Location: Germany
Posts: 57
Rep Power: 12 |
Thanks for the reply. This works, I do not get this error now.
|
|
Tags |
euler-euler, eulerian, multiphase |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[swak4Foam] funkyDoCalc with OF2.3 massflow | NiFl | OpenFOAM Community Contributions | 14 | November 25, 2020 04:30 |
[swak4Foam] swak4Foam-groovyBC build problem | zxj160 | OpenFOAM Community Contributions | 18 | July 30, 2013 14:14 |
"parabolicVelocity" in OpenFoam 2.1.0 ? | sawyer86 | OpenFOAM Running, Solving & CFD | 21 | February 7, 2012 12:44 |
DxFoam reader update | hjasak | OpenFOAM Post-Processing | 69 | April 24, 2008 02:24 |
error while compiling the USER Sub routine | CFD user | CFX | 3 | November 25, 2002 16:16 |