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

engine simulation with mesh motion and topological changes

Register Blogs Community New Posts Updated Threads Search

Like Tree6Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 22, 2011, 12:42
Default
  #41
Member
 
Join Date: Nov 2010
Posts: 86
Rep Power: 16
abminternet is on a distinguished road
Hi Peter,

Is the solver you used compressible or incompressible? Is it for laminar or turbulent flow? Did you obtain accurate results? I am trying to use the compressible solver but it still won't work. Why don't you use the solvers provided in the extend version? I am not sure about the 1.5-ext version, but in the 1.6-ext there are solvers for turbulent and laminar flow, also compressible and incompressible, all with mesh motion and topological changes for ic-engines. Well here is a sample of my case, I ran it first with an incompressible solver, icoDyMEngineFoam, and got it working, but the results didn't seem to logical (I am trying to do a cold flow simulation). But this case is a compressible one with turbulence, ran with sonicTurbDyMEngineFoam, had to change the turbulence model to kOmegaSST because kEpsilon kept giving problems, perhaps you also have a suggestion there. Now I am stuck with this temperature error, looks like it diverges, can't get past the first iteration. Any Advice??

I posted the file in your ic-engine group in the extend-project community, since it was not small enough to fit here. the link is:

http://www.extend-project.de/compone...ble-solver#163

best regards
abminternet is offline   Reply With Quote

Old   February 24, 2011, 07:30
Default
  #42
Senior Member
 
Join Date: Oct 2009
Posts: 140
Rep Power: 17
Peter_600 is on a distinguished road
Sorry, I didn t read your post herer. Indeed it is strange.
I ve encountered difficulties in 1.6-ext with dieselFOAM and attachdetach meshmodifiers. My solver wont run with 1.6-ext.
So far I succeed in doing the meshmotion class I ve spoken about. If you are interested let me know.
Furthermore, I am about writting dieselEngineDyMFoam for 1.5-dev. It works but without valve closure (attachdetach approach) .
I think I need to update the boundary conditions arter introducing the attachdetach faces.
Any ideas?

To your problem, try to downgrade to 1.5-dev, if you do not have 1.5-dev, I can test it for you.
Peter
Peter_600 is offline   Reply With Quote

Old   February 24, 2011, 12:58
Default
  #43
Member
 
Join Date: Nov 2010
Posts: 86
Rep Power: 16
abminternet is on a distinguished road
Hi Peter,

yeah I would appreciate it if you could try it with 1.5-dev. Maybe u can send me your code, let's see if I can catch the bug with the attachDettach by lookin at it
abminternet is offline   Reply With Quote

Old   February 26, 2011, 19:25
Default
  #44
Senior Member
 
Join Date: Oct 2009
Posts: 140
Rep Power: 17
Peter_600 is on a distinguished road
Hi

I checked your case with 1.5-dev (without a turbulence model, laminar) and it worked.

Peter
Peter_600 is offline   Reply With Quote

Old   February 26, 2011, 19:56
Default
  #45
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33
hjasak will become famous soon enough
Hi Peter,

Sorry, I thought I've answered this, but it seems the response did not go through. I have fixed this in the preparation of the next release, but there is a bug in 1.6-ext that is causing you trouble.

It is to do with the state of turbulence on newly created patches after detach, where I have no data to map from.

Here is a quick fix for you:
- go to the turbulence model you are using (I assume compressible k-e)
- look for the beginning of the ::correct() function in kEpsilon.C
- add the following two lines at the very beginning:

k_.correctBoundaryConditions();
epsilon_.correctBoundaryConditions();

- recompile.

Please let me know if it works.

Apologies for the trouble,

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   February 27, 2011, 07:52
Default
  #46
Senior Member
 
Join Date: Oct 2009
Posts: 140
Rep Power: 17
Peter_600 is on a distinguished road
Hi Mr. Jasak

Thank you very much for your reply. I ve added your lines in the turbulence model I am using. Your suggest was right with the compressible kepsilon model.

Quote:
void kEpsilon::correct()

{
k_.correctBoundaryConditions(); -> added
epsilon_.correctBoundaryConditions(); -> added
if (!turbulence_)
{
// Re-calculate viscosity
mut_ = rho_*Cmu_*sqr(k_)/(epsilon_ + epsilonSmall_);
mut_.correctBoundaryConditions();

// Re-calculate thermal diffusivity
alphat_ = mut_/Prt_;
alphat_.correctBoundaryConditions();
...
...
...
After recompiling the turbulence libraries and rerunning my case the following message appeared just when the turbulence->correct() line is called in my solver.

Quote:
--> FOAM FATAL ERROR:

request for volScalarField RASModel::G from objectRegistry region0 failed
available objects of type volScalarField are

27
(
divPhi
psi
DpDt
b
Xi
hu
h
rho
ft_0
k
h_0
psi_0
alphat
alpha
ddt(p)
rho_0
p
T
Tu
p_0
mut
mu
St
Su
epsilon
rUA
ft
)


From function objectRegistry::lookupObject<Type>(const word&) const
in file /home/peter/OpenFOAM/OpenFOAM-1.6-ext/src/OpenFOAM/lnInclude/objectRegistryTemplates.C at line 140.

FOAM aborting
Any suggestions?

Thanks in advance
Peter
Peter_600 is offline   Reply With Quote

Old   February 28, 2011, 18:44
Default
  #47
Senior Member
 
Join Date: Oct 2009
Posts: 140
Rep Power: 17
Peter_600 is on a distinguished road
I had a problem with my boundary conditions. I disabled all the wall functions.
Works now.
Thank you very much again.
Peter
Peter_600 is offline   Reply With Quote

Old   March 1, 2011, 10:27
Default
  #48
Member
 
Join Date: Nov 2010
Posts: 86
Rep Power: 16
abminternet is on a distinguished road
Hi Peter,

Thanks for testing it. It worked with laminar solver in 1.6-ext too, but only up to 217 CAD :S. With turbulence model kOmega SST it gave some error when calculating temperature T, and kEpsilon didn't work, so I am going to make the changes proposed by Prof. Jasak and see what happens. Also, did the results you got look reasonable in this case or any of the others you have run? In my case, pressure is not changing!! So of course velocity doesn't change either, which is not very good because I am interesting in the cold flow... I will keep you posted of what happens
abminternet is offline   Reply With Quote

Old   March 7, 2011, 23:07
Default
  #49
New Member
 
Josiah Xu
Join Date: Jan 2010
Posts: 8
Rep Power: 16
faithhidy is on a distinguished road
Quote:
Originally Posted by Peter_600 View Post
I had a problem with my boundary conditions. I disabled all the wall functions.
Works now.
Thank you very much again.
Peter

Hi Peter,

How did you disable your wall functions? Change them into "fixedValue" or ...?
I try the "fixedValue" BC for k and epsilon,but the janafError still exist. (I have added the two sentences which were provided by Prof. Jasak)

Thank you!

Josiah

Last edited by faithhidy; March 8, 2011 at 02:04.
faithhidy is offline   Reply With Quote

Old   March 10, 2011, 12:43
Default
  #50
Senior Member
 
Join Date: Oct 2009
Posts: 140
Rep Power: 17
Peter_600 is on a distinguished road
Hi Josia

I ve put everywhere zeroGradient.

Peter
Peter_600 is offline   Reply With Quote

Old   March 15, 2011, 05:43
Default
  #51
Member
 
Join Date: Nov 2010
Posts: 86
Rep Power: 16
abminternet is on a distinguished road
Hi Peter,

have you found a way to run the simulation without having to set zeroGradient all over after doing Prof. Jasak's modifications to kEpsilon and/or kOmegaSST ? I did the modifications on both, and I get the same error as you, it looks like the only way to get it to run is to set zeroGradient to all walls.
abminternet is offline   Reply With Quote

Old   March 15, 2011, 17:35
Default
  #52
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33
hjasak will become famous soon enough
Hi Guys,

I just did a full day's work with a client doing internal combustion engines simulations in parallel with OpenFOAM and it all works fine. Can I please have one of the cases that is causing problem, because we've got the old gem: "it all works for me!"

The case would be used to debug the problem and I am happy to delete if afterwards if you have concerns about sharing it further.

I guess you know how to contact me - a Dropbox or similar file transfer would be best.

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   March 16, 2011, 06:42
Default
  #53
Member
 
Join Date: Nov 2010
Posts: 86
Rep Power: 16
abminternet is on a distinguished road
Hello Prof. Jasak,

I have put together a copy of the simpleEngine case I am working with for you. So far, I think Everything works until I include the turbulence modeling. You can find the case under:
http://cid-7756d13637c02835.office.l...mpleEngine.tar

abm
abminternet is offline   Reply With Quote

Old   March 16, 2011, 07:44
Default
  #54
Member
 
Join Date: Nov 2010
Posts: 86
Rep Power: 16
abminternet is on a distinguished road
By the way, I am using OpenFOAM-1.6-ext, and the solver is sonicTurbDyMEngineFoam, I also tried the changes you suggested above to kEpsilon.C (kOmegaSST ran the same way with or without the changes, it crashed after a few iterations)

Best regards
abminternet is offline   Reply With Quote

Old   March 17, 2011, 02:21
Default
  #55
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33
hjasak will become famous soon enough
Got it, thank you - I will keep you posted.

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   March 22, 2011, 09:50
Default
  #56
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33
hjasak will become famous soon enough
Hello again. I have fixed the problem and the two files you need are attached. I have also done a bit of clean-up in other parts of the library, but that will wait for the merge.

BTW, the case you gave me looks distinctly like someone playing with one of my old cases from ~2004 but it is really badly set up, with poor choice of discretisation schemes and boundary conditions. In any case, it works now...

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   March 22, 2011, 09:53
Default
  #57
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33
hjasak will become famous soon enough
Missing attachments? Second attempt (apologies).

Hrv
Attached Files
File Type: c epsilonWallFunctionFvPatchScalarField.C (8.1 KB, 65 views)
File Type: c omegaWallFunctionFvPatchScalarField.C (8.2 KB, 49 views)
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   March 23, 2011, 05:35
Default
  #58
Member
 
Join Date: Jun 2010
Posts: 33
Rep Power: 16
RalphS is on a distinguished road
Hello abm,

Thanks for your case. I have studied it.
First i run "moveDyMEngineMesh" to simulate and understand the mesh motion.
But the case didn't run to the end.

Regards,
Ralph


Time = 730
DICPCG: Solving for motionUx, Initial residual = 0, Final residual = 0, No Iterations 0
DICPCG: Solving for motionUz, Initial residual = 0.328438, Final residual = 6.0442e-11, No Iterations 13
DICPCG: Solving for motionUx, Initial residual = 0, Final residual = 0, No Iterations 0
DICPCG: Solving for motionUz, Initial residual = 4.00401e-11, Final residual = 4.00401e-11, No Iterations 0
Volume: new = 1.0007e-05 old = 9.99292e-06 change = 1.40833e-08
Motion continuity errors : sum local = 2.78751e-16, maximum = 9.5838e-15
ExecutionTime = 979.19 s ClockTime = 989 s
Time = 730.2

--> FOAM FATAL ERROR:
Face 2970 contains vertex labels out of range: 4(-1 -1 3917 3938) Max point index = 4048
From function polyMesh:olyMesh::resetPrimitives
(
const Xfer<pointField>& points,
const Xfer<faceList>& faces,
const Xfer<labelList>& owner,
const Xfer<labelList>& neighbour,
const labelList& patchSizes,
const labelList& patchStarts
)
in file meshes/polyMesh/polyMesh.C at line 757.
FOAM aborting
RalphS is offline   Reply With Quote

Old   March 23, 2011, 05:46
Default
  #59
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33
hjasak will become famous soon enough
Yes - as I said, the case is badly set up. Go to the last time you have available and you will see that the layer addition/removal interface on the piston has ruined the last mesh layer - compare that with the mesh at the beginning and you will see what happened.

To fix this, you need to either adjust the stroke OR change the min and max layer thickness in the mesh modifier.

As a matter of fact, I got worried about this 2 days ago before I saw the error in setup, but this is all it is: poor setup. The code is correct and has been re-checked by the author (= me!)

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   March 23, 2011, 11:20
Default
  #60
Member
 
Join Date: Nov 2010
Posts: 86
Rep Power: 16
abminternet is on a distinguished road
Hi Prof. Jasak,

Thanks for the fix. kEpsilon works now, although it stops at around 430 CAD (as soon as the exhaust valve opens). But as you mention, I still need to set up the case correctly so hopefully that will get the case running smoothly . With the kOmegaSST model the simulation fails at the first iteration :S. In debug mode, the error is:

Program received signal SIGSEGV, Segmentation fault.
0x00002b3a7a460dfa in Foam::fvPatchField<double>::db (this=0x163b0190) at /home/albertom/software/OpenFOAM/OpenFOAM-1.6-ext/src/finiteVolume/lnInclude/fvPatchField.C:160
160 return patch_.boundaryMesh().mesh();

@RalphS:
Indeed the case definitely does not have the best setup. I took this case from the internetnet, it came with a solver called icoDyMFoamEngine, which doesn't work in the current version of OpenFOAM any more. So many of the setup comes from that case, and for now I am trying to make it work with the current version of OpenFOAM ext, and with a compressible solver and turbulence modeling as well Also my experience is a bit limited, but as soon as I get to optimize the case, I guess that will change
In the meantime, any suggestions will be very helpful, I am still new to ICE simulation.
abminternet 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


LinkBacks (?)
LinkBack to this Thread: https://www.cfd-online.com/Forums/openfoam-solving/83177-engine-simulation-mesh-motion-topological-changes.html
Posted By For Type Date
Untitled document This thread Refback February 4, 2014 12:36

Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic moving mesh Pei-Ying Hsieh (Hsieh) OpenFOAM Running, Solving & CFD 64 June 7, 2012 11:04
engine simulation with mesh motion and topological changes abminternet OpenFOAM 0 December 16, 2010 12:47
[Commercial meshers] Good mesh for pistoncylinder application Serkan Cetin OpenFOAM Meshing & Mesh Conversion 4 November 3, 2010 08:36
Radiation and miscellaneous enhancements vtk_fan OpenFOAM Running, Solving & CFD 6 February 18, 2008 00:49
Valve action Hrvoje Jasak (Hjasak) OpenFOAM Running, Solving & CFD 0 January 13, 2005 14:23


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