|
[Sponsors] |
write out nusselt number (gradient of T, respectively) for timesteps |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 12, 2016, 19:33 |
|
#21 |
Senior Member
|
Hi Ram,
The solver was developed in 2009, back then OpenFOAM was at version 1.5 - this is why it does not compile in more recent versions. I suggest you start from simpleFoam, and add the scalar equations in the same way you can see in simpleScalarFoam. It is not too difficult (the Programmers guide is a very good starting point to understand where and how to start). Regards, Jose |
|
March 12, 2016, 19:50 |
|
#22 |
Member
Join Date: Oct 2015
Posts: 63
Rep Power: 11 |
Hello Santos!
I added the temperature field to the icoFoam solver and it's working just fine. I think the problem was with my computer's anti-virus. I re-installed it and now I'm able to compile my solver without any glitches. Thanks!! |
|
March 12, 2016, 20:45 |
|
#23 |
Member
Join Date: Oct 2015
Posts: 63
Rep Power: 11 |
Hey,
There's another roadblock that I've hit I've added temperature in the foamDataToFluentDict file. When I do foamDataToFuent, OpenFOAM reads the temperature field and I can see the temperature in the .dat file along with U and p. (Btw I've executed foamMeshToFluent as well) However, when I open the case file in Fluent and then the .dat file, I'm not able to see the temperature contour. I can select velocity and pressure but not the temperature. I'm stuck and don't know whether this is another bug or if I'm doing something wrong. Thanks. Ram |
|
March 27, 2016, 23:27 |
openfoam 2.2.2, not working with this
|
#24 |
New Member
Kai
Join Date: Mar 2014
Posts: 5
Rep Power: 12 |
Hello guys
I have a modified simpleFoam solver with temperature scalar transport equation implemented. I now want to calculate the temperature gradient at wall surfaces. I followed Santos' codes in post #4 on this thread and included his codes into my solver. I am now getting a compilation error that says: simpleEnergySourceFoamtest.C:189:17: error: no matching function for call to ‘Foam::dimensioned<Foam::Vector<double> >::dimensioned(const char [6], Foam::dimensionSet, int)’ I am not sure what 189:17 means, it seems to stay the same in the error message even after I make changes to the solver. Can anyone please help point me to the right direction? I am using openfoam 2.2.2 |
|
March 28, 2016, 16:47 |
|
#25 |
New Member
Fei
Join Date: Oct 2015
Posts: 13
Rep Power: 11 |
Hi, Santos
Thanks for your help, and recently, I try to compile a function to calculate local Nusselt Number, in which I need to write a if statement to see whether the local surface flux = 0. As below if (patchHeatFlux[patchi]==0) NusseltNumber.boundaryField()[patchi] = 0; While we I compile it, it report the error: error: passing ‘const Foam::fvsPatchField<double>’ as ‘this’ argument of ‘void Foam::fvsPatchField<Type>:perator==(const Type&) [with Type = double]’ discards qualifiers [-fpermissive] if (patchHeatFlux[patchi]==0) ^ NusseltCalc.C:139:39: error: could not convert ‘(&(& patchHeatFlux)->Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>::GeometricBoundaryField::<anony mous>.Foam::FieldField<Foam::fvsPatchField, double>::<anonymous>.Foam::PtrList<T>:perator[]<Foam::fvsPatchField<double> >(patchi))->Foam::fvsPatchField<Type>:perator==<double>(( * &0.0))’ from ‘void’ to ‘bool’ if (patchHeatFlux[patchi]==0) ^ It seems the patchHeatFlux[patchi] is a special data type, Do you have any suggestion to make that if statement work? Thanks a lot |
|
April 28, 2016, 10:19 |
finding nusselt number
|
#26 |
New Member
narayana vekamulla
Join Date: Oct 2015
Posts: 15
Rep Power: 11 |
Dear Joes Santos,
i am using ubuntu 15.04, i want to know nusselt number at the wall and mean . i am using buoyantBoussinesqSimpleFoam. i made some changes in WallHeatFlux folder. i dont have any problem with coding. please tell me while we are running the solver (buoyantBoussinesqSimpleFoam), Do i change any TRANSPORT PROPERTIES / CONTROL DICT ? to get the Nusselt number ? if so please tell me ! Thanks and Regards |
|
May 7, 2016, 11:48 |
|
#27 |
Member
Join Date: Oct 2015
Posts: 63
Rep Power: 11 |
Hey,
Has anyone written a code to calculate the Nusselt Number for laminar forced convection for an incompressible fluid? I have modified the icoFoam solver to solve the energy equation as well. I want to calculate the Nusselt Number now. Also, to calculate the Nusselt Number, the bulk temperature of the fluid at that cross section has to be found. Can someone guide me in this regard? Thanks!! Ram |
|
December 30, 2016, 16:52 |
|
#28 | |
Member
Saurav Kumar
Join Date: Jul 2016
Posts: 80
Rep Power: 10 |
Quote:
Hi ram, did you solve it? actually i am facing the same type of problem i am using opefoam4, pls help me to solve it. thanks |
||
December 30, 2016, 16:54 |
|
#29 |
Member
Saurav Kumar
Join Date: Jul 2016
Posts: 80
Rep Power: 10 |
i tried to find gradT same as mention in this thread but i am getting error, files are attached.
srv@srv:~/OpenFOAM/srv-4.1/applications/solvers/nicoTempFoam$ wmake Making dependency list for source file nicoTempFoam.C g++ -std=c++0x -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam4/src/finiteVolume/lnInclude -I/opt/openfoam4/src/meshTools/lnInclude -IlnInclude -I. -I/opt/openfoam4/src/OpenFOAM/lnInclude -I/opt/openfoam4/src/OSspecific/POSIX/lnInclude -fPIC -c nicoTempFoam.C -o Make/linux64GccDPInt32Opt/nicoTempFoam.o In file included from nicoTempFoam.C:47:0: createFields.H: In function ‘int main(int, char**)’: createFields.H:89:12: error: expected primary-expression before ‘)’ token ); ^ nicoTempFoam.C:136:31: error: passing ‘const Foam::fvPatchField<double>’ as ‘this’ argument discards qualifiers [-fpermissive] gradT.boundaryField()[patchi] = T.boundaryField()[patchi].snGrad(); ^ In file included from /opt/openfoam4/src/finiteVolume/lnInclude/fvPatchField.H:592:0, from /opt/openfoam4/src/finiteVolume/lnInclude/volFields.H:40, from /opt/openfoam4/src/finiteVolume/lnInclude/surfaceInterpolationScheme.C:27, from /opt/openfoam4/src/finiteVolume/lnInclude/surfaceInterpolationScheme.H:304, from /opt/openfoam4/src/finiteVolume/lnInclude/surfaceInterpolate.H:41, from /opt/openfoam4/src/finiteVolume/lnInclude/fvc.H:39, from /opt/openfoam4/src/finiteVolume/lnInclude/fvCFD.H:8, from nicoTempFoam.C:33: /opt/openfoam4/src/finiteVolume/lnInclude/fvPatchField.C:395:6: note: in call to ‘void Foam::fvPatchField<Type>:perator=(const Foam::UList<T>&) [with Type = double]’ void Foam::fvPatchField<Type>:perator= ^ /opt/openfoam4/wmake/rules/General/transform:8: recipe for target 'Make/linux64GccDPInt32Opt/nicoTempFoam.o' failed make: *** [Make/linux64GccDPInt32Opt/nicoTempFoam.o] Error 1 |
|
December 31, 2016, 05:42 |
|
#30 | |
Senior Member
Sergei
Join Date: Dec 2009
Posts: 261
Rep Power: 22 |
Quote:
Code:
volScalarField gradT ( IOobject ( "gradT", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), mesh, ); Code:
volScalarField gradT ( IOobject ( "gradT", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), mesh ); |
||
December 31, 2016, 08:59 |
|
#31 |
Member
Saurav Kumar
Join Date: Jul 2016
Posts: 80
Rep Power: 10 |
Hello Zeppo
i deleted that comma and tried to wmake but still i am getting error /OpenFOAM/srv-4.1/applications/solvers/nicoTempFoam$ wmake Making dependency list for source file nicoTempFoam.C g++ -std=c++0x -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam4/src/finiteVolume/lnInclude -I/opt/openfoam4/src/meshTools/lnInclude -IlnInclude -I. -I/opt/openfoam4/src/OpenFOAM/lnInclude -I/opt/openfoam4/src/OSspecific/POSIX/lnInclude -fPIC -c nicoTempFoam.C -o Make/linux64GccDPInt32Opt/nicoTempFoam.o nicoTempFoam.C: In function ‘int main(int, char**)’: nicoTempFoam.C:136:31: error: passing ‘const Foam::fvPatchField<double>’ as ‘this’ argument discards qualifiers [-fpermissive] gradT.boundaryField()[patchi] = T.boundaryField()[patchi].snGrad(); ^ In file included from /opt/openfoam4/src/finiteVolume/lnInclude/fvPatchField.H:592:0, from /opt/openfoam4/src/finiteVolume/lnInclude/volFields.H:40, from /opt/openfoam4/src/finiteVolume/lnInclude/surfaceInterpolationScheme.C:27, from /opt/openfoam4/src/finiteVolume/lnInclude/surfaceInterpolationScheme.H:304, from /opt/openfoam4/src/finiteVolume/lnInclude/surfaceInterpolate.H:41, from /opt/openfoam4/src/finiteVolume/lnInclude/fvc.H:39, from /opt/openfoam4/src/finiteVolume/lnInclude/fvCFD.H:8, from nicoTempFoam.C:33: /opt/openfoam4/src/finiteVolume/lnInclude/fvPatchField.C:395:6: note: in call to ‘void Foam::fvPatchField<Type>:perator=(const Foam::UList<T>&) [with Type = double]’ void Foam::fvPatchField<Type>:perator= ^ /opt/openfoam4/wmake/rules/General/transform:8: recipe for target 'Make/linux64GccDPInt32Opt/nicoTempFoam.o' failed make: *** [Make/linux64GccDPInt32Opt/nicoTempFoam.o] Error 1 |
|
December 31, 2016, 09:08 |
|
#32 |
Member
Saurav Kumar
Join Date: Jul 2016
Posts: 80
Rep Power: 10 |
I am using openfoam4, in my code if i delete
gradT.boundaryField()[patchi]=T.boundaryField()[patchi].snGrad(); then wmake works perfectly, so the problem is only in this line execution to calculating gradT. and if i use to define dimension of gradT Info<< "Reading field gradT\n" << endl; volScalarField gradT ( IOobject ( "gradT", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh dimensionedScalar ( "gradT", DT.dimensions()/dimLength, 0 ) ); then the Error is srv@srv:~/OpenFOAM/srv-4.1/applications/solvers/nicoTempFoam$ wmake g++ -std=c++0x -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam4/src/finiteVolume/lnInclude -I/opt/openfoam4/src/meshTools/lnInclude -IlnInclude -I. -I/opt/openfoam4/src/OpenFOAM/lnInclude -I/opt/openfoam4/src/OSspecific/POSIX/lnInclude -fPIC -c nicoTempFoam.C -o Make/linux64GccDPInt32Opt/nicoTempFoam.o In file included from nicoTempFoam.C:47:0: createFields.H: In function ‘int main(int, char**)’: createFields.H:91:5: error: expected ‘)’ before ‘dimensionedScalar’ dimensionedScalar ^ nicoTempFoam.C:136:30: error: passing ‘const Foam::fvPatchField<double>’ as ‘this’ argument discards qualifiers [-fpermissive] gradT.boundaryField()[patchi]=T.boundaryField()[patchi].snGrad(); ^ In file included from /opt/openfoam4/src/finiteVolume/lnInclude/fvPatchField.H:592:0, from /opt/openfoam4/src/finiteVolume/lnInclude/volFields.H:40, from /opt/openfoam4/src/finiteVolume/lnInclude/surfaceInterpolationScheme.C:27, from /opt/openfoam4/src/finiteVolume/lnInclude/surfaceInterpolationScheme.H:304, from /opt/openfoam4/src/finiteVolume/lnInclude/surfaceInterpolate.H:41, from /opt/openfoam4/src/finiteVolume/lnInclude/fvc.H:39, from /opt/openfoam4/src/finiteVolume/lnInclude/fvCFD.H:8, from nicoTempFoam.C:33: /opt/openfoam4/src/finiteVolume/lnInclude/fvPatchField.C:395:6: note: in call to ‘void Foam::fvPatchField<Type>:perator=(const Foam::UList<T>&) [with Type = double]’ void Foam::fvPatchField<Type>:perator= ^ /opt/openfoam4/wmake/rules/General/transform:8: recipe for target 'Make/linux64GccDPInt32Opt/nicoTempFoam.o' failed make: *** [Make/linux64GccDPInt32Opt/nicoTempFoam.o] Error 1 |
|
December 31, 2016, 10:30 |
|
#33 |
Senior Member
Sergei
Join Date: Dec 2009
Posts: 261
Rep Power: 22 |
Code:
Info<< "Reading field gradT\n" << endl; volScalarField gradT ( IOobject ( "gradT", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh dimensionedScalar ( "gradT", DT.dimensions()/dimLength, 0 ) ); Code:
Info<< "Reading field gradT\n" << endl; volScalarField gradT ( IOobject ( "gradT", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh, dimensionedScalar ( "gradT", DT.dimensions()/dimLength, 0 ) ); |
|
December 31, 2016, 10:50 |
|
#34 |
Member
Saurav Kumar
Join Date: Jul 2016
Posts: 80
Rep Power: 10 |
Sir here DT is thermal diffusivity or deltaT?
code Info<< "Reading field gradT\n" << endl; volScalarField gradT ( IOobject ( "gradT", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh, dimensionedScalar ( "gradT", DT.dimensions()/dimLength, 0 ) ); i tried as you suggested but still i am getting error ~/OpenFOAM/srv-4.1/applications/solvers/nicoTempFoam$ wmake g++ -std=c++0x -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam4/src/finiteVolume/lnInclude -I/opt/openfoam4/src/meshTools/lnInclude -IlnInclude -I. -I/opt/openfoam4/src/OpenFOAM/lnInclude -I/opt/openfoam4/src/OSspecific/POSIX/lnInclude -fPIC -c nicoTempFoam.C -o Make/linux64GccDPInt32Opt/nicoTempFoam.o nicoTempFoam.C: In function ‘int main(int, char**)’: nicoTempFoam.C:136:30: error: passing ‘const Foam::fvPatchField<double>’ as ‘this’ argument discards qualifiers [-fpermissive] gradT.boundaryField()[patchi]=T.boundaryField()[patchi].snGrad(); ^ In file included from /opt/openfoam4/src/finiteVolume/lnInclude/fvPatchField.H:592:0, from /opt/openfoam4/src/finiteVolume/lnInclude/volFields.H:40, from /opt/openfoam4/src/finiteVolume/lnInclude/surfaceInterpolationScheme.C:27, from /opt/openfoam4/src/finiteVolume/lnInclude/surfaceInterpolationScheme.H:304, from /opt/openfoam4/src/finiteVolume/lnInclude/surfaceInterpolate.H:41, from /opt/openfoam4/src/finiteVolume/lnInclude/fvc.H:39, from /opt/openfoam4/src/finiteVolume/lnInclude/fvCFD.H:8, from nicoTempFoam.C:33: /opt/openfoam4/src/finiteVolume/lnInclude/fvPatchField.C:395:6: note: in call to ‘void Foam::fvPatchField<Type>:perator=(const Foam::UList<T>&) [with Type = double]’ void Foam::fvPatchField<Type>:perator= ^ /opt/openfoam4/wmake/rules/General/transform:8: recipe for target 'Make/linux64GccDPInt32Opt/nicoTempFoam.o' failed make: *** [Make/linux64GccDPInt32Opt/nicoTempFoam.o] Error 1 srv@srv:~/OpenFOAM/srv-4.1/applications/solvers/nicoTempFoam$ |
|
December 31, 2016, 11:44 |
|
#35 |
Senior Member
Sergei
Join Date: Dec 2009
Posts: 261
Rep Power: 22 |
Code:
gradT.boundaryField()[patchi]=T.boundaryField()[patchi].snGrad(); Code:
gradT.boundaryFieldRef()[patchi]=T.boundaryFieldRef()[patchi].snGrad(); |
|
December 31, 2016, 13:34 |
|
#36 | |
Member
Saurav Kumar
Join Date: Jul 2016
Posts: 80
Rep Power: 10 |
Quote:
Thank you so much sir it is working perfectly . Sir last question, label patchi = mesh.boundaryMesh().findPatchID("HEATEDWALL"); if i change the geometry and name of patchi (surface) then i have to go to solver and modify its patchi name and then use wmake everytime. is there any solution for this so i dont need to change solver everytime. thanks again sir |
||
December 31, 2016, 15:10 |
|
#37 | |
Senior Member
Sergei
Join Date: Dec 2009
Posts: 261
Rep Power: 22 |
Quote:
Code:
patchName yourPatchName; Code:
const dictionary dic ("ralative/path/to/the/file/with/your/patchName"); if(dic.found("patchName") { const word patchName = dic.lookup("patchName"); const label patchi = mesh.boundaryMesh().findPatchID(patchName); } |
||
January 2, 2017, 05:02 |
|
#38 |
Member
Saurav Kumar
Join Date: Jul 2016
Posts: 80
Rep Power: 10 |
i have added in my solver
//specify patch name const dictionary dic ("/home/saurav/OpenFOAM/srv-4.1/run/icoTempFoam/constant/patchName"); if(dic.found("patchName")) { const word patchName = dic.lookup("patchName"); const label patchi = mesh.boundaryMesh().findPatchID(patchName); } i have created a file in constant/patchName /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "constant"; object patchName; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // patchName heatedWall; // ************************************************** *********************** // but i am getting error Calculating gradT #0 Foam::error:rintStack(Foam::Ostream&) at ??:? #1 Foam::sigSegv::sigHandler(int) at ??:? #2 ? in "/lib/x86_64-linux-gnu/libc.so.6" #3 ? at ??:? #4 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6" #5 ? at ??:? Segmentation fault (core dumped) |
|
January 2, 2017, 05:59 |
|
#39 |
Senior Member
Sergei
Join Date: Dec 2009
Posts: 261
Rep Power: 22 |
Now you have to locate yourself the specific line in the code which causes the error.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem with decomposePar tool | vinz | OpenFOAM Pre-Processing | 18 | January 26, 2011 03:17 |
UDF for Nusselt Number | preibie | FLUENT | 1 | November 16, 2010 22:28 |
DecomposePar unequal number of shared faces | maka | OpenFOAM Pre-Processing | 6 | August 12, 2010 10:01 |
[blockMesh] BlockMeshmergePatchPairs | hjasak | OpenFOAM Meshing & Mesh Conversion | 11 | August 15, 2008 08:36 |
[Commercial meshers] Trimmed cell and embedded refinement mesh conversion issues | michele | OpenFOAM Meshing & Mesh Conversion | 2 | July 15, 2005 05:15 |