|
[Sponsors] |
May 5, 2015, 01:37 |
volumeIntegrate
|
#1 |
Member
Join Date: May 2014
Posts: 31
Rep Power: 11 |
Can someone please tell me how to use volumeIntegrate function belonging to fvc in an OpenFOAM code.
I'm working on a solver including a chemical process and I need to get a volume integral of a reaction rate. I tried following code: #include "fvcVolumeIntegrate.H" volScalarField rc ( "rc", expression for reaction rate ); volScalarField Vrc ( "Vrc", fvc::volumeIntegrate(rc) ); But this did not work. I got the following error while compiling, no matching function for call to ‘Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::GeometricField(const char [8], Foam::tmp<Foam::Field<double> >)’ indicating to the line I used fvc::volumeIntegrate(rc). Can some one please help? Thanks kcn |
|
May 5, 2015, 04:07 |
|
#2 |
Senior Member
|
Hi,
The error just says: "I can not construct volScalarField from string and scalarField". If you take a look at volumeIntegrate documentation [1], you find that the function returns Field<Type>, or in your case it is scalarField. Now, if you look at the list of volScalarField constructors [2], there is really no constructor, which takes string and Field as arguments. You can try to use constructor [3], which takes IOobject (where the field should be saved), Mesh, dimensionSet (dimensions of the Field argument), Field (the result of volumeIntegrate), and list of boundary condition objects. Alternatively, you can use constructor [4] to create empty volScalarField and then assign result of the volumeIntegrate to internalField of the object created. Or even more alternatively, you can clarify the reason for creation of the volScalarField from volumeIntegrate result. Maybe there is a way to do this without volScalarField. 1. http://foam.sourceforge.net/docs/cpp...8525fad4c79edf 2. http://foam.sourceforge.net/docs/cpp/a00911.html 3. http://foam.sourceforge.net/docs/cpp...bb5c374222054a 4. http://foam.sourceforge.net/docs/cpp...0d8f8a5fec0dc8 |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
volumeIntegrate ? | T.D. | OpenFOAM | 5 | September 5, 2011 06:27 |