|
[Sponsors] |
April 11, 2013, 17:28 |
|
#21 |
Senior Member
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28 |
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. |
|
April 11, 2013, 17:49 |
|
#22 |
Senior Member
Sasan Ghomi
Join Date: Sep 2012
Location: Denmark
Posts: 292
Rep Power: 15 |
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. |
|
April 11, 2013, 17:53 |
|
#23 |
Senior Member
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28 |
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). |
|
April 11, 2013, 17:57 |
|
#24 |
Senior Member
Sasan Ghomi
Join Date: Sep 2012
Location: Denmark
Posts: 292
Rep Power: 15 |
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 |
|
April 11, 2013, 17:59 |
|
#25 |
Senior Member
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28 |
Sorry I forgot to address that one. Just turn off ignition in combustionProperties.
|
|
April 11, 2013, 18:03 |
|
#26 |
Senior Member
Sasan Ghomi
Join Date: Sep 2012
Location: Denmark
Posts: 292
Rep Power: 15 |
thank you very much marco,
I will try to do it and I report the result. thank you very much again. best regards, sasan |
|
April 13, 2013, 14:50 |
|
#27 |
Senior Member
Sasan Ghomi
Join Date: Sep 2012
Location: Denmark
Posts: 292
Rep Power: 15 |
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; // ************************************************************************* // 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. |
|
April 15, 2013, 13:45 |
|
#28 |
Senior Member
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28 |
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)) ) |
|
May 13, 2013, 16:03 |
|
#29 |
Senior Member
Sasan Ghomi
Join Date: Sep 2012
Location: Denmark
Posts: 292
Rep Power: 15 |
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. |
|
May 13, 2013, 19:10 |
|
#30 |
Senior Member
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28 |
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 |
|
May 14, 2013, 05:48 |
|
#31 | |
New Member
RJ HO
Join Date: Dec 2012
Posts: 21
Rep Power: 14 |
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 |
||
May 14, 2013, 12:37 |
|
#32 |
Senior Member
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28 |
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.
|
|
May 14, 2013, 15:04 |
|
#33 |
Senior Member
Sasan Ghomi
Join Date: Sep 2012
Location: Denmark
Posts: 292
Rep Power: 15 |
@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 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 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. |
|
May 14, 2013, 15:31 |
|
#34 |
Senior Member
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28 |
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 } |
|
May 14, 2013, 15:49 |
|
#35 |
Senior Member
Sasan Ghomi
Join Date: Sep 2012
Location: Denmark
Posts: 292
Rep Power: 15 |
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. |
|
May 14, 2013, 15:59 |
|
#36 | |
Senior Member
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28 |
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. |
||
May 15, 2013, 19:17 |
|
#37 |
Senior Member
Sasan Ghomi
Join Date: Sep 2012
Location: Denmark
Posts: 292
Rep Power: 15 |
Hi Marco ,
Thank you very much for your help. I compiled version 2.0.x and I had a similar error : Code:
/*---------------------------------------------------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.0.x | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ Build : 2.0.x-97cf67d69932 Exec : moveEngineMesh Date : May 16 2013 Time : 02:11:40 Host : sasan-Inspiron-N5110 PID : 19959 Case : /home/sasan/OpenFOAM/sasan-2.0.x/run/engine-cold nProcs : 1 sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE). fileModificationChecking : Monitoring run-time modified files using timeStampMaster allowSystemOperations : Disallowing user-supplied system call operations // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create engine time Create mesh for time = 0 Selecting engineMesh fvMotionSolver deckHeight: 0 piston position: -10 --> FOAM FATAL IO ERROR: unexpected class name pointVectorField expected pointScalarField while reading object pointMotionUlaplacian file: /home/sasan/OpenFOAM/sasan-2.0.x/run/engine-cold/0/pointMotionUlaplacian at line 14. From function regIOobject::readStream(const word&) in file db/regIOobject/regIOobjectRead.C at line 136. FOAM exiting Thanks and best regards, Sasan. |
|
May 15, 2013, 19:26 |
|
#38 | |
Senior Member
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28 |
Quote:
|
||
May 15, 2013, 19:51 |
|
#39 |
Senior Member
Sasan Ghomi
Join Date: Sep 2012
Location: Denmark
Posts: 292
Rep Power: 15 |
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. |
|
July 4, 2013, 11:12 |
|
#40 |
Senior Member
Sasan Ghomi
Join Date: Sep 2012
Location: Denmark
Posts: 292
Rep Power: 15 |
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 ?? 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 Crank angle = 12 CA-deg deltaZ = -0.109588 DICPCG: Solving for cellMotionUz, Initial residual = 0.000334198, Final residual = 9.41647e-06, No Iterations 9 clearance: 9.17415 Piston speed = -1972.58 m/s diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0 DILUPBiCG: Solving for Ux, Initial residual = 0.0431167, Final residual = 4.43141e-09, No Iterations 2 DILUPBiCG: Solving for Uy, Initial residual = 0.0145968, Final residual = 6.96134e-10, No Iterations 2 DILUPBiCG: Solving for Uz, Initial residual = 0.0295304, Final residual = 9.55942e-06, No Iterations 1 DILUPBiCG: Solving for h, Initial residual = 0.0145461, Final residual = 3.94577e-08, No Iterations 3 From function specieThermo<thermo>::T(scalar f, scalar T0, scalar (specieThermo<thermo>::*F)(const scalar) const, scalar (specieThermo<thermo>::*dFdT)(const scalar) const) const in file /home/sasan/OpenFOAM/OpenFOAM-1.6-ext/src/thermophysicalModels/specie/lnInclude/specieThermoI.H at line 73 Maximum number of iterations exceeded. Rescue by HJ From function specieThermo<thermo>::T(scalar f, scalar T0, scalar (specieThermo<thermo>::*F)(const scalar) const, scalar (specieThermo<thermo>::*dFdT)(const scalar) const) const in file /home/sasan/OpenFOAM/OpenFOAM-1.6-ext/src/thermophysicalModels/specie/lnInclude/specieThermoI.H at line 73 Maximum number of iterations exceeded. Rescue by HJ Code:
dimensions [0 1 -1 0 0 0 0]; internalField uniform 0; boundaryField { piston { type fixedValue; value uniform -1500; } intakePort { type fixedValue; value uniform 0; } valveStem1 { type fixedValue; value uniform -1000; } symetry { type symmetryPlane; } presin { type fixedValue; value uniform 0; } liner { type slip ; } cylinderHead { type fixedValue; value uniform 0; } valve { type fixedValue; value uniform -1000; } } Thanks and best regards, Sasan. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[OpenFOAM] Native ParaView Reader Bugs | tj22 | ParaView | 270 | January 4, 2016 12:39 |
Ansys Fluent 13.0 UDF compilation problem in Window XP (32 bit) | Yogini | Fluent UDF and Scheme Programming | 7 | October 3, 2012 08:24 |
CGNS lib and Fortran compiler | manaliac | Main CFD Forum | 2 | November 29, 2010 07:25 |
[Netgen] Installation of Netgen in SuSE Linux 92 | edvardsenpriv | OpenFOAM Meshing & Mesh Conversion | 23 | January 16, 2009 07:12 |
How to get the max value of the whole field | waynezw0618 | OpenFOAM Running, Solving & CFD | 4 | June 17, 2008 06:07 |