|
[Sponsors] |
March 27, 2013, 11:45 |
|
#21 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
thanks.but the error persists:
Code:
ehsan@Ehsan-com:~/Desktop/rhoPimpleFoamLimited$ wmake Making dependency list for source file rhoPimpleFoamLimited.C SOURCE=rhoPimpleFoamLimited.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam211/src/thermophysicalModels/basic/lnInclude -I/opt/openfoam211/src/turbulenceModels/compressible/turbulenceModel -I/opt/openfoam211/src/finiteVolume/cfdTools -I/opt/openfoam211/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/openfoam211/src/OpenFOAM/lnInclude -I/opt/openfoam211/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/rhoPimpleFoamLimited.o rhoPimpleFoamLimited.C: In function ‘int main(int, char**)’: rhoPimpleFoamLimited.C:90:85: error: invalid types ‘<unresolved overloaded function type>[Foam::label {aka int}]’ for array subscript rhoPimpleFoamLimited.C:94:41: error: name lookup of ‘cellI’ changed for ISO ‘for’ scoping [-fpermissive] rhoPimpleFoamLimited.C:94:41: note: (if you use ‘-fpermissive’ G++ will accept your code) rhoPimpleFoamLimited.C:100:132: error: ‘Foam::T’ does not have class type make: *** [Make/linux64GccDPOpt/rhoPimpleFoamLimited.o] Error 1 |
|
March 27, 2013, 11:48 |
|
#22 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
the code is now:
Code:
forAll(U,cellI) { U[cellI].component(0)=min(U[cellI].component(0), sqrt(1.4*287.14*T[cellI])-30); } forAll(U,cellJ) { U[cellJ].component(1)=max(U[cellI].component(1),-150); } word patchName = "left"; label patchID = mesh.boundary().findPatchID(patchName); forAll(U.boundaryField()[patchID],faceI) { U.boundaryField()[patchID][faceI].component(0)=min(U.boundaryField()[patchID][faceI].component(0), sqrt(1.4*287.14*T.boundaryField()[patchID][faceI])-30); U.boundaryField()[patchID][faceI].component(1)=max(U.boundaryField()[patchID][faceI].component(1),-150); } |
|
March 28, 2013, 08:22 |
|
#23 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
hi
did you find a reason for this error and not compiling? |
|
March 28, 2013, 08:54 |
|
#24 |
Member
Simone
Join Date: Sep 2012
Posts: 95
Rep Power: 14 |
Maybe the first error (the one at line 90) is because you are trying to subtract T and the scalar value 30, but I'm not sure about it.
The second error (line 94) it's because you are using [cellI] variable into a loop with [cellJ]. The third (line 100) it's because, probably, you can't write T.boundaryField[patchID][faceI] since, I think, T doesn't have the access class "boundaryField". Try instead Code:
T.boundary[patchID][faceI] Hope this helps Simone |
|
March 28, 2013, 09:24 |
|
#25 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
thanks dear Simone.I changed it so:
Code:
forAll(U,cellI) { U[cellI].component(0)=min(U[cellI].component(0), sqrt(1.4*287.14*T[cellI])); } forAll(U,cellJ) { U[cellJ].component(1)=max(U[cellJ].component(1),-150); } word patchName = "left"; label patchID = mesh.boundary().findPatchID(patchName); forAll(U.boundaryField()[patchID],faceI) { U.boundaryField()[patchID][faceI].component(0)=min(U.boundaryField()[patchID][faceI].component(0), sqrt(1.4*287.14*T.boundary()[patchID][faceI])); U.boundaryField()[patchID][faceI].component(1)=max(U.boundaryField()[patchID][faceI].component(1),-150); } Code:
rhoPimpleFoamLimited.C: In function ‘int main(int, char**)’: rhoPimpleFoamLimited.C:90:85: error: invalid types ‘<unresolved overloaded function type>[Foam::label {aka int}]’ for array subscript rhoPimpleFoamLimited.C:100:132: error: ‘Foam::T’ does not have class type make: *** [Make/linux64GccDPOpt/rhoPimpleFoamLimited.o] Error 1 |
|
March 28, 2013, 09:43 |
|
#26 |
Member
Simone
Join Date: Sep 2012
Posts: 95
Rep Power: 14 |
How have you defined T?
|
|
March 28, 2013, 09:43 |
|
#27 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
it seems it has trouble with T field.I only put it:
Code:
forAll(U,cellI) { //U[cellI].component(0)=min(U[cellI].component(0), sqrt(401.996*T[cellI])); U[cellI].component(0)=min(U[cellI].component(0), T[cellI]); U[cellI].component(1)=max(U[cellI].component(1),-150); } Code:
rhoPimpleFoamLimited.C: In function ‘int main(int, char**)’: rhoPimpleFoamLimited.C:91:69: error: invalid types ‘<unresolved overloaded function type>[Foam::label {aka int}]’ for array subscript make: *** [Make/linux64GccDPOpt/rhoPimpleFoamLimited.o] Error 1 |
|
March 28, 2013, 09:52 |
|
#28 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
it seems it has trouble with T field.I only put it:
Code:
forAll(U,cellI) { //U[cellI].component(0)=min(U[cellI].component(0), sqrt(401.996*T[cellI])); U[cellI].component(0)=min(U[cellI].component(0), T[cellI]); U[cellI].component(1)=max(U[cellI].component(1),-150); } Code:
rhoPimpleFoamLimited.C: In function ‘int main(int, char**)’: rhoPimpleFoamLimited.C:91:69: error: invalid types ‘<unresolved overloaded function type>[Foam::label {aka int}]’ for array subscript make: *** [Make/linux64GccDPOpt/rhoPimpleFoamLimited.o] Error 1 |
|
March 28, 2013, 10:05 |
|
#29 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
it seems it has trouble with T field.I only put it:
Code:
forAll(U,cellI) { //U[cellI].component(0)=min(U[cellI].component(0), sqrt(401.996*T[cellI])); U[cellI].component(0)=min(U[cellI].component(0), T[cellI]); U[cellI].component(1)=max(U[cellI].component(1),-150); } Code:
rhoPimpleFoamLimited.C: In function ‘int main(int, char**)’: rhoPimpleFoamLimited.C:91:69: error: invalid types ‘<unresolved overloaded function type>[Foam::label {aka int}]’ for array subscript make: *** [Make/linux64GccDPOpt/rhoPimpleFoamLimited.o] Error 1 |
|
March 28, 2013, 10:16 |
|
#30 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
oh.it wasn't sending but three of it send at a same time!
what do you mean by defining T? OF doesn't recognize T field itself? |
|
March 28, 2013, 10:24 |
|
#31 |
Member
Simone
Join Date: Sep 2012
Posts: 95
Rep Power: 14 |
You are modifying a solver that was already present, right? Check in the associated createFields.H file how is T defined!
And then try to have a look to the access functions that can be used for that particular "T" field. Cheers Simone |
|
March 28, 2013, 10:39 |
|
#32 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
its total of creatFields.H!
its seemed that T is not defined explicitly in it. should I add it?like rho? where can find access functions? Code:
Info<< "Reading thermophysical properties\n" << endl; autoPtr<basicPsiThermo> pThermo ( basicPsiThermo::New(mesh) ); basicPsiThermo& thermo = pThermo(); volScalarField& p = thermo.p(); volScalarField& h = thermo.h(); const volScalarField& psi = thermo.psi(); volScalarField rho ( IOobject ( "rho", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE ), thermo.rho() ); Info<< "Reading field U\n" << endl; volVectorField U ( IOobject ( "U", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh ); #include "compressibleCreatePhi.H" dimensionedScalar rhoMax(pimple.dict().lookup("rhoMax")); dimensionedScalar rhoMin(pimple.dict().lookup("rhoMin")); Info<< "Creating turbulence model\n" << endl; autoPtr<compressible::turbulenceModel> turbulence ( compressible::turbulenceModel::New ( rho, U, phi, thermo ) ); Info<< "Creating field dpdt\n" << endl; volScalarField dpdt("dpdt", fvc::ddt(p)); Info<< "Creating field kinetic energy K\n" << endl; volScalarField K("K", 0.5*magSqr(U)); |
|
March 28, 2013, 15:45 |
|
#33 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
I defined T as:
Code:
volScalarField T ( IOobject ( "T", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE ), thermo.T() ); is it true now? but another question,how T is written in time folders when it is not defined directly in creatFields.H? |
|
March 28, 2013, 16:28 |
|
#34 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
but the error now is:
Code:
ehsan@Ehsan-com:~/Desktop/rhoPimpleFoamLimited$ wmake Making dependency list for source file rhoPimpleFoamLimited.C SOURCE=rhoPimpleFoamLimited.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam220/src/thermophysicalModels/basic/lnInclude -I/opt/openfoam220/src/turbulenceModels/compressible/turbulenceModel -I/opt/openfoam220/src/finiteVolume/cfdTools -I/opt/openfoam220/src/finiteVolume/lnInclude -I/opt/openfoam220/src/meshTools/lnInclude -I/opt/openfoam220/src/sampling/lnInclude -I/opt/openfoam220/src/fvOptions/lnInclude -IlnInclude -I. -I/opt/openfoam220/src/OpenFOAM/lnInclude -I/opt/openfoam220/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/rhoPimpleFoamLimited.o rhoPimpleFoamLimited.C: In function ‘int main(int, char**)’: rhoPimpleFoamLimited.C:94:83: error: call of overloaded ‘sqrt(double)’ is ambiguous rhoPimpleFoamLimited.C:94:83: note: candidates are: /usr/include/x86_64-linux-gnu/bits/mathcalls.h:157:1: note: double sqrt(double) /opt/openfoam220/src/OpenFOAM/lnInclude/dimensionedScalar.H:65:19: note: Foam::dimensionedScalar Foam::sqrt(const dimensionedScalar&) /opt/openfoam220/src/OpenFOAM/lnInclude/Scalar.H:258:1: note: Foam::doubleScalar Foam::sqrt(Foam::doubleScalar) /opt/openfoam220/src/OpenFOAM/lnInclude/Scalar.H:258:1: note: Foam::floatScalar Foam::sqrt(Foam::floatScalar) rhoPimpleFoamLimited.C:106:161: error: call of overloaded ‘sqrt(double)’ is ambiguous rhoPimpleFoamLimited.C:106:161: note: candidates are: /usr/include/x86_64-linux-gnu/bits/mathcalls.h:157:1: note: double sqrt(double) /opt/openfoam220/src/OpenFOAM/lnInclude/dimensionedScalar.H:65:19: note: Foam::dimensionedScalar Foam::sqrt(const dimensionedScalar&) /opt/openfoam220/src/OpenFOAM/lnInclude/Scalar.H:258:1: note: Foam::doubleScalar Foam::sqrt(Foam::doubleScalar) /opt/openfoam220/src/OpenFOAM/lnInclude/Scalar.H:258:1: note: Foam::floatScalar Foam::sqrt(Foam::floatScalar) make: *** [Make/linux64GccDPOpt/rhoPimpleFoamLimited.o] Error 1 thank you. |
|
March 29, 2013, 01:10 |
|
#35 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
what is incorrect in T now?I've defined it.
Another question is if this limiting true in aspect of CFD results?i mean does it lead to correct results with limiting?whats its influence in your opinion? |
|
March 29, 2013, 08:20 |
|
#36 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
did anyone find a reason and solution of the problem?
|
|
March 29, 2013, 08:44 |
|
#37 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,903
Rep Power: 37 |
I believe it would help if you put
Code:
Foam:: Kind regards, Niels |
|
March 29, 2013, 09:00 |
|
#38 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
thank you very very so much dear Niels!!
it resolved. may you tell me the reason?is the sqrt a class object? how could i find the access functions for fields? |
|
March 29, 2013, 09:04 |
|
#39 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,903
Rep Power: 37 |
It is my understand that the compiler does not know, whether to use the std:: or Foam:: class definition of sqrt, since the Foam:: is probably derived from std::.
Kind regards, Niels |
|
March 30, 2013, 07:19 |
|
#40 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
i have a subsonic problem but velocity at early time steps goes higher than sonic velocity and so i've limited it to sonic values as you can see above.
I have a doubt about the effect of this work on last results. Because running takes much time i decided to ask first. The CFD problem is unsteady compressible if important. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF error - parabolic velocity profile - 3D turbine | Zaqie | Fluent UDF and Scheme Programming | 9 | June 25, 2016 20:08 |
unable to get parabolic velocity profile with pimplefoam | houkensjtu | OpenFOAM | 4 | October 8, 2012 05:41 |
Emergency:UDF for a time dependent parabolic velocity | zumaqiong | Fluent UDF and Scheme Programming | 12 | March 25, 2010 13:00 |
Neumann pressure BC and velocity field | Antech | Main CFD Forum | 0 | April 25, 2006 03:15 |
what the result is negatif pressure at inlet | chong chee nan | FLUENT | 0 | December 29, 2001 06:13 |