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

3D engine simulation & error

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 13, 2013, 13:50
Default
  #1
Senior Member
 
Sasan Ghomi
Join Date: Sep 2012
Location: Denmark
Posts: 292
Rep Power: 14
sasanghomi is on a distinguished road
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++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM Extend Project: Open Source CFD        |
|  \\    /   O peration     | Version:  1.6-ext                               |
|   \\  /    A nd           | Web:      www.extend-project.de                 |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      binary;
    class       dictionary;
    location    "constant";
    object      dynamicMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

motionSolver          velocityLaplacian ;

diffusivity     uniform;

// ************************************************************************* //
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM Extend Project: Open Source CFD        |
|  \\    /   O peration     | Version:  1.6-ext                               |
|   \\  /    A nd           | Web:      www.extend-project.de                 |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "constant";
    object      engineGeometry;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

engineMesh     fvMotionSolver;
motionSolver        z ;  //What is this???
ignite              no;
conRodLength    conRodLength [0 1 0 0 0 0 0] 132.56459;

bore            bore [0 1 0 0 0 0 0] 100;

stroke          stroke [0 1 0 0 0 0 0] 92;

clearance       clearance [0 1 0 0 0 0 0] 7.126193;

rpm             rpm [0 0 -1 0 0 0 0] 1500;


// ************************************************************************* //
what is the motion solver in the enginGeometry?? If I set it aaa the openfoam doesn't know it as an invalid type and it needs pointMotionUaaa in the 0 directory.For example I set it z So I must have a pointMotionUz file in the 0 directory for running...
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.
sasanghomi is offline   Reply With Quote

Old   April 15, 2013, 12:45
Default
  #2
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28
mturcios777 will become famous soon enough
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
(
(0 (0 0 0))
(1 (0 0 1))
(2 (0 0 2))
(3 (0 0 3))
)
Hope this helps!
mturcios777 is offline   Reply With Quote

Old   May 13, 2013, 15:03
Default
  #3
Senior Member
 
Sasan Ghomi
Join Date: Sep 2012
Location: Denmark
Posts: 292
Rep Power: 14
sasanghomi is on a distinguished road
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.
sasanghomi is offline   Reply With Quote

Old   May 13, 2013, 18:10
Default
  #4
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28
mturcios777 will become famous soon enough
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
mturcios777 is offline   Reply With Quote

Old   May 14, 2013, 04:48
Default
  #5
New Member
 
RJ HO
Join Date: Dec 2012
Posts: 21
Rep Power: 13
RJ87 is on a distinguished road
Quote:
Originally Posted by mturcios777 View Post
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
First of all, sorry for hijacking your thread sasan.

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
RJ87 is offline   Reply With Quote

Old   May 14, 2013, 11:37
Default
  #6
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28
mturcios777 will become famous soon enough
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.
mturcios777 is offline   Reply With Quote

Old   May 14, 2013, 14:04
Default
  #7
Senior Member
 
Sasan Ghomi
Join Date: Sep 2012
Location: Denmark
Posts: 292
Rep Power: 14
sasanghomi is on a distinguished road
@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: 
cannot open file

file: /home/sasan/Desktop/engine-cold/0/pointMotionUlaplacian at line 0.

    From function regIOobject::readStream()
    in file db/regIOobject/regIOobjectRead.C at line 62.

FOAM exiting
I changed the name of pointMotionU to pointMotionUlaplacian and after that I had another error :
Code:
--> FOAM FATAL IO ERROR: 
unexpected class name pointVectorField expected pointScalarField
    while reading object pointMotionUlaplacian

file: /home/sasan/Desktop/engine-cold/0/pointMotionUlaplacian at line 14.

    From function regIOobject::readStream(const word&)
    in file db/regIOobject/regIOobjectRead.C at line 110.

FOAM exiting
Please take a look at the boundary condition for valve in pointMotionU. I used excel for getting derivative of valvelift profile. So I have a lot of data.But I think I need to have velocity versus time am I right? So I think I should convert the crank angle to time (by dividing to RPM)(CAD=RPM*Time) and for getting velocity I should multiply another variable to RPM.[ dx/d(wt) =(1/w)dx/dt ] (x=valvelift ; w=RPM ; t=time)
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 ? Can you write an example of this boundary condition here?

I appreciate your help,
Thanks and best regards,
Sasan.
sasanghomi is offline   Reply With Quote

Old   May 14, 2013, 14:31
Default
  #8
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28
mturcios777 will become famous soon enough
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
{
    type    timeVaryingUniformValue;  //time varying boundary condition
    outOfBounds  clamp;  //what to do when the end of the list is reached, clamp uses keeps using the last value (since we end with zero velocity, this is what we want)
   fileName    "valve.txt" //create a file that contains the table with the velocity profile; the filepath is relative to the current case folder, so just put it there. I've attached it for you
}
Using these settings I was able to get moveEngineMesh working in 2.0.x. Something similar should work in 1.6-ext, with the change to pointScalarField (you will need to change the velocity profile to only specify the z component, maybe keep two copies so you can try both versions).
Attached Files
File Type: txt valve.txt (2.7 KB, 44 views)
mturcios777 is offline   Reply With Quote

Old   June 17, 2014, 22:45
Default
  #9
New Member
 
Join Date: Mar 2013
Posts: 24
Rep Power: 13
Slanth is on a distinguished road
I am using foam-extend-3.0 and want to simulate 3D engine. I choose verticalValves in engineTopoChangerMesh for mesh topo change. but there are many cellzones and pointzones such as
valveTopPointsV1
valveBottomPointsV1
movingCellsTopV1
movingCellsBotV1
I don't know how to define. can anyone give me a hand?
Slanth is offline   Reply With Quote

Old   April 8, 2013, 17:57
Default
  #10
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28
mturcios777 will become famous soon enough
Quote:
Originally Posted by sasanghomi View Post
Hi Martin ,

I have an error for 3D simulation...
Code:
--> FOAM FATAL ERROR: 
Cannot determine best atan point.  Doing face: 5(130 63594 99810 99740 325) position: 5((2.73987 2.75152e-15 -0.000249261) (2.76186 0.993863 -0.00025) (2.76426 0.993757 -0.000249261) (2.76426 0.993757 0) (2.73987 2.75152e-15 0)) Cur point: 65 position (2.73987 2.75152e-15 0) Next points: 2(0 704) position: 2((2.73987 2.75152e-15 -0.000249261) (2.76426 0.993757 0))
 
    From function void enrichedPatch::calcCutFaces() const
    in file polyMeshModifiers/slidingInterface/enrichedPatch/enrichedPatchCutFaces.C at line 277.
 
FOAM aborting
 
Aborted (core dumped)
I don't know any things about origin of this 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.
These errors are coming from the topology changer. Unfortunately they are one of the least documented parts of OpenFOAM (from an end users point of view). If you look at the error there is a problem with determining how much of the sliding interface is overlapping. We need someone with more experience with the sliding interface. Sadly I am not that person, but if you ever need help with attachDetach I can offer.

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.
mturcios777 is offline   Reply With Quote

Old   April 8, 2013, 18:26
Default
  #11
Senior Member
 
Sasan Ghomi
Join Date: Sep 2012
Location: Denmark
Posts: 292
Rep Power: 14
sasanghomi is on a distinguished road
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
Attached Files
File Type: c enrichedPatchCutFaces.C (29.4 KB, 13 views)
sasanghomi is offline   Reply With Quote

Old   April 8, 2013, 18:36
Default
  #12
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28
mturcios777 will become famous soon enough
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.
mturcios777 is offline   Reply With Quote

Old   April 8, 2013, 18:53
Default
  #13
Senior Member
 
Sasan Ghomi
Join Date: Sep 2012
Location: Denmark
Posts: 292
Rep Power: 14
sasanghomi is on a distinguished road
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?
sasanghomi is offline   Reply With Quote

Old   April 8, 2013, 19:23
Default
  #14
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28
mturcios777 will become famous soon enough
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.
mturcios777 is offline   Reply With Quote

Old   April 9, 2013, 05:21
Default
  #15
Senior Member
 
Sasan Ghomi
Join Date: Sep 2012
Location: Denmark
Posts: 292
Rep Power: 14
sasanghomi is on a distinguished road
Quote:
Originally Posted by mturcios777 View Post
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.
Thank you very much Marco ..I will try to do it..
I appreciate your help.
Thanks and best regards,
Sasan.
sasanghomi 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
[OpenFOAM] Native ParaView Reader Bugs tj22 ParaView 270 January 4, 2016 11:39
Ansys Fluent 13.0 UDF compilation problem in Window XP (32 bit) Yogini Fluent UDF and Scheme Programming 7 October 3, 2012 07:24
CGNS lib and Fortran compiler manaliac Main CFD Forum 2 November 29, 2010 06:25
[Netgen] Installation of Netgen in SuSE Linux 92 edvardsenpriv OpenFOAM Meshing & Mesh Conversion 23 January 16, 2009 06:12
How to get the max value of the whole field waynezw0618 OpenFOAM Running, Solving & CFD 4 June 17, 2008 05:07


All times are GMT -4. The time now is 23:22.