|
[Sponsors] |
September 6, 2010, 08:54 |
For loops in OpenFoam
|
#1 |
Senior Member
Balkrishna Patankar
Join Date: Mar 2009
Location: Pune
Posts: 123
Rep Power: 17 |
I am generalising the twoPhase Euler Foam to handle n Phases . In the file pEqn.H I want to sum up the phase fraction of all the dispersed phases to get the dispersed phase . To do so I programmed the following :
Code:
PtrList<surfaceScalarField>alphaf(nPhases); //just an initialization surfaceScalarField af ; surfaceScalarField betaf = scalar(1) - af; forAll(alphaf,aPh) { alphaf.set(aPh,fvc::interpolate(phases[aPh].alpha())); af= af + alphaf[aPh]; } betaf = scalar(1) - af ; Code:
error: no matching function for call to ‘Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>::GeometricField()’ /home/ifmg/OpenFOAM/OpenFOAM-1.7.0/src/OpenFOAM/lnInclude/GeometricField.C:652: note: candidates are: Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::IOobject&, const Foam::GeometricField<Type, PatchField, GeoMesh>&, const Foam::wordList&) [with Type = double, PatchField = Foam::fvsPatchField, GeoMesh = Foam::surfaceMesh] |
|
September 7, 2010, 03:48 |
|
#2 |
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36 |
Hi,
af must be initialized on declaration. You can define it with IObject, but specifying NO_READ, NO_WRITE as options, and setting it to zero (see how this is done for ppMagf in twoPhaseEulerFoam for example). Best,
__________________
Alberto Passalacqua GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541) OpenQBMM - An open-source implementation of quadrature-based moment methods. To obtain more accurate answers, please specify the version of OpenFOAM you are using. |
|
September 7, 2010, 03:52 |
|
#3 |
Senior Member
Balkrishna Patankar
Join Date: Mar 2009
Location: Pune
Posts: 123
Rep Power: 17 |
Ok ... Thanks ...
|
|
Tags |
error, multiphase flow |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Superlinear speedup in OpenFOAM 13 | msrinath80 | OpenFOAM Running, Solving & CFD | 18 | March 3, 2015 06:36 |
Modified OpenFOAM Forum Structure and New Mailing-List | pete | Site News & Announcements | 0 | June 29, 2009 06:56 |
64bitrhel5 OF installation instructions | mirko | OpenFOAM Installation | 2 | August 12, 2008 19:07 |
Adventure of fisrst openfoam installation on Ubuntu 710 | jussi | OpenFOAM Installation | 0 | April 24, 2008 15:25 |
OpenFOAM Debian packaging current status problems and TODOs | oseen | OpenFOAM Installation | 9 | August 26, 2007 14:50 |