View Issue Details

IDProjectCategoryView StatusLast Update
0002075OpenFOAM[All Projects] Bugpublic2016-04-29 20:23
ReporterwwzhaoAssigned Tohenry 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformUnixOSOtherOS Version(please specify)
Product Version 
Fixed in Versiondev 
Summary0002075: singlePhaseTransportModel is not run-time selectable
DescriptionsinglePhaseTransportModel should be run-time selectable, otherwise it fails on:

    mesh_.lookupObject<singlePhaseTransportModel>("transportProperties");
TagsNo tags attached.

Activities

henry

2016-04-29 15:33

manager   ~0006191

What case are you running which produces this problem? I am unable to reproduce.

wwzhao

2016-04-29 15:55

reporter   ~0006192

#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

wwzhao

2016-04-29 16:07

reporter   ~0006193

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

henry

2016-04-29 16:15

manager   ~0006194

Why do you need to lookup a singlePhaseTransportModel?

wwzhao

2016-04-29 19:09

reporter   ~0006201

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.

henry

2016-04-29 20:22

manager   ~0006202

Resolved in OpenFOAM-dev by commit 1fbf79d231470e0ce82a7262825723bac3e69310

Issue History

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