CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

laminarNusselt utility

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 30, 2014, 08:13
Default laminarNusselt utility
  #1
Member
 
sajad
Join Date: Apr 2014
Location: Iran
Posts: 46
Rep Power: 11
sajad6 is on a distinguished road
I want to build NusseltCalcLaminar for Laminar flow.first I get wallHeatFluxLaminar of mr Tobias Holzmann. it's link is below

https://github.com/shor-ty/wallHeatFluxLaminar

and I add it Nusselt formula:


Code:
volScalarField NusseltNumber
(
IOobject
(
"NusseltNumber",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar("NusseltNumber", heatFlux.dimensions(), 0.0)
);
forAll(NusseltNumber.boundaryField(), patchi)
{
NusseltNumber.boundaryField()[patchi] = length*
patchHeatFlux[patchi]/((T_hot-T_initial)*k);
}
NusseltNumber.write();
 
 
but when I compile it I face with this error;
 
sajad@sajad-pc:~/Desktop/nusseltCalcLaminar$ wmake
SOURCE=nusseltCalcLaminar.C ; g++ -m32 -Dlinux -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam210/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/openfoam210/src/OpenFOAM/lnInclude -I/opt/openfoam210/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linuxGccDPOpt/nusseltCalcLaminar.o
In file included from nusseltCalcLaminar.C:55:
readRefValues.H: In function ‘int main(int, char**)’:
readRefValues.H:13: error: conflicting declaration ‘Foam::scalar k’
createFields.H:17: error: ‘k’ has a previous declaration as ‘Foam::dimensionedScalar k’
nusseltCalcLaminar.C:112: error: no match for ‘operator/’ in ‘Foamerator*(const Foam::scalar&, const Foam::UList<T>&) [with Type = double](((const Foam::UList<double>&)(&((const Foam::fvsPatchField<double>*)((const Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>::GeometricBoundaryField*)patchHeatFlux)->Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>::GeometricBoundaryField::<anonymous>.Foam::FieldField<Foam::fvsPatchField, double>::<anonymous>.Foam::PtrList<T>erator[] [with T = Foam::fvsPatchField<double>](patchi))->Foam::fvsPatchField<double>::<anonymous>.Foam::Field<double>::<anonymous>.Foam::List<double>::<anonymous>))) / Foamerator*(const Foam::dimensioned<double>&, const Foam::dimensioned<Type>&) [with Type = double](((const Foam::dimensioned<double>&)((const Foam::dimensioned<double>*)(& k))))’
/opt/openfoam210/src/OpenFOAM/lnInclude/fileName.H:194: note: candidates are: Foam::fileName Foamerator/(const Foam::string&, const Foam::string&)
/opt/openfoam210/src/OpenFOAM/lnInclude/dimensionSet.H:275: note: Foam::dimensionSet Foamperator/(const Foam::dimensionSet&, const Foam::dimensionSet&)
/opt/openfoam210/src/OpenFOAM/lnInclude/dimensionedScalar.H:56: note: Foam::dimensionedScalar Foamerator/(Foam::scalar, const Foam::dimensionedScalar&)
/opt/openfoam210/src/OpenFOAM/lnInclude/scalarField.H:81: note: Foam::tmp<Foam::Field<double> > Foamperator/(const Foam::UList<double>&, const Foam::UList<double>&)
/opt/openfoam210/src/OpenFOAM/lnInclude/scalarField.H:81: note: Foam::tmp<Foam::Field<double> > Foamperator/(const Foam::UList<double>&, const Foam::tmp<Foam::Field<double> >&)
/opt/openfoam210/src/OpenFOAM/lnInclude/scalarField.H:81: note: Foam::tmp<Foam::Field<double> > Foamperator/(const Foam::tmp<Foam::Field<double> >&, const Foam::UList<double>&)
/opt/openfoam210/src/OpenFOAM/lnInclude/scalarField.H:81: note: Foam::tmp<Foam::Field<double> > Foamperator/(const Foam::tmp<Foam::Field<double> >&, const Foam::tmp<Foam::Field<double> >&)
/opt/openfoam210/src/OpenFOAM/lnInclude/scalarField.H:83: note: Foam::tmp<Foam::Field<double> > Foamperator/(const Foam::scalar&, const Foam::UList<double>&)
/opt/openfoam210/src/OpenFOAM/lnInclude/scalarField.H:83: note: Foam::tmp<Foam::Field<double> > Foamperator/(const Foam::scalar&, const Foam::tmp<Foam::Field<double> >&)
/opt/openfoam210/src/OpenFOAM/lnInclude/sphericalTensorField.H:58: note: Foam::tmp<Foam::Field<Foam::SphericalTensor<double> > > Foamperator/(const Foam::UList<double>&, const Foam::UList<Foam::SphericalTensor<double> >&)
/opt/openfoam210/src/OpenFOAM/lnInclude/sphericalTensorField.H:58: note: Foam::tmp<Foam::Field<Foam::SphericalTensor<double> > > Foamperator/(const Foam::UList<double>&, const Foam::tmp<Foam::Field<Foam::SphericalTensor<double> > >&)
/opt/openfoam210/src/OpenFOAM/lnInclude/sphericalTensorField.H:58: note: Foam::tmp<Foam::Field<Foam::SphericalTensor<double> > > Foamperator/(const Foam::tmp<Foam::Field<double> >&, const Foam::UList<Foam::SphericalTensor<double> >&)
/opt/openfoam210/src/OpenFOAM/lnInclude/sphericalTensorField.H:58: note: Foam::tmp<Foam::Field<Foam::SphericalTensor<double> > > Foamperator/(const Foam::tmp<Foam::Field<double> >&, const Foam::tmp<Foam::Field<Foam::SphericalTensor<double> > >&)
/opt/openfoam210/src/OpenFOAM/lnInclude/sphericalTensorField.H:59: note: Foam::tmp<Foam::Field<Foam::SphericalTensor<double> > > Foamperator/(const Foam::scalar&, const Foam::UList<Foam::SphericalTensor<double> >&)
/opt/openfoam210/src/OpenFOAM/lnInclude/sphericalTensorField.H:59: note: Foam::tmp<Foam::Field<Foam::SphericalTensor<double> > > Foamperator/(const Foam::scalar&, const Foam::tmp<Foam::Field<Foam::SphericalTensor<double> > >&)
/opt/openfoam210/src/OpenFOAM/lnInclude/sphericalTensorField.H:59: note: Foam::tmp<Foam::Field<Foam::SphericalTensor<double> > > Foamperator/(const Foam::UList<double>&, const Foam::sphericalTensor&)
/opt/openfoam210/src/OpenFOAM/lnInclude/sphericalTensorField.H:59: note: Foam::tmp<Foam::Field<Foam::SphericalTensor<double> > > Foamperator/(const Foam::tmp<Foam::Field<double> >&, const Foam::sphericalTensor&)
/opt/openfoam210/src/OpenFOAM/lnInclude/tensorField.H:78: note: Foam::tmp<Foam::Field<Foam::Vector<double> > > Foamperator/(const Foam::UList<Foam::Vector<double> >&, const Foam::UList<Foam::Tensor<double> >&)
/opt/openfoam210/src/OpenFOAM/lnInclude/tensorField.H:78: note: Foam::tmp<Foam::Field<Foam::Vector<double> > > Foamperator/(const Foam::UList<Foam::Vector<double> >&, const Foam::tmp<Foam::Field<Foam::Tensor<double> > >&)
/opt/openfoam210/src/OpenFOAM/lnInclude/tensorField.H:78: note: Foam::tmp<Foam::Field<Foam::Vector<double> > > Foam:perator/(const Foam::tmp<Foam::Field<Foam::Vector<double> > >&, const Foam::UList<Foam::Tensor<double> >&)
/opt/openfoam210/src/OpenFOAM/lnInclude/tensorField.H:78: note: Foam::tmp<Foam::Field<Foam::Vector<double> > > Foamperator/(const Foam::tmp<Foam::Field<Foam::Vector<double> > >&, const Foam::tmp<Foam::Field<Foam::Tensor<double> > >&)
/opt/openfoam210/src/OpenFOAM/lnInclude/tensorField.H:79: note: Foam::tmp<Foam::Field<Foam::Vector<double> > > Foamperator/(const Foam::vector&, const Foam::UList<Foam::Tensor<double> >&)
/opt/openfoam210/src/OpenFOAM/lnInclude/tensorField.H:79: note: Foam::tmp<Foam::Field<Foam::Vector<double> > > Foamperator/(const Foam::vector&, const Foam::tmp<Foam::Field<Foam::Tensor<double> > >&)
/opt/openfoam210/src/OpenFOAM/lnInclude/tensorField.H:79: note: Foam::tmp<Foam::Field<Foam::Vector<double> > > Foamperator/(const Foam::UList<Foam::Vector<double> >&, const Foam::tensor&)
/opt/openfoam210/src/OpenFOAM/lnInclude/tensorField.H:79: note: Foam::tmp<Foam::Field<Foam::Vector<double> > > Foamerator/(const Foam::tmp<Foam::Field<Foam::Vector<double> > >&, const Foam::tensor&)
/opt/openfoam210/src/OpenFOAM/lnInclude/diagTensorField.H:66: note: Foam::tmp<Foam::Field<Foam::Vector<double> > > Foamerator/(const Foam::UList<Foam::Vector<double> >&, const Foam::UList<Foam:iagTensor<double> >&)
/opt/openfoam210/src/OpenFOAM/lnInclude/diagTensorField.H:66: note: Foam::tmp<Foam::Field<Foam::Vector<double> > > Foamerator/(const Foam::UList<Foam::Vector<double> >&, const Foam::tmp<Foam::Field<Foam:iagTensor<double> > >&)
/opt/openfoam210/src/OpenFOAM/lnInclude/diagTensorField.H:66: note: Foam::tmp<Foam::Field<Foam::Vector<double> > > Foamerator/(const Foam::tmp<Foam::Field<Foam::Vector<double> > >&, const Foam::UList<Foam:iagTensor<double> >&)
/opt/openfoam210/src/OpenFOAM/lnInclude/diagTensorField.H:66: note: Foam::tmp<Foam::Field<Foam::Vector<double> > > Foamerator/(const Foam::tmp<Foam::Field<Foam::Vector<double> > >&, const Foam::tmp<Foam::Field<Foam:iagTensor<double> > >&)
/opt/openfoam210/src/OpenFOAM/lnInclude/diagTensorField.H:67: note: Foam::tmp<Foam::Field<Foam::Vector<double> > > Foamerator/(const Foam::vector&, const Foam::UList<Foam:iagTensor<double> >&)
/opt/openfoam210/src/OpenFOAM/lnInclude/diagTensorField.H:67: note: Foam::tmp<Foam::Field<Foam::Vector<double> > > Foamerator/(const Foam::vector&, const Foam::tmp<Foam::Field<Foam:iagTensor<double> > >&)
/opt/openfoam210/src/OpenFOAM/lnInclude/diagTensorField.H:67: note: Foam::tmp<Foam::Field<Foam::Vector<double> > > Foamerator/(const Foam::UList<Foam::Vector<double> >&, const Foam::diagTnsor&)
/opt/openfoam210/src/OpenFOAM/lnInclude/diagTensorField.H:67: note: Foam::tmp<Foam::Field<Foam::Vector<double> > > Foamerator/(const Foam::tmp<Foam::Field<Foam::Vector<double> > >&, const Foam::diagTensor&)
/opt/openfoam210/src/OpenFOAM/lnInclude/quaternionI.H:309: note: Foam::quaternion Foamerator/(const Foam::quaternion&, const Foam::quaternion&)
/opt/openfoam210/src/OpenFOAM/lnInclude/quaternionI.H:331: note: Foam::quaternion Foamerator/(const Foam::quaternion&, Foam::scalar)
/opt/openfoam210/src/OpenFOAM/lnInclude/septernionI.H:220: note: Foam::s epternion Foamerator/(const Foam::septernion&, const Foam::quaternion&)
/opt/openfoam210/src/OpenFOAM/lnInclude/septernionI.H:244: note: Foam::s epternion Foamerator/(const Foam::septernion&, const Foam::septernion&)
/opt/openfoam210/src/OpenFOAM/lnInclude/septernionI.H:266: note: Foam::s epternion Foamerator/(const Foam::s epternion&, Foam::scalar)
make: *** [Make/linuxGccDPOpt/nusseltCalcLaminar.o] Error 1
where is my problem?how can I debug it?
Attached Files
File Type: gz wallHeatFluxLaminar.tar.gz (71.5 KB, 10 views)
File Type: gz nusseltCalcLaminar.tar.gz (77.9 KB, 20 views)

Last edited by sajad6; November 1, 2014 at 15:14.
sajad6 is offline   Reply With Quote

Old   October 24, 2015, 16:14
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings sajad6,

I've had this post of yours on my to-do list almost a year and only today did I manage to take a look into this

The solution is/was simple:
  • You had defined in the file "readRefValues.H" this:
    Code:
    scalar k (readScalar(refValues.lookup("k")));
    Info << "Conductivity is:"<< k << endl;
  • The variable name "k" was in conflict with the one defined in the file "createFields.H":
    Code:
    dimensionedScalar k
    (
    transportProperties.lookup("k")
    );
  • The solution was to rename the one defined in "readRefValues.H":
    Code:
    scalar k2 (readScalar(refValues.lookup("k")));
    Info << "Conductivity is:"<< k2 << endl;
    Along with changing in the file "nusseltCalcLaminar.C" the respective entry:
    Code:
    patchHeatFlux[patchi]/((T_hot-T_initial)*k2);
Best regards,
Bruno
wyldckat is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Other] Contribution a new utility: refine wall layer mesh based on yPlus field lakeat OpenFOAM Community Contributions 58 December 23, 2021 02:36
[mesh manipulation] mirrorMesh utility preserving regions zfaraday OpenFOAM Meshing & Mesh Conversion 1 November 7, 2016 21:51
problem with sampling Utility in openFOAM 1.6 carmir OpenFOAM Post-Processing 10 February 26, 2014 02:00
How to compile a new utility rudy OpenFOAM 4 October 1, 2011 22:48
StreamFunction utility titio OpenFOAM Post-Processing 0 May 19, 2010 16:04


All times are GMT -4. The time now is 11:03.