3D engine simulation & error
1 Attachment(s)
Dear foamers ,
I am simulating a 3D engine with sonicTurbDymEngineFoam and simpleEngineTopoFVmesh library.... I imported the mesh from GAMBIT to openfoam and when I run the case I have an error... Code:
187531 How Can I overcome this problem? I appreciate any help from you.. Thanks and best regards, Sasan. |
sometimes I have another error :
Code:
/*---------------------------------------------------------------------------*\ Sasan. |
hi!
since ur working with a mesh created outside OF i suggest u to test it at with a steady state or transient solver b4 running the dynamic mesh case. moreover u might have to start the case with non-zero set of physical quantities... u might need the steadystate values at t=0s That's all i can say for now! sry i cant be of more help!:( gl |
Hi Sasan.
I see a problem in the 2D area (the valve "seating" area) in the mesh. I will try to generate the mesh with both valves down and after that I will move them to the position with using of simpleEngine and moveEngineMesh solver. You will after that have better control of the mesh. And again, if you will have another troubles, you would post the case here and I will take a deeper look :) |
@ mauricio :
Hi mauricio thanks for your reply. _______________________________________________ @ Martin Hi Martin , thanks for your reply, Actually I don't know anything about moveEngineMesh but I will try to do your idea and I will report the result.. Thanks and best regards, Sasan. |
Quote:
|
Hi Martin ,
I have an error for 3D simulation... Code:
--> FOAM FATAL ERROR: For solving this problem I used mergeMeshes for creating interface and unfortunately I had this error again... Do you think this error comes from engineGeometry or mesh generation?? please guide me.. Thanks and best regards, Sasan. |
Hi Martin ,
I increased the gap between valve and valve seat and I refined mesh in this region ( similar to 2D case) But unfortunately I have Motion continuity errors ... Starting time loop Courant Number mean: 0 max: 0 velocity magnitude: 0 deltaT = 2.6455e-06 Crank angle = 0.0238095 CA-deg CG: Solving for motionUx, Initial residual = 0, Final residual = 0, No Iterations 0 CG: Solving for motionUy, Initial residual = 0, Final residual = 0, No Iterations 0 CG: Solving for motionUz, Initial residual = 0.213596, Final residual = 0.000179652, No Iterations 20 CG: Solving for motionUx, Initial residual = 4.89248e-09, Final residual = 4.42683e-10, No Iterations 1 CG: Solving for motionUy, Initial residual = 0, Final residual = 0, No Iterations 0 CG: Solving for motionUz, Initial residual = 0.000100573, Final residual = 7.10585e-08, No Iterations 21 Volume: new = 48492.4 old = 48492.3 change = 0.0719435 Motion continuity errors : sum local = 1.22866e-15, maximum = 2.88108e-14 Floating point exception (core dumped) How can I overcome this error? I need your help... I appreciate any help from you.. Thanks and best regards, Sasan. |
I'm not sure that the problem is what you think it is. When you have motion continuity errors, that means that the continuity equations is not exactly obeyed due to the numerical discretization and schemes, which is normal. If you look at the magnitude of the errors (1e-14) they are very small so you are okay.
I'm not sure what the floating point error comes from, as there aren't any other error messages. My guess its something to do with your mesh definition. You can try turn on all the debug switches in the global controlDict that have to do with moving meshes and topoChangers and see if you get more information. |
4 Attachment(s)
Dear Marco,
Thank you very much for your reply.;) I added debug switches at the end of controlDict but unfortunately I didn't get more information. I am tired of this error..:( I attached 4 pictures of the mesh..Do you think the mesh is good?Or not? I tried to create a good mesh why the mesh create some problems:( I appreciate any help from you. Thanks and best regards, Sasan. |
Quote:
Some advice I can offer is to look at the code in enrichedPatchCutFaces.C and see what condition is being violated when that error message is thrown. My copy of enrichedPatch doesn't have that line, but I am running 2.2.x. I think your mesh is fine for stationary simulation, but when involving the topology modifiers things get very complicated very fast. Why don't you simulate with a simpler engine mesh class (fvMotionSolverEngineMesh) and simulate the valve closing until your timestep falls below a certain value, then remeshing without the valve passages (closing off the domain) until you need to move them again? I've seen many people do this as the topology modifiers can be a bit of a pain to get working. |
1 Attachment(s)
thanks for your reply marco ,
I attached enrichedPatchCutFaces.C I have not worked with fvMotionSolverEngineMesh...is there in version 1.6-ext? what are things that I must change for using this library in my case? only enginGeometry? Can you set here an engineGeometry file for using this library? Thanks and best regards, Sasan |
Thanks Sasan. From a quick read it seems like the problem is that the sliding face isn't planar, though I can't be 100%; it may be possible this engineMesh only works in 2D and requires the sliding interface to be planar.
fvMotionSolverEngineMesh requires a dynamicMeshDict to specify the type of motionSolver you are using (have a look at the pimpleDyMFoam tutorial case movingCone), and you will need a pointMotionU file in the initial time directory that give the velocity profile of the valve motion for the valve boundaries. |
your mean is that I must change my solver? or only dynamicFvMesh ??
which solver?which version? and this class doesn't have sliding interface? am I right? only layering? and for attach/detach for valves it remesh the grid? |
As long as your solver uses engineMesh (so engineFoam or dieselEngineFoam) you will be fine. The dynamicMeshDict specifies what motionSolver you want to use (how to solve for the point motion equation and what the diffusivity of the points of the mesh should be).
These classes don't have ANY topology change at all. This will require you to remesh whenever the mesh quality gets very poor or when you want to change the topology (open/close valves, etc). You can write a script to remesh when your simulation crashes, as poor mesh will likely cause that to happen. |
Quote:
Sorry for my late respond, but the world gets crazy these days. Marco have post lot of useful information and I try to extend some of these ideas. If you want debug messages you should compile OpenFoam in debug mode. On the forum is there one thread, where the compilation is described ( admin is Bruno Santos). As Marco have said, the motion continuity errors aren't the problem. The problem arises somewhere after the motion continuity errors are written on the screen. You should look into the code (try to use eclipse). Do you have tried stitchmesh for the ports any cyls of the valve curtain? Antoher possible problem for LayerAR I see in the poppet patch of the valves As I have found in second chapter of this thesis (page 23) http://www.tfd.chalmers.se/~hani/pdf...sterThesis.pdf The layer addition and removal is carried out according to the following algorithm. Two cell layers are defined, one static and one dynamic. These must have the same structure. The neighbouring faces of two layers must be normal to each other. The dashed line in Figure 2.14 shows such a set of faces. This requires a hexahedral mesh in the layering region. If the stitchMesh will work normally, you might try to set the deformAngle to 180 in order to get the mesh deformation. If the error remain the same, you should look at the boundary conditions. Again, it will be better, if you post the case somewhere and here place the link. Best regards Martin |
Hi Martin ,
I am very glad for returning you. thanks for your reply. Can I have your email for sending the case? best regards, Sasan |
Quote:
I appreciate your help. Thanks and best regards, Sasan. |
Quote:
sure, here it is: novakm@karlin.mff.cuni.cz But I think that posting the case here will be better. more eyes see more... M |
Hi Dear Marco,
a good day to you. I am trying to use fvMotionsolver for engineMesh (as you were advised) but I need your help. How can I define a profile for piston or valves in the pointMotionUx file? I think I should use of equations in the refrence books of internal combustion engines for speed of piston .But for valves I have valvelift versus CAD (a lot of points (CAD & valvelift) I don't have a function) .. How can I set this boundary conditions for valves and piston? ( in pointMotionUx file ) My second question is about geometry . can you explain about static geometry? should I change the geometry? how can I close the exhaust valve at the begining of time ? and how can I close the inlet valve at the exhaust stroke ? you said I must use a script but I don't know anythings about that. I appreciate any help from you, Thanks and best regards, Sasan. |
If you take the derivative of the lift profile you will get the velocity profile, then just format it as a table and input it in the boundary conditions file.
The piston is handled automatically through the engineGeometry file. As far opening and closing the valve, it involves having different meshes where some have the port geometry and some don't. You will need to map the field between the different meshes using mapFields. A bash script (look it up, there are many tutorials) would help you automate this. You can also look at the Allrun scripts that exist on many of the tutorials to find out how they work. |
Thanks for your reply marco ,
I really appreciate your help.. it means that I must create four different mesh for 4 strokes...it is right? for example after end of induction I should use mapfields(inconsistent) for continuing the simulation.. am I right? Also I must stitch mesh in the sliding interface..and the mesh should be one region. another question: engineFoam have some files about combustion but I want to simulate cold flow how can I inactive them? Also what is the boundary condition for piston in the pointMotionUx file? thank you very much dear marco best regards sasan. |
piston can have fixedValue (0 0 0). The way fvMotionSolver works is that first the piston points are moved explicitly according to the engineGeometry file (RPM and connecting rod length, etc). Then the motionSolver moves the points according to pointMotionU and the velocity of the piston points.
I would recommend having all the boundaries except the liner and valves be fixedValue (0 0 0). The valves should have a velocity profile, and the liner should be slip type (at least that works best for me). |
thank you very much marco,
engineFoam have some files about combustion but I want to simulate cold flow how can I inactive them? best regards |
Sorry I forgot to address that one. Just turn off ignition in combustionProperties.
|
thank you very much marco,
I will try to do it and I report the result. thank you very much again. best regards, sasan |
Hi Dear Marco,
a good day to you. I have some questions : 1)You said that I should use map field so I should generate some different geometry. For example in my case the intake valve closed at CAD=200 (this position is not BTD) So I have a geometry untill CAD=200 and for continuing the simulation I should create a new geometry without any valves But I don't have the position of piston at this CAD..How can I find the position of piston at this CAD for generating a new geometry?? 2) please take a look at the dynamicMeshDict and engineGeometry...are they correct? Code:
/*--------------------------------*- C++ -*----------------------------------*\ Code:
/*--------------------------------*- C++ -*----------------------------------*\ and when I create a pointMotionUz in this file all boundary condition should be scalar and fixedvalue (0 0 0) is an invalid type...why?? 3) I have some problems for boundary condition for valve in the pointMotionU.. I set it as a table that the left side is CAD and the right side is velocity of valve but it is mistake : valve1 { CAD velocity of valve . . . . . . . . } How can I create this profile?why this form is mistake? please guide me. I appreciate your help. Thank you very much. best regards, Sasan. |
In the engineMesh solver output, the pistion position is output (pistonPosition= ) and is the z coordinate of the highest point of the piston patch. You can always start a run and wait for the message to be output and quit.
It is a little confusing of how the motion solver is specified. For the velocityLaplacian motionSolver in dynamicMeshDict, use "laplacian" as the motionSolver in engineGeometry. The velocity profile is in the typical Foam table format. You first specify the number of entries and then the table of values. A sample profile can look like this: Code:
4 |
Hi Marco,
A good day to you ;) I am trying to simulate an engine without changing topology. But I have some problems ! Please take a look at my case (I uploaded it https://mega.co.nz/#!VtIkxbiA!VNAilH...-p7-schAOzCJLw). Can you correct it? I think some things in this case is wrong. I can't use pointMotionU as a Vectorfield and I don't know about motionSolver in engineGeometry ( it must be X or Y or Z . Why?) Actually in this case piston doesn't move. what is the type of boundary condition for valve in pointMotionU ? I want to set a profile for movement of valve. Please help me. I appreciate your help Thanks and best regards, Sasan. P.S. I used coldEngineFoam as a solver. |
Hi Sasan,
I would recommend using moveEngineMesh first to fully check the mesh motion. In your case, in engineGeometry, motionSolver should be "laplacian". In dynamicMeshDict, solver should be velocityLaplacian. To specify motion, the file in 0 directory should be pointMotionU and it should be a pointVectorField. To specify valve motion you need to give the velocity profile (which is the derivative of the lift profile) and it must be specified as a vector (I noticed you are mixing having vectors and scalars in your boundary and initial conditions; they should all be vectors). Or you can switch the solver to displacementLaplacian in dynamicMeshDict (I've never had good experience with that one though, as the displacement has to be absolute I think). You don't need to specify piston motion, as this is handled by how you have set your engine geometry settings in engineGeometry. Hope this helps, Marco |
Quote:
Marco, I wonder if you are willing to share your case setup folder using fvMotionSolverEngineMesh? I'm doing something almost similar to sasan. I manage to work my case with sprayEngineFoam with OpenFoam2.2.x. Now, I would like to include intake and exhaust simulation but I have completely no idea where to start with fvMotionSolverEngineMesh. My email is rj_5847@hotmail.com. Regards RJ |
Sasan's is a good place to start, with the corrections I have suggested. I can't share any cases as it is work for my employer.
|
@RJ HO : That's ok . I am trying to create a test case with fvMotionSolver.
@Mrco : Thank you very much Marco for your guidance . Actually I changed the case according to your advice. ( I uploaded ithttps://mega.co.nz/#!QhZUQKbY!T_jZej...0-anJa9pbED4tI ) when I run the case I have an error : Code:
--> FOAM FATAL IO ERROR: Code:
--> FOAM FATAL IO ERROR: please correct me if I am wrong . Also I don't know for sure about type of this boundary condition . It should be Time varying ?:confused: Can you write an example of this boundary condition here? I appreciate your help, Thanks and best regards, Sasan. |
1 Attachment(s)
Hi Sasan,
I don't have a copy of 1.6-ext running on my machine so it may be that pointMotionU should be a pointScalarField. I don't remember which type of boundary condition pointScalarFields take, but it should be something like Code:
valve |
Dear Marco ,
thanks for your quick reply. Please tell me my expression is correct ? ( about converting CAD to time and ....) I should insert velocity versus time in the valve.txt am I right? Did the last test case that I upload work on your machine ?( it means this case works on 2.0.x? ) Thanks and best regards Sasan. |
Quote:
time = CAD/RPM/6 (as you need to convert from minutes to seconds and from revolutions to degrees. I was able to get your test case working in 2.0.x (moveEngineMesh at least) by making the change in the valve BC as I mentioned in my previous post. |
Hi Marco ,
Thank you very much for your help. I compiled version 2.0.x and I had a similar error : Code:
/*---------------------------------------------------------------------------*\ Thanks and best regards, Sasan. |
Quote:
|
I changed all entries (related to pointMotionUz) to scalar and now the case runs but in paraview the grid doesn't move and the grid is fix . I don't know why !!
I uploaded the case (https://mega.co.nz/#!t4YwjCxT!BT3cNT...7qqaDVQAU5FLVk ) I appreciate any help from you, Thanks and best regards, Sasan. |
1 Attachment(s)
Hi Dear Marco,
I have some questions about using fvmotion solver . Please guide me. 1) you said to me that I should set the pointMotionUz for piston uniform 0 . But by doing this action the piston doesn't move .Any idea ?? I think I should set a time varying boundary condition for piston (an equation between velocity of piston and Time ). I want to know that is it possible to define a time varying boundary condition in pointMotionUz file ??:confused: 2)what about valveStem (for pointMotionU) ? if I set uniform 0 for valveStem the geometry will degenerate when the mesh starts to moving . 3) after 12 degrees I get below error . Do you know what is the origin of this error? Code:
Courant Number mean: 0.00731579 max: 2.9446 velocity magnitude: 29623.1 Code:
dimensions [0 1 -1 0 0 0 0]; Thanks and best regards, Sasan. |
All times are GMT -4. The time now is 22:52. |