CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   3D engine simulation & error (https://www.cfd-online.com/Forums/openfoam/115313-3d-engine-simulation-error.html)

sasanghomi March 28, 2013 02:30

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
187532
187533
187534
187535
187536
187537
187538
187539
187540
187541
187542
187543
187544
187545
187546
187547
187548
187549
187550
187551
187552
187553
187554
187555
187556
187557
187558
187559
187560
187561
187562
187563
187564
187565
187566
187567
187568
187569
187570
187571
187572
187573
187574
187575
187576
187577
187578
187579
187580
187581
187582
187583
187584
187585
187586
187587
187588
187589
187590
187591
187592
187593
187594
187595
187596
187597
187598
187599
187600
187601
187602
187603
187604
187605
187606
187607
187608
187609
187610
187611
187612
187613
187614
187615
187616
187617
187618
187619
187620
187621
187622
187623
187624
187625
187626
187627
187628
187629
187630
187631
187632
187633
187634
187635
187636
187637
187638
187639
187640
187641
187642
187643
187644
187645
187646
187647
187648
187649
187650
187651
187652
187653
187654
187655
187656
187657
187658
187659
187660
187661
187662
187663
187664
187665
187666
187667
187668
187669
187670
187671
187672
187673
187674
187675
187676
187677
187678
187679
187680
187681
187682
187683
187684
187685
187686
187687
187688
187689
187690
187691
187692
187693
187694
187695
187696
187697
187698
187699
187700
187701
187702
187703
187704
187705
187706
187707
187708
187709
187710
187711
187712
187713
187714
187715
187716
187717
187718
187719
187720
187721
187722
187723
187724
187725
187726
187727
187728
187729
187730
187731
187732
187733
187734
187735
187736
187737
187738
187739
187740
187741
187742
187743
187744
187745
187746
187747
187748
187749
187750
187751
187752
187753
187754
187755
187756
187757
187758
187759
187760
187761
187762
187763
187764
187765
187766
187767
187768
187769
187770
187771
187772
187773
187774
187775
187776
187777
187778
187779
187780
187781
187782
187783
187784
187785
187786
187787
187788
187789
187790
187791
187792
187793
187794
187795
187796
187797
187798
187799
187800
187801
187802
187803
187804
187805
187806
187807
187808
187809
187810
187811
187812
187813
187814
187815
187816
187817
187818
187819
187820
187821
187822
187823
187824
187825
187826
187827
187828
187829
187830
187831
187832
187833
187834
187835
187836
187837
187838
187839
187840
187841
187842
187843
187844
187845
187846
187847
187848
187849
187850
187851
187852
187853
187854
187855
187856
187857
187858
187859
187860
187861
187862
187863
187864
187865
187866
187867
187868
187869
187870
187871
187872
187873
187874
187875
187876
187877
187878
187879
187880
187881
187882
187883
187884
187885
187886
187887
187888
187889
187890
187891
187892
187893
187894
187895
187896
187897
187898
187899
187900
187901
187902
187903
187904
187905
187906
187907
187908
187909
187910
187911
187912
187913
187914
187915
187916
187917
187918
187919
187920
187921
187922
187923
187924
187925
187926
187927
187928
187929
187930
187931
187932
187933
187934
187935
187936
187937
187938
187939
187940
187941
187942
187943
187944
187945
187946
187947
187948
187949
187950
187951
187952
187953
187954
187955
187956
187957
187958
187959
187960
187961
187962
187963
187964
187965
187966
187967
187968
187969
187970
187971
187972
187973
187974
187975
187976
187977
187978
187979
187980
187981
187982
187983
187984
187985
187986
187987
187988
187989
187990
187991
187992
187993
187994
187995
187996
187997
187998
187999
188000
188001
188002
188003
188004
188005
188006
188007
188008
188009
188010
188011
188012
188013
188014
188015
188016
188017
188018
188019
188020
188021
188022
188023
188024
188025
188026
188027
188028
188029
188030
188031
)
 nInternalFaces: 175412

    From function void simpleEngineTopoFvMesh::addZonesAndModifiers()
    in file simpleEngineTopoFvMesh/addSimpleEngineTopoFvMeshModifiers.C at line 189.

FOAM aborting

Aborted (core dumped)

Can anyone help me?
How Can I overcome this problem?
I appreciate any help from you..

Thanks and best regards,
Sasan.

sasanghomi March 28, 2013 03:05

sometimes I have another error :

Code:

/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM Extend Project: Open source CFD        |
|  \\    /  O peration    | Version:  1.6-ext                              |
|  \\  /    A nd          | Web:      www.extend-project.de                |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
Build  : 1.6-ext-959ec266ba5c
Exec  : sonicTurbDyMEngineFoam
Date  : Mar 28 2013
Time  : 12:32:12
Host  : sasan-Inspiron-N5110
PID    : 13906
Case  : /home/sasan/Desktop/3dcase
nProcs : 1
SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create engine time

Create dynamic mesh for time = 0

Selecting dynamicFvMesh simpleEngineTopoFvMesh
Selecting motion solver: laplaceFaceDecomposition
Selecting motion diffusivity: uniform
void Foam::simpleEngineTopoFvMesh::addZonesAndModifiers() : Zones and modifiers already present.  Skipping.
Reading thermophysical properties

Selecting thermodynamics package hPsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>

Reading field U

Reading/calculating face flux field phi

Creating turbulence model

Selecting turbulence model type RASModel
Selecting RAS turbulence model kEpsilon
kEpsilonCoeffs
{
    Cmu            0.09;
    C1              1.44;
    C2              1.92;
    C3              -0.33;
    sigmak          1;
    sigmaEps        1.3;
    Prt            1;
}

Creating field DpDt

Courant Number mean: 0 max: 0 velocity magnitude: 0
Total cylinder mass: 56825.7

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.021432, Final residual = 2.02134e-05, No Iterations 15
CG:  Solving for motionUx, Initial residual = 1.00064e-11, Final residual = 1.00064e-11, No Iterations 0
CG:  Solving for motionUy, Initial residual = 0, Final residual = 0, No Iterations 0
CG:  Solving for motionUz, Initial residual = 2.75405e-06, Final residual = 1.88057e-09, No Iterations 21
Volume: new = 48556 old = 48555.7 change = 0.293155
Motion continuity errors : sum local = 1.46336e-10, maximum = 1.43825e-07
Floating point exception (core dumped)

please guide me...

Sasan.

calim_cfd March 28, 2013 14:17

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

novakm March 29, 2013 04:29

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 :)

sasanghomi March 29, 2013 06:04

@ 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.

novakm March 29, 2013 09:20

Quote:

Originally Posted by sasanghomi
@ [B
Martin[/B]
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.

moveEngineMesh is a simple utility, which contains just the mesh.move() command, so no volume fields are computed and this is the fastest way to handle the mesh (my opinion).

sasanghomi April 1, 2013 13:40

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.

sasanghomi April 6, 2013 04:27

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.

mturcios777 April 8, 2013 13:01

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.

sasanghomi April 8, 2013 16:47

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.

mturcios777 April 8, 2013 17:57

Quote:

Originally Posted by sasanghomi (Post 417643)
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.

sasanghomi April 8, 2013 18:26

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

mturcios777 April 8, 2013 18:36

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.

sasanghomi April 8, 2013 18:53

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?

mturcios777 April 8, 2013 19:23

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.

novakm April 9, 2013 03:57

Quote:

Originally Posted by sasanghomi (Post 419198)
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.

Hi Sasan.

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

sasanghomi April 9, 2013 05:11

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

sasanghomi April 9, 2013 05:21

Quote:

Originally Posted by mturcios777 (Post 419241)
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.

novakm April 9, 2013 05:59

Quote:

Originally Posted by sasanghomi (Post 419350)
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



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

sasanghomi April 11, 2013 14:54

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.

mturcios777 April 11, 2013 16: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.

sasanghomi April 11, 2013 16:49

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.

mturcios777 April 11, 2013 16:53

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).

sasanghomi April 11, 2013 16:57

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

mturcios777 April 11, 2013 16:59

Sorry I forgot to address that one. Just turn off ignition in combustionProperties.

sasanghomi April 11, 2013 17:03

thank you very much marco,
I will try to do it and I report the result.
thank you very much again.

best regards,
sasan

sasanghomi April 13, 2013 13:50

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.

mturcios777 April 15, 2013 12:45

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!

sasanghomi May 13, 2013 15:03

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.

mturcios777 May 13, 2013 18:10

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

RJ87 May 14, 2013 04:48

Quote:

Originally Posted by mturcios777 (Post 427279)
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

mturcios777 May 14, 2013 11:37

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.

sasanghomi May 14, 2013 14:04

@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 ?:confused: Can you write an example of this boundary condition here?

I appreciate your help,
Thanks and best regards,
Sasan.

mturcios777 May 14, 2013 14:31

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
{
    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).

sasanghomi May 14, 2013 14:49

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.

mturcios777 May 14, 2013 14:59

Quote:

Originally Posted by sasanghomi (Post 427523)
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.

You don't need to convert to time in seconds, since the engine solvers use engineTime, which measures time in CAD (still time, just different units). For future reference, converting from CAD to time is done by:

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.

sasanghomi May 15, 2013 18:17

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

Are you sure that you didn't change anything in source codes ?

Thanks and best regards,
Sasan.

mturcios777 May 15, 2013 18:26

Quote:

Originally Posted by sasanghomi (Post 427842)
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

Are you sure that you didn't change anything in source codes ?

Thanks and best regards,
Sasan.

I don't recall changing anything, but lets not worry too much about it. If it asks for a pointScalarField, then use a pointScalarField and make sure all your entries are scalar. Try it and see if it works, though if you are not using a component solver I don't see why it isn't asking for a pointVectorField.

sasanghomi May 15, 2013 18:51

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.

sasanghomi July 4, 2013 10:12

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
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

the pointMotionUz file is as below. (I set a constant number for valve and piston because I wanted to see how does the grid move by using fvMotionSolver.
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;

  }

   
}

I appreciate any help from you.
Thanks and best regards,
Sasan.


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