CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   dieselFoam problem!! trying to introduce a new heat transfer model (https://www.cfd-online.com/Forums/openfoam-programming-development/77626-dieselfoam-problem-trying-introduce-new-heat-transfer-model.html)

 vivek070176 June 29, 2010 08:05

dieselFoam problem!! trying to introduce a new heat transfer model

Hey

I am trying to introduce a new heat transfer model in dieselFoam tutorial located in \$WM_PROJECT_USER_DIR/src/lagrangian/mydieselSpray/spraySubModels/heatTransferModel/
And in this newheatmodel , there is only one change with respect to RanzMarshall model that I want to calculate the nusselt number by using the formula

Nu = Nuo log (1+Bm)/Bm
where Bm is mass transport number calculated by Bm=(Xs-Xf)/(1-Xs)
and Nu0 is nusselt number as calculated in RanzMarshall.

So, now for this I have to introduce Xs and Xf in newheatmodel.C and newheatmodel.H. I have made the following changes to newheatmodel.C
scalar dieseheatmodel::relaxationTime
(
const scalar liquidDensity,
const scalar diameter,
const scalar liquidcL,
const scalar kappa,
const scalar ReynoldsNumber,
const scalar PrandtlNumber,
const scalar Xs,
const scalar Xf,
const scalar m0[i]
) const
{
scalar lgExpr = 0.0;
scalar Xratio = (Xs - Xf)/max(SMALL, 1.0 - Xs);

if (Xratio > 0.0)
{
lgExpr = log(1.0 + Xratio)/Xratio;
}

scalar time = liquidDensity*pow(diameter, 2.0)*liquidcL/(6.0*kappa*lgExpr*Nu(ReynoldsNumber, PrandtlNumber));

time = max(SMALL, time);

return time;

And the changes to newheatmodel.H are:-
scalar relaxationTime
(
const scalar liquidDensity,
const scalar diameter,
const scalar liquidcL,
const scalar kappa,
const scalar ReynoldsNumber,
const scalar PrandtlNumber,
const scalar Xs,
const scalar Xf,
const scalar m0[i]
)
Also I have made certain changes in heatTransferModel.H located in \$WM_PROJECT_USER_DIR/src/lagrangian/mydieselSpray/spraySubModels/heatTransferModel/heatTransferModel/
Virtual scalar relaxationTime
(
const scalar liquidDensity,
const scalar diameter,
const scalar liquidcL,
const scalar kappa,
const scalar ReynoldsNumber,
const scalar PrandtlNumber,
const scalar Xs,
const scalar Xf,
const scalar m0[i]
) const = 0;
And certain changes in setRelaxationTimes.C located in \$WM_PROJECT_USER_DIR/src/lagrangian/mydieselSpray/parcel/
And the changes near line 164 are:-
for(label i=0; i<Nf; i++)
{

tauHeatTransfer = sDB.heatTransfer().relaxationTime
(
liquidDensity,
d(),
liquidcL,
kMixture,
Reynolds,
Prandtl,
Xs[i],
Xf[i],
m0[i]
);
}

When I compiled mydieselSpray library , it properly compiled but when I run my case, it showed an error:-
cfd@linux-bw7o:~/OpenFOAM/cfd-1.6/run/decane_heatmodels/decane_6_diese> mpirun -
np 4 mydieselFoam -parallel > log &
[1] 20041
cfd@linux-bw7o:~/OpenFOAM/cfd-1.6/run/decane_heatmodels/decane_6_diese> [2] #0
Foam::error::printStack(Foam::Ostream&) in "/home/cfd/OpenFOAM/OpenFOAM-1.6/lib/
linux64GccDPOpt/libOpenFOAM.so"
[2] #1 Foam::sigFpe::sigFpeHandler(int) in "/home/cfd/OpenFOAM/OpenFOAM-1.6/lib /linux64GccDPOpt/libOpenFOAM.so"
[2] #2 ?? in "/lib64/libc.so.6"
[2] #3 Foam::dieseheatmodel::relaxationTime(double, double, double, double, dou ble, double, double, double) const in "/home/cfd/OpenFOAM/cfd-1.6/lib/linux64Gcc DPOpt/libmydieselSpray.so"
[2] #4 Uninterpreted:
[linux-bw7o:20047] *** Process received signal ***
[linux-bw7o:20047] Signal: Floating point exception (8)
[linux-bw7o:20047] Signal code: (-6)
[linux-bw7o:20047] [ 0] /lib64/libc.so.6 [0x2ba3a6f77bd0]
[linux-bw7o:20047] [ 1] /lib64/libc.so.6(gsignal+0x35) [0x2ba3a6f77b45]
[linux-bw7o:20047] [ 2] /lib64/libc.so.6 [0x2ba3a6f77bd0]
[linux-bw7o:20047] [ 3] /home/cfd/OpenFOAM/cfd-1.6/lib/linux64GccDPOpt/libmydies elSpray.so(_ZNK4Foam14dieseheatmodel14relaxationTi meEdddddddd+0x11b) [0x2ba3a5d3 26ab]
[linux-bw7o:20047] [ 4] [0x7fff07519410]
[linux-bw7o:20047] *** End of error message ***
--------------------------------------------------------------------------
mpirun noticed that process rank 2 with PID 20047 on node linux-bw7o exited on s ignal 8 (Floating point exception).
--------------------------------------------------------------------------
cfd@linux-bw7o:~/OpenFOAM/cfd-1.6/run/decane_heatmodels/decane_6_diese>
[1]+ Exit 136

Regards
Vivek Gupta

 niklas June 29, 2010 08:39

It looks like you didnt recompile dieselFoam

 vivek070176 June 29, 2010 10:16

Quote:
 Originally Posted by niklas (Post 264949) It looks like you didnt recompile dieselFoam
I HAVE PROPERLY RECOMPILED MY DieselFoam and done that again but it still doesnot work. The following is the recompilation of DieselFoam::::

cfd@linux-bw7o:~/OpenFOAM/cfd-1.6/applications/solvers/combustion/mydieselFoam> wmake
Making dependency list for source file dieselFoam.C
SOURCE=dieselFoam.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wno-strict-aliasing -We xtra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoReposito ry -ftemplate-depth-40 -I/home/cfd/OpenFOAM/OpenFOAM-1.6/src/../applications/sol vers/combustion/dieselEngineFoam -I/home/cfd/OpenFOAM/OpenFOAM-1.6/src/finiteVol ume/lnInclude -I/home/cfd/OpenFOAM/OpenFOAM-1.6/src/turbulenceModels/compressibl e/turbulenceModel -I/home/cfd/OpenFOAM/OpenFOAM-1.6/src/lagrangian/basic/lnInclu de -I/home/cfd/OpenFOAM/cfd-1.6/src/lagrangian/mydieselSpray/lnInclude -I/home/c fd/OpenFOAM/OpenFOAM-1.6/src/thermophysicalModels/liquids/lnInclude -I/home/cfd/ OpenFOAM/OpenFOAM-1.6/src/thermophysicalModels/liquidMixture/lnInclude -I/home/c fd/OpenFOAM/OpenFOAM-1.6/src/thermophysicalModels/specie/lnInclude -I/home/cfd/O penFOAM/OpenFOAM-1.6/src/thermophysicalModels/thermophysicalFunctions/lnInclude -I/home/cfd/OpenFOAM/OpenFOAM-1.6/src/thermophysicalModels/reactionThermo/lnIncl ude -I/home/cfd/OpenFOAM/OpenFOAM-1.6/src/thermophysicalModels/basic/lnInclude - I/home/cfd/OpenFOAM/OpenFOAM-1.6/src/thermophysicalModels/laminarFlameSpeed/lnIn clude -I/home/cfd/OpenFOAM/OpenFOAM-1.6/src/../applications/solvers/reactionTher mo/XiFoam -I/home/cfd/OpenFOAM/OpenFOAM-1.6/src/thermophysicalModels/chemistryMo del/lnInclude -I/home/cfd/OpenFOAM/OpenFOAM-1.6/src/ODE/lnInclude -IlnInclude -I . -I/home/cfd/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude -I/home/cfd/OpenFOAM/ OpenFOAM-1.6/src/OSspecific/POSIX/lnInclude -fPIC -c \$SOURCE -o Make/linux64Gc cDPOpt/dieselFoam.o
g++ -m64 -Dlinux64 -DWM_DP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-40 -I/home/cfd/OpenFOAM/OpenFOAM-1.6/src/../applications/solvers/combustion/dieselEngineFoam -I/home/cfd/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude -I/home/cfd/OpenFOAM/OpenFOAM-1.6/src/turbulenceModels/compressible/turbulenceModel -I/home/cfd/OpenFOAM/OpenFOAM-1.6/src/lagrangian/basic/lnInclude -I/home/cfd/OpenFOAM/cfd-1.6/src/lagrangian/mydieselSpray/lnInclude -I/home/cfd/OpenFOAM/OpenFOAM-1.6/src/thermophysicalModels/liquids/lnInclude -I/home/cfd/OpenFOAM/OpenFOAM-1.6/src/thermophysicalModels/liquidMixture/lnInclude -I/home/cfd/OpenFOAM/OpenFOAM-1.6/src/thermophysicalModels/specie/lnInclude -I/home/cfd/OpenFOAM/OpenFOAM-1.6/src/thermophysicalModels/thermophysicalFunctions/lnInclude -I/home/cfd/OpenFOAM/OpenFOAM-1.6/src/thermophysicalModels/reactionThermo/lnInclude -I/home/cfd/OpenFOAM/OpenFOAM-1.6/src/thermophysicalModels/basic/lnInclude -I/home/cfd/OpenFOAM/OpenFOAM-1.6/src/thermophysicalModels/laminarFlameSpeed/lnInclude -I/home/cfd/OpenFOAM/OpenFOAM-1.6/src/../applications/solvers/reactionThermo/XiFoam -I/home/cfd/OpenFOAM/OpenFOAM-1.6/src/thermophysicalModels/chemistryModel/lnInclude -I/home/cfd/OpenFOAM/OpenFOAM-1.6/src/ODE/lnInclude -IlnInclude -I. -I/home/cfd/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude -I/home/cfd/OpenFOAM/OpenFOAM-1.6/src/OSspecific/POSIX/lnInclude -fPIC Make/linux64GccDPOpt/dieselFoam.o -L/home/cfd/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt \
-lcompressibleRASModels -lcompressibleLESModels -lreactionThermophysicalModels -llagrangian -ldieselSpray -lliquids -lliquidMixture -lthermophysicalFunctions -lspecie -lbasicThermophysicalModels -llaminarFlameSpeedModels -lchemistryModel -lODE -lpdf -L/home/cfd/OpenFOAM/cfd-1.6/lib/linux64GccDPOpt -lmydieselSpray -lOpenFOAM -liberty -ldl -lm -o /home/cfd/OpenFOAM/cfd-1.6/applications/bin/linux64GccDPOpt/mydieselFoam

I THINK IT LOOKS FINE.....WHAT YoU THINK?....

Regards
Vivek Gupta

 niklas June 29, 2010 10:53

I THINK YOU SHOULD STOP USING CAPS!!!

... and then remove the dependency of -ldieselSpray for
dieselFoam in the Make/options-file.

It looks like you are picking up the original dieselSpray library.

 vivek070176 June 29, 2010 11:02

Respected niklas

Sorry for caps and yes i have tried after removing the dependency on dieselspray library and it still shoed the same error..Can you please help again??..

Vivek

 vivek070176 June 29, 2010 11:05

And when i try my case using RanzMarshall heat transfer model, it is working fine. But when i use newheatmodel, only then it shows the above error.

Regards
Vivek

 niklas June 29, 2010 13:20

Quote:
 Originally Posted by vivek070176 (Post 264989) Sorry for caps
Thank you,

Can you pack your dieselSpray-library and mail it to me at
niklas dot nordin at nequam at se

I cant figure out what the problem is from these posts.

N

 deji August 4, 2010 15:29

hey there niklas. i have been working on a post-processor to compute the mean nusselt number in a turbulent free convection flow over a vertical hot plate. i am gradually working my way through programming in OpenFOAM, and i am quite unable to find the cause of the bug that i am getting. it is a fairly short code, do you think you can look over the code for me? thanks

deji

 ron_OFuser August 23, 2014 06:45

Quote:
 Originally Posted by vivek070176 (Post 264944) Hey I am trying to introduce a new heat transfer model in dieselFoam tutorial located in \$WM_PROJECT_USER_DIR/src/lagrangian/mydieselSpray/spraySubModels/heatTransferModel/ And in this newheatmodel , there is only one change with respect to RanzMarshall model that I want to calculate the nusselt number by using the formula Nu = Nuo log (1+Bm)/Bm where Bm is mass transport number calculated by Bm=(Xs-Xf)/(1-Xs) and Nu0 is nusselt number as calculated in RanzMarshall. So, now for this I have to introduce Xs and Xf in newheatmodel.C and newheatmodel.H. I have made the following changes to newheatmodel.C scalar dieseheatmodel::relaxationTime ( const scalar liquidDensity, const scalar diameter, const scalar liquidcL, const scalar kappa, const scalar ReynoldsNumber, const scalar PrandtlNumber, const scalar Xs, const scalar Xf, const scalar m0[i] ) const { scalar lgExpr = 0.0; scalar Xratio = (Xs - Xf)/max(SMALL, 1.0 - Xs); if (Xratio > 0.0) { lgExpr = log(1.0 + Xratio)/Xratio; } scalar time = liquidDensity*pow(diameter, 2.0)*liquidcL/(6.0*kappa*lgExpr*Nu(ReynoldsNumber, PrandtlNumber)); time = max(SMALL, time); return time; And the changes to newheatmodel.H are:- scalar relaxationTime ( const scalar liquidDensity, const scalar diameter, const scalar liquidcL, const scalar kappa, const scalar ReynoldsNumber, const scalar PrandtlNumber, const scalar Xs, const scalar Xf, const scalar m0[i] ) Also I have made certain changes in heatTransferModel.H located in \$WM_PROJECT_USER_DIR/src/lagrangian/mydieselSpray/spraySubModels/heatTransferModel/heatTransferModel/ Virtual scalar relaxationTime ( const scalar liquidDensity, const scalar diameter, const scalar liquidcL, const scalar kappa, const scalar ReynoldsNumber, const scalar PrandtlNumber, const scalar Xs, const scalar Xf, const scalar m0[i] ) const = 0; And certain changes in setRelaxationTimes.C located in \$WM_PROJECT_USER_DIR/src/lagrangian/mydieselSpray/parcel/ And the changes near line 164 are:- for(label i=0; i mpirun - np 4 mydieselFoam -parallel > log & [1] 20041 cfd@linux-bw7o:~/OpenFOAM/cfd-1.6/run/decane_heatmodels/decane_6_diese> [2] #0 Foam::error::printStack(Foam::Ostream&) in "/home/cfd/OpenFOAM/OpenFOAM-1.6/lib/ linux64GccDPOpt/libOpenFOAM.so" [2] #1 Foam::sigFpe::sigFpeHandler(int) in "/home/cfd/OpenFOAM/OpenFOAM-1.6/lib /linux64GccDPOpt/libOpenFOAM.so" [2] #2 ?? in "/lib64/libc.so.6" [2] #3 Foam::dieseheatmodel::relaxationTime(double, double, double, double, dou ble, double, double, double) const in "/home/cfd/OpenFOAM/cfd-1.6/lib/linux64Gcc DPOpt/libmydieselSpray.so" [2] #4 Uninterpreted: [linux-bw7o:20047] *** Process received signal *** [linux-bw7o:20047] Signal: Floating point exception (8) [linux-bw7o:20047] Signal code: (-6) [linux-bw7o:20047] Failing at address: 0x3e800004e4f [linux-bw7o:20047] [ 0] /lib64/libc.so.6 [0x2ba3a6f77bd0] [linux-bw7o:20047] [ 1] /lib64/libc.so.6(gsignal+0x35) [0x2ba3a6f77b45] [linux-bw7o:20047] [ 2] /lib64/libc.so.6 [0x2ba3a6f77bd0] [linux-bw7o:20047] [ 3] /home/cfd/OpenFOAM/cfd-1.6/lib/linux64GccDPOpt/libmydies elSpray.so(_ZNK4Foam14dieseheatmodel14relaxationTi meEdddddddd+0x11b) [0x2ba3a5d3 26ab] [linux-bw7o:20047] [ 4] [0x7fff07519410] [linux-bw7o:20047] *** End of error message *** -------------------------------------------------------------------------- mpirun noticed that process rank 2 with PID 20047 on node linux-bw7o exited on s ignal 8 (Floating point exception). -------------------------------------------------------------------------- cfd@linux-bw7o:~/OpenFOAM/cfd-1.6/run/decane_heatmodels/decane_6_diese> [1]+ Exit 136 PLEASE SOMEBODY HELP ME. Regards Vivek Gupta
Hi Vivek,

I am interested in the work which you have reported in your post.
Do you have any reference for the same?

Thanks a million!!!

 ron_OFuser August 26, 2014 03:14

Any help will be a highly appreciated!!!

Looking forward to any further comment on my previous posting.

Thanks :)

 ron_OFuser December 24, 2014 00:48