CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   kivaTest tutorial-fault on temperature (engineFoam) (https://www.cfd-online.com/Forums/openfoam-solving/73308-kivatest-tutorial-fault-temperature-enginefoam.html)

ayhan515 March 4, 2010 06:51

kivaTest tutorial-fault on temperature (engineFoam)
 
Hi all!

I'm an openfoam beginner. I used kivaTest tutorial (OpenFoam-1,5-dev on Slax). without any modification.

in combustionProperties file "ignite yes;"
Pressure is not increase but temperature is increasing continuously.

http://i50.tinypic.com/sec61l.jpg
I think pressure should have increased to about ~60 -70 bar, temperature should have increased to ~2700-2900 K after TDC decrease again. So i cant find where is problem. Please inform me about what should i do for correct work.

Thanks for your help,
Best Regards.

apoorv121 October 12, 2013 13:23

Pressure Increase
 
Rescale the pressure in paraFoam, display mode.

kaveh19 August 21, 2015 16:20

hi
what's your T dictionary in boundary conditions?

kaveh19 August 21, 2015 16:25

kivaToFoam
 
hi everybody
1) I want to run the kivaTest by bore*stroke=76*66 in different compression ratio e.g.,12 and 20. How can i create this C.R ? I mean just by changing GoemetryDictionary I can't fix my favorite compression ratio?

ayhan515 August 21, 2015 17:34

hi kaveh19,
i suggest you should create new geometry and mesh for different CR. then check your mesh and engine compression ratio with checkMesh & engineCompRatio

http://oi60.tinypic.com/30muzo7.jpg

kaveh19 August 25, 2015 16:08

Dear ayhan515,
I have modified the below case by your guides:
bore=0.086
stroke=0.086
Fortunately I modified the compression ratio as same as I desired .I received ok for checkMesh .
Vmax = 0.00053768, Vmin = 3.83001e-05
Vmax/Vmin = 14.0386

************************************************** *
My geometry contains 2 cylinder ,one for Vmin and another for Vmax.
I have meshed the geometry in Gambite, but unfortunately I don’t know what boundary condition should I use fore jointed face between Vmin and Vmax volumes .
Some points:
1-wheater or not I consider it Gambite and openFoam will consider it as a wall so the wall appears it paraFoam as I expected .
2-In default case of kivaTest this wall condition doesn’t exist.
So when I want to run the test case .
What's your suggestion? Had you this problem?
Thanks in advance.

kaveh19 August 25, 2015 16:14

hi ayhan515,
unfortunately I don't know how i can upload in cfd online .Could you please give me your email in order to I send my test case by details?

ayhan515 August 26, 2015 08:27

Dear kaveh19,

1.1- create a geometry

just draw single cylinder (not 2 parts)
(for your CR=20 case) diameter: 76 mm height:69,473 mm

1.2-check z direction is height otherwise rotate your geometry.

1.3-rename the bottom surface as "piston"
rename the side surface as "liner"
rename the top surface as "cylinderHead"

2.create a CFD mesh from geometry and check named surfaces.

3.convert your mesh to Foam mesh.

https://yadi.sk/d/5OyB8MYJifqvu

sorry i've never used gambit i couldn't help.

i hope more professional helps come.

best regards.

Quote:

Originally Posted by kaveh19 (Post 561042)
Dear ayhan515,
I have modified the below case by your guides:
bore=0.086
stroke=0.086
Fortunately I modified the compression ratio as same as I desired .I received ok for checkMesh .
Vmax = 0.00053768, Vmin = 3.83001e-05
Vmax/Vmin = 14.0386

************************************************** *
My geometry contains 2 cylinder ,one for Vmin and another for Vmax.
I have meshed the geometry in Gambite, but unfortunately I don’t know what boundary condition should I use fore jointed face between Vmin and Vmax volumes .
Some points:
1-wheater or not I consider it Gambite and openFoam will consider it as a wall so the wall appears it paraFoam as I expected .
2-In default case of kivaTest this wall condition doesn’t exist.
So when I want to run the test case .
What's your suggestion? Had you this problem?
Thanks in advance.


kaveh19 August 28, 2015 14:51

Dear ayhan515,
I have modified the kivaTest for C.R=14. Fortunately I haven't problem with checkMesh,it is ok.In fact I have mentioned this post in other page ,too.
*************************
my engine geometry is:
engineMesh layered;

conRodLength conRodLength [ 0 1 0 0 0 0 0 ] 0.15449;

bore bore [ 0 1 0 0 0 0 0 ] 0.086;

stroke stroke [ 0 1 0 0 0 0 0 ] 0.086;

clearance clearance [ 0 1 0 0 0 0 0 ] 0.00115;

rpm rpm [ 0 0 -1 0 0 0 0 ] 1500;
*****************************
engineCompressioratio is:
engineMesh layered;

conRodLength conRodLength [ 0 1 0 0 0 0 0 ] 0.15449;

bore bore [ 0 1 0 0 0 0 0 ] 0.086;

stroke stroke [ 0 1 0 0 0 0 0 ] 0.086;

clearance clearance [ 0 1 0 0 0 0 0 ] 0.00115;

rpm rpm [ 0 0 -1 0 0 0 0 ] 1500;
****************************
engineCompressionratio is
Vmax = 0.00053768, Vmin = 3.83001e-05
Vmax/Vmin = 14.0386
*************************
the controlDict is:

application engineFoam;

startFrom latestTime;

startTime -180;

stopAt endTime;

endTime 30;

deltaT 0.05;

writeControl runTime;

writeInterval 5;

purgeWrite 0;

writeFormat ascii;

writePrecision 6;

writeCompression off;

timeFormat general;

timePrecision 6;

runTimeModifiable true;

adjustTimeStep true;

maxCo 0.2;

maxDeltaT 1;

functions
{
timeStep
{
type coded;
functionObjectLibs ("libutilityFunctionObjects.so");
redirectType setDeltaT;

code
#{
const Time& runTime = mesh().time();
if (runTime.timeToUserTime(runTime.value()) >= -15.0)
{
const_cast<Time&>(runTime).setDeltaT
(
runTime.userTimeToTime(0.025)
);
}
#};
}
}
**************************************
Other sittings are as same as the default kivaTest.
***************************************
I use mpirun -np 5 engineFoam -parallel >log
****************************************
but the run continues from -180 to -19.9968
*****************************************
my log file is:

Create engine time

Create mesh for time = -180

Selecting engineMesh layered
deckHeight: 0.086
piston position: 0
Reading combustion properties

[4] Found ignition cells:
[4] 1(15267)

Ignition switched off
Reading thermophysical properties

Selecting thermodynamics package
{
type heheuPsiThermo;
mixture inhomogeneousMixture;
transport sutherland;
thermo janaf;
equationOfState perfectGas;
specie specie;
energy absoluteEnthalpy;
}

min(b) = 1

Reading field U

Reading/calculating face flux field phi

Creating turbulence model

Selecting turbulence model type RASModel
Selecting RAS turbulence model kEpsilon
kEpsilonCoeffs
{
Cmu 0.09;
C1 1.44;
C2 1.92;
C3 -0.33;
sigmak 1;
sigmaEps 1.3;
Prt 1;
}
--> FOAM Warning :
From function janafThermo<EquationOfState>::limit(const scalar T) const
in file /home/openfoam/OpenFOAM/OpenFOAM-2.4.0/src/thermophysicalModels/specie/lnInclude/janafThermoI.H at line 108
attempt to use janafThermo<EquationOfState> out of temperature range 298.15 -> 5000; T = -5798.3 :(
--> FOAM Warning :
From function janafThermo<EquationOfState>::limit(const scalar T) const
in file /home/openfoam/OpenFOAM/OpenFOAM-2.4.0/src/thermophysicalModels/specie/lnInclude/janafThermoI.H at line 108
attempt to use janafThermo<EquationOfState> out of temperature range 298.15 -> 5000; T = -1720.57
.
and
.
.
.
--> FOAM Warning :
From function janafThermo<EquationOfState>::limit(const scalar T) const
in file /home/openfoam/OpenFOAM/OpenFOAM-2.4.0/src/thermophysicalModels/specie/lnInclude/janafThermoI.H at line 108
attempt to use janafThermo<EquationOfState> out of temperature range 298.15 -> 5000; T = -4512.94
DICPCG: Solving for p, Initial residual = 0.30828, Final residual = 4.00653e-18, No Iterations 1
DICPCG: Solving for p, Initial residual = 7.07815e-18, Final residual = 7.07815e-18, No Iterations 0
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 0.0996372, global = -0.0516891, cumulative = 3.35361e+06
DICPCG: Solving for p, Initial residual = 2.20533e-12, Final residual = 2.20533e-12, No Iterations 0
DICPCG: Solving for p, Initial residual = 2.20533e-12, Final residual = 2.20533e-12, No Iterations 0
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 31043.8, global = -0.0516891, cumulative = 3.35361e+06
DILUPBiCG: Solving for epsilon, Initial residual = 0.0415452, Final residual = 1.98579e-21, No Iterations 1
bounding epsilon, min: -1.78742e+63 max: 1.64625e+67 average: 4.90317e+63
DILUPBiCG: Solving for k, Initial residual = 0.996852, Final residual = 2851.55, No Iterations 1001
bounding k, min: -1.33881e+77 max: 6.24989e+75 average: -1.807e+73
Mean pressure:-1.21196e+16 :(
Mean temperature:985.341
Mean u':8.03304e+34
ExecutionTime = 392.13 s ClockTime = 397 s

Courant Number mean: 0.727501 max: 8250.86
deltaT = 1.78964e-28
--> FOAM Warning :
From function Time:perator++()
in file db/Time/Time.C at line 1061
Increased the timePrecision from 11 to 12 to distinguish between timeNames at time -0.0019149
Crank angle = -17.2341 CA-deg
deltaZ = 0
clearance: 0.00245679
Piston speed = 0 m/s
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
PIMPLE: iteration 1
*************************************************
Do you have any idea?
thanks in advanc

ayhan515 August 28, 2015 16:42

Dear kaveh19
my suggestion is decreasing of deltaT

for example

startTime -20;

stopAt endTime;

endTime 30;

deltaT 0.005; //instead 0.05

writeControl runTime;

writeInterval 1;//instead 5


best regards.

kaveh19 August 31, 2015 08:46

Dear ayhan515,
I really appreciate you for your mentions.
******************************************
I want to change the fuel of kivaTest to gasoline . Would you mind telling me how i should start?
In combustionProperties :
fuel IsoOctane; says that fuel is Isooctane , but
GuldersCoeffs
{
Methane
{
W 0.422;
eta 0.15;
xi 5.18;
alpha 2;
beta -0.5;
f 2.3;
}

Propane
{
W 0.446;
eta 0.12;
xi 4.95;
alpha 1.77;
beta -0.2;
f 2.3;
}

IsoOctane
{
W 0.4658;
eta -0.326;
xi 4.48;
alpha 1.56;
beta -0.22;
f 2.3;
}
} specify some weird coefficient ,of course for me :), for Methane ,Propane,and Isooctane.
In thermophysicalProperties;
thermodynamics
{
Tlow 298.15;
Thigh 5000;
Tcommon 1000;
highCpCoeffs ( 19.3963 0.0488137 -1.55798e-05 2.17831e-09 -1.08391e-13 -37133.9 -78.8531 );
lowCpCoeffs ( 0.429357 0.0765769 8.41306e-06 -5.86603e-08 2.79414e-11 -30446.4 25.6735 );
}
transport
{
As 1.67212e-06;
Ts 170.672;
} are really unfamiliar for me.
Thanks in advance.

ayhan515 August 31, 2015 09:33

Dear kaveh19
i am not an expert and i am also asking questions to professionals to learn something.

if you want to use gasoline you can use isooctane there is no need to change fuel for kivaTest case.

if you want use to a different species or mixture
in my opinion you need
  • Gulders coefficients for laminar flame speed or implement different model for laminar flame speed and,
    coefficients for
  • thermophysical and
  • transport properties

if you have thermo files in chemkin format you can use chemkinToFoam command to get coefficients for thermophysical and transport properties

sorry i haven't used that case with different fuel so i couldn't help.
i hope more professional helps come.


if you use gasoline with 14.0386 compression ratio at SI engine it would be knock.

if you want to use at HCCI conditions then you should check sprayFoam & sprayEngineFoam.

best regards.

kaveh19 August 31, 2015 16:16

hello ayhan515,
you are right Isooctane has a good harmony with gasoline but If I want to simulate a HCCI case, I can't use kivaTest and should change my solver to sprayEngineFoam?
sorry for bothering you.
bet regards.

ayhan515 August 31, 2015 18:41

Quote:

Originally Posted by kaveh19 (Post 561832)
hello ayhan515,
you are right Isooctane has a good harmony with gasoline but If I want to simulate a HCCI case, I can't use kivaTest and should change my solver to sprayEngineFoam?
sorry for bothering you.
bet regards.

For HCCI
Just use kivaTest and engineFoam is not sufficient because ignition starts with your control at that case.
HCCI ignition starts with high temperature like diesel engines.
and need to solve many chemical reactions for combustion.
firstly you need to combine
kivaTest (engineFoam) and aachenBomb (sprayFoam) cases and create a new case for sprayEngineFoam and if you define fuel and air species at initial condition you don't have to deal with solving spray that case.

and you can use more detailed reaction mechanisms for HCCI combustion instead of single reaction so your results would be more satisfying and accurate at least in this respect.

best regards.

kaveh19 September 7, 2015 06:46

Dear ayhan515,
I have run a kivaTest by the below characteristics:
controlDict is:
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.4.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict.1st;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application engineFoam;

startFrom latestTime;

startTime -180;

stopAt endTime;

endTime 30;

deltaT 1e-5;>>>>>>>>>>I changed from 1e-5 to 1e-25

writeControl runTime;

writeInterval 1;

purgeWrite 0;

writeFormat ascii;

writePrecision 6;

writeCompression off;

timeFormat general;

timePrecision 6;

runTimeModifiable true;

adjustTimeStep true;

maxCo 0.2;

maxDeltaT 1;

functions
{
timeStep
{
type coded;
functionObjectLibs ("libutilityFunctionObjects.so");
redirectType setDeltaT;

code
#{
const Time& runTime = mesh().time();
if (runTime.timeToUserTime(runTime.value()) >= -15.0)
{
const_cast<Time&>(runTime).setDeltaT
(
runTime.userTimeToTime(0.025)
);
}
#};
}
}

// ************************************************** *********************** //
Log dictionary contains:
.
.
.
.
Courant Number mean: 1388.37 max: 1.04297e+10
deltaT = 5.32668e-17
Crank angle = -2.58142 CA-deg
deltaZ = 5.55112e-17
clearance: 5.57749e-05
Piston speed = 1.04213 m/s
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
DILUPBiCG: Solving for Ux, Initial residual = 3.43196e-07, Final residual = 3.43196e-07, No Iterations 0
DILUPBiCG: Solving for Uy, Initial residual = 5.73945e-07, Final residual = 5.73945e-07, No Iterations 0
DILUPBiCG: Solving for Uz, Initial residual = 1.7391e-06, Final residual = 1.7391e-06, No Iterations 0
DILUPBiCG: Solving for ft, Initial residual = 1.94301e-05, Final residual = 6.8055e-12, No Iterations 1
DILUPBiCG: Solving for ha, Initial residual = 7.60684e-06, Final residual = 7.60684e-06, No Iterations 0
DICPCG: Solving for p, Initial residual = 1.5609e-07, Final residual = 1.5609e-07, No Iterations 0
DICPCG: Solving for p, Initial residual = 1.5609e-07, Final residual = 1.5609e-07, No Iterations 0
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 2.543e-10, global = 9.48277e-15, cumulative = 0.000726909
DICPCG: Solving for p, Initial residual = 1.5609e-07, Final residual = 1.5609e-07, No Iterations 0
DICPCG: Solving for p, Initial residual = 1.5609e-07, Final residual = 1.5609e-07, No Iterations 0
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 2.543e-10, global = 9.48277e-15, cumulative = 0.000726909
DILUPBiCG: Solving for epsilon, Initial residual = 2.87218e-07, Final residual = 2.87218e-07, No Iterations 0
DILUPBiCG: Solving for k, Initial residual = 6.01877e-08, Final residual = 6.01877e-08, No Iterations 0
Mean pressure:3.09589e+06
Mean temperature:831.055
Mean u':1.50482
ExecutionTime = 51054.1 s ClockTime = 51460 s
Courant Number mean: 1388.39 max: 1.04298e+10
deltaT = 5.32662e-17
Crank angle = -2.58142 CA-deg
deltaZ = 0
clearance: 5.57749e-05
Piston speed = 0 m/s
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
DILUPBiCG: Solving for Ux, Initial residual = 3.43199e-07, Final residual = 3.43199e-07, No Iterations 0
DILUPBiCG: Solving for Uy, Initial residual = 5.73949e-07, Final residual = 5.73949e-07, No Iterations 0
DILUPBiCG: Solving for Uz, Initial residual = 1.7391e-06, Final residual = 1.7391e-06, No Iterations 0
DILUPBiCG: Solving for ft, Initial residual = 1.88412e-05, Final residual = 2.40726e-16, No Iterations 1
DILUPBiCG: Solving for ha, Initial residual = 7.60696e-06, Final residual = 7.60696e-06, No Iterations 0
DICPCG: Solving for p, Initial residual = 1.56067e-07, Final residual = 1.56067e-07, No Iterations 0
DICPCG: Solving for p, Initial residual = 1.56067e-07, Final residual = 1.56067e-07, No Iterations 0
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 2.54263e-10, global = -1.1419e-18, cumulative = 0.000726909
DICPCG: Solving for p, Initial residual = 1.56067e-07, Final residual = 1.56067e-07, No Iterations 0
DICPCG: Solving for p, Initial residual = 1.56067e-07, Final residual = 1.56067e-07, No Iterations 0
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 2.54263e-10, global = -1.14197e-18, cumulative = 0.000726909
DILUPBiCG: Solving for epsilon, Initial residual = 2.87215e-07, Final residual = 2.87215e-07, No Iterations 0
DILUPBiCG: Solving for k, Initial residual = 6.0187e-08, Final residual = 6.0187e-08, No Iterations 0
Mean pressure:3.09589e+06
Mean temperature:831.055
Mean u':1.50482
ExecutionTime = 51054.6 s ClockTime = 51461 s
**********************************************
It is about 24 hours that O.F has challenged with Crank angle = -2.58142 CA-deg :(
Do you have any idea to help me?
Thanks in advance.

ayhan515 September 7, 2015 07:10

Code:

deltaT          1e-5;>>>>>>>>>>I changed from 1e-5 to 1e-25
deltaT is too small.

Courant Number mean: 1388.37 max: 1.04297e+10 is unacceptable I think that problem is related your mesh.
I suggest check your mesh quality.

i hope more professional helps come.

best regards

Code:

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.4.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict.1st;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application engineFoam;

startFrom latestTime;

startTime -180;

stopAt endTime;

endTime -25;

deltaT 0.05;

writeControl runTime;

writeInterval 5;

then change your controlDict file as


Code:

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.4.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict.1st;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application engineFoam;

startFrom latestTime;

startTime -25;

stopAt endTime;

endTime 30;

deltaT 0.005;//if it is not enough cut in half 0.0025, 0.00125,etc...

writeControl runTime;

writeInterval 1;


kaveh19 September 9, 2015 09:19

Dear ayhan515,
Do you know how O.F in kivaTest can calculate the value of Heat released ?
Do you think that it is a correct suppose to consider a constant temperature for piston,line, and cylindeHead during the engine's work? These temperature values are their maximum ,am I right?
Thanks in advance.


All times are GMT -4. The time now is 17:40.