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

compressible solver for engine simulations

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 3, 2011, 14:17
Default compressible solver for engine simulations
  #1
Senior Member
 
Join Date: Oct 2009
Posts: 140
Rep Power: 17
Peter_600 is on a distinguished road
Hello Foamers

I ve a problem with a compressible solver for mesh motion and topological changes. Basically, it is the dieselEngineFoam solver with some minor modifications. I would like to use with this solver the engineTopoChangerMesh classes. So far it runs, but only when i comment out the turbulent time scale, part for the combustion model. Since I do not have a lot of experiences with this kind of solver, i would appreciate if some of you could have a look on it. The spray seems to work.
I can upload the solver if you are interested. I have a version for 1.5-dev and 1.6-ext.

Quote:
int main(int argc, char *argv[])
{

# include "setRootCase.H"

# include "createEngineTime.H"
# include "createEngineDynamicMesh.H"
# include "readPISOControls.H"

# include "createFields.H"
# include "readEnvironmentalProperties.H"
# include "readCombustionProperties.H"
# include "createSpray.H"
# include "initContinuityErrs.H"
# include "readEngineTimeControls.H"
# include "compressibleCourantNo.H"
# include "setInitialDeltaT.H"
# include "startSummary.H"
# include "createEngineOutput.H"

# include "createSets.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

thermo->correct();

Info << "\nStarting time loop\n" << endl;

while (runTime.run())
{
# include "readPISOControls.H"
# include "readEngineTimeControls.H"
# include "compressibleCourantNo.H"
# include "setDeltaT.H"

runTime++;

Info<< "Crank angle = " << runTime.theta() << " CA-deg" << endl;

phi += meshFlux;

bool meshChanged = mesh.update();
vpi.updateMesh();
mesh.setBoundaryVelocity(U);

forAll(p.boundaryField(), patchI)
{
p.boundaryField()[patchI].evaluate();
}

if(meshChanged)
{
Info << "meshChanged" << endl;
thermo->correct();
}

dieselSpray.evolve();

Info << "Solving chemistry" << endl;
chemistry.solve
(
runTime.value() - runTime.deltaT().value(),
runTime.deltaT().value()
);

//thermo->correct();
//thermo-> rho();

// turbulent time scale
/*{
volScalarField tk =
Cmix*sqrt(turbulence->muEff()/rho/turbulence->epsilon());
volScalarField tc = chemistry.tc();
//Chalmers PaSR model
kappa = (runTime.deltaT() + tc)/(runTime.deltaT() + tc + tk);
}
*/

meshFlux = fvc::interpolate(rho) * fvc::meshPhi(rho, U);

Info << "meshFlux" << endl;

phi -= meshFlux;

Info << "phi-=" << endl;

phi = fvc::interpolate(rho)
*((fvc::interpolate(U) & mesh.Sf()) - fvc::meshPhi(rho, U));

Info << "phi = fvc::interpolate(rho)" << endl;


# include "rhoEqn.H"
# include "UEqn.H"

for (label ocorr=1; ocorr <= nOuterCorr; ocorr++)
{
# include "YEqn.H"
# include "hEqn.H"

// --- PISO loop
for (int corr=1; corr<=nCorr; corr++)
{
# include "pEqn.H"
}
}

turbulence->correct();

# include "logSummary.H"
# include "spraySummary.H"
rho = thermo->rho();

runTime.write();

# include "infoDataOutput.H"
# include "writeOutputSets.H"

Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
}

Info<< "End\n" << endl;

return(0);
}
Best regards
Peter
Peter_600 is offline   Reply With Quote

Old   May 17, 2011, 06:40
Default
  #2
Member
 
Join Date: Nov 2010
Posts: 86
Rep Power: 16
abminternet is on a distinguished road
Hi Peter,

I got engine simulation working with turbulence model but using sonicTurbDyMEngineFoam, and the simpleEngineFvMesh class, I think u already have the example maybe it would be easier to adapt that software.

I have a question for you, I also want to use the engineTopoChanger class, Im using verticalValves, but still don't know what the valveHeadPatch entry in engineGeometry stands for. What patch is it? I tried to set it to "none" or "empty", but what happens is that the cylinderHead part just above the valves moves down together with the valves!! :S Any ideas?? Would appreciate it
abminternet is offline   Reply With Quote

Old   May 17, 2011, 07:46
Default
  #3
Senior Member
 
Join Date: Oct 2009
Posts: 140
Rep Power: 17
Peter_600 is on a distinguished road
Hi,

yes I got it Thx again a lot for it.

I suppose the valveHeadPatch will be the upper part of your valve. Basically, you can split your valve in a bottom part, an upper part and the stem. Try to create different patches for your valve. I can imagine, since you don t specify any valveHeadpatch, the solver takes all upper cells as ValveHeadPatches and move them with the same speed as the valve.
How many patches do you have for one valve?

Best reagards
Peter
Peter_600 is offline   Reply With Quote

Old   May 17, 2011, 08:09
Default
  #4
Member
 
Join Date: Nov 2010
Posts: 86
Rep Power: 16
abminternet is on a distinguished road
No prob well the thing is that in engineGeometry it must also be specified a bottomPatch and poppetPatch for the valve, so I have this two patches for one valve, and I thought the poppetPatch was the top part of the valve, I'm quite confused now, so if I set the valveHeadPatch to the upper part of the valve, then what should the poppetPatch be?
abminternet is offline   Reply With Quote

Old   May 19, 2011, 10:57
Default
  #5
New Member
 
Arun
Join Date: Mar 2009
Posts: 25
Rep Power: 17
arun is on a distinguished road
Hi,

Just wondering have you tried changing the kappa to be unity which increases the stability of the solution by assuming the reactor perfectly mixed (PSR)?

I am not sure will this solve the problem or not but you can try.

You can do this just by assigning the value as shown below:

{
//volScalarField tk =
//Cmix*sqrt(turbulence->muEff()/rho/turbulence->epsilon());
//volScalarField tc = chemistry.tc();
//Chalmers PaSR model
//kappa = (runTime.deltaT() + tc)/(runTime.deltaT() + tc + tk);

kappa = 1.0;
}

Regards
A
arun is offline   Reply With Quote

Old   May 20, 2011, 04:42
Default
  #6
Senior Member
 
Join Date: Oct 2009
Posts: 140
Rep Power: 17
Peter_600 is on a distinguished road
Hi arun,

thank you for the hint. I will try it.

Regards
peter
Peter_600 is offline   Reply With Quote

Old   June 9, 2011, 14:40
Default
  #7
Member
 
Walter Schostak
Join Date: May 2011
Posts: 35
Rep Power: 15
wschosta is on a distinguished road
Where can I find where
Quote:
turbulence->correct();
is referring to? I'm working on a different solver and it crashes every time it enters this segment of code. I think it's dividing by zero somewhere but I can't seem to find the function this line is referring to.

Any help is much appreciated,

Walter
wschosta 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
Creating New Solver: For particle-laden compressible jets sankarv OpenFOAM Running, Solving & CFD 17 December 3, 2014 20:41
Some results with a new compressible flow solver luca_g OpenFOAM Running, Solving & CFD 5 June 30, 2013 11:35
compressible solver with moving mesh Peter_600 OpenFOAM 1 July 12, 2011 16:39
Creating New Solver: For particle-laden compressible jets sankarv OpenFOAM 0 April 4, 2010 19:06
Can segregated solver be used for compressible flow? Steven-GY ANSYS 0 May 14, 2009 11:37


All times are GMT -4. The time now is 21:00.