|
[Sponsors] |
August 7, 2013, 05:46 |
Problem adding rhoPhi
|
#1 |
Senior Member
Join Date: Jul 2011
Posts: 120
Rep Power: 14 |
I am trying to solve this:
Code:
fvScalarMatrix SEqn ( fvm::ddt(rho,S) + fvm::div(rhoPhi, S) - fvm::laplacian(DT, S) ); Code:
Info<< "Reading field rho\n" << endl; volScalarField rho ( IOobject ( "rho", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), mesh ); surfaceScalarField rhoPhi ( IOobject ( "rho*phi", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE ), rho*phi ); Code:
createFields.H:90: error: no matching function for call to ‘Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>::GeometricField(Foam::IOobject, Foam::tmp<Foam::Field<double> >)’ /opt/OpenFOAM/OpenFOAM-1.6-ext/src/OpenFOAM/lnInclude/GeometricField.C:653: 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] |
|
August 7, 2013, 10:34 |
|
#2 |
New Member
Michael Ranft
Join Date: Jun 2012
Location: Karlsruhe
Posts: 3
Rep Power: 13 |
In your case rho is a volScalarField while in interFoam rho1 is a dimensionedScalar.
You can't multiply a surfaceScalarField (phi) with a volScalarField (rho). For a volScalarField all values are defined at the cell centres and for surfaceScalarFields at the face centres of each cell. So you first have to interpolate the centre values of the rho field to the face centres. Afterwards you can multiply phi with this new rho field: Code:
surfaceScalarField rhoPhi ( IOobject ( "rho*phi", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE ), linearInterpolate(rho) * phi ); Code:
surfaceScalarField rhoPhi ( IOobject ( "rho*phi", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE ), fvc::interpolate(rho)*phi ); http://openfoamwiki.net/index.php/Op...eInterpolation |
|
August 7, 2013, 10:55 |
|
#3 |
Senior Member
Join Date: Jul 2011
Posts: 120
Rep Power: 14 |
Thank you very much, fixed.
|
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
area does not match neighbour by ... % -- possible face ordering problem | St.Pacholak | OpenFOAM | 10 | February 7, 2024 21:50 |
conduction problem | venkataramana | OpenFOAM | 3 | December 1, 2013 07:30 |
UDF compiling problem | Wouter | Fluent UDF and Scheme Programming | 6 | June 6, 2012 04:43 |
natural convection problem for a CHT problem | Se-Hee | CFX | 2 | June 10, 2007 06:29 |
Adiabatic and Rotating wall (Convection problem) | ParodDav | CFX | 5 | April 29, 2007 19:13 |