View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002075 | OpenFOAM | Bug | public | 2016-04-29 15:28 | 2016-04-29 20:23 |
Reporter | wwzhao | Assigned To | henry | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Platform | Unix | OS | Other | OS Version | (please specify) |
Fixed in Version | dev | ||||
Summary | 0002075: singlePhaseTransportModel is not run-time selectable | ||||
Description | singlePhaseTransportModel should be run-time selectable, otherwise it fails on: mesh_.lookupObject<singlePhaseTransportModel>("transportProperties"); | ||||
Tags | No tags attached. | ||||
|
What case are you running which produces this problem? I am unable to reproduce. |
|
#include "fvCFD.H" #include "singlePhaseTransportModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // int main(int argc, char *argv[]) { #include "setRootCase.H" #include "createTime.H" #include "createMesh.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // mesh.lookupObject<singlePhaseTransportModel>("transportProperties"); Info<< nl << "ExecutionTime = " << runTime.elapsedCpuTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s" << nl << endl; Info<< "End\n" << endl; return 0; } The above code complains: /home/wwzhao/OpenFOAM/OpenFOAM-3.0.1/src/OpenFOAM/lnInclude/objectRegistryTemplates.C:201:58: error: reference to ‘Foam::singlePhaseTransportModel::typeName’ is ambiguous |
|
A patch is attached. diff --git a/src/transportModels/incompressible/singlePhaseTransportModel/singlePhaseTransportModel.C b/src/transportModels/incompressible/singlePhaseTransportModel/singlePhaseTransportModel.C index 4c113d2..217911e 100644 --- a/src/transportModels/incompressible/singlePhaseTransportModel/singlePhaseTransportModel.C +++ b/src/transportModels/incompressible/singlePhaseTransportModel/singlePhaseTransportModel.C @@ -27,6 +27,13 @@ License #include "viscosityModel.H" #include "volFields.H" +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(singlePhaseTransportModel, 0); +} + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // diff --git a/src/transportModels/incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H b/src/transportModels/incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H index 3e73606..959f4a9 100644 --- a/src/transportModels/incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H +++ b/src/transportModels/incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H @@ -74,6 +74,8 @@ class singlePhaseTransportModel public: + TypeName("singlePhaseTransportModel"); + // Constructors //- Construct from components |
|
Why do you need to lookup a singlePhaseTransportModel? |
|
I was intend to read rho from transportProperties for single-phase flow in order to calculate forces for an object. The forces are calculated by a code snippet we wrote instead of the forces function object. But I've realized that p is actually pressure over density for single-phase flow, and flow density is not specified during computation. $ grep 'rho' -r $FOAM_TUTORIALS/incompressible --include="transportProperties" /home/wwzhao/OpenFOAM/OpenFOAM-3.0.1/tutorials/incompressible/simpleFoam/airFoil2D/constant/transportProperties:rho [1 -3 0 0 0 0 0] 1; Maybe I should change the method for calculating forces. |
|
Resolved in OpenFOAM-dev by commit 1fbf79d231470e0ce82a7262825723bac3e69310 |
Date Modified | Username | Field | Change |
---|---|---|---|
2016-04-29 15:28 | wwzhao | New Issue | |
2016-04-29 15:33 | henry | Note Added: 0006191 | |
2016-04-29 15:55 | wwzhao | Note Added: 0006192 | |
2016-04-29 16:07 | wwzhao | Note Added: 0006193 | |
2016-04-29 16:15 | henry | Note Added: 0006194 | |
2016-04-29 19:09 | wwzhao | Note Added: 0006201 | |
2016-04-29 20:22 | henry | Note Added: 0006202 | |
2016-04-29 20:22 | henry | Status | new => resolved |
2016-04-29 20:22 | henry | Fixed in Version | => dev |
2016-04-29 20:22 | henry | Resolution | open => fixed |
2016-04-29 20:22 | henry | Assigned To | => henry |