1 //if(poppetDeformation)
4 Info << "Poppet valve deformation" << endl;
6 tetPointVectorField& motionU = mSolver.motionU();
7 // Blocking vertical motion
9 motionU.internalField().replace
12 scalarField(mSolver.motionU().internalField().size(), 0)
15 Info << "motionU.replace" << endl;
19 forAll (valves_, valveI)
23 valves_[valveI].curVelocity()*valves_[valveI].cs().axis();
25 scalar zPoppetMin = -GREAT;
26 scalar zPoppetMax = GREAT;
27 scalar zCurtainMax = GREAT;
29 // If valve is present in geometry, set the motion
30 if (valves_[valveI].bottomPatchID().active())
32 // Bottom of the valve moves with given velocity
34 motionU.boundaryField()[valves_[valveI].bottomPatchID().index()] == vector::zero;
35 // motionU.boundaryField()[valves_[valveI].bottomPatchID().index()] == valveVel;
38 if (valves_[valveI].poppetPatchID().active())
43 motionU.boundaryField()[valves_[valveI].poppetPatchID().index()].patch()
44 .localPoints().component(vector::Z)
48 motionU.boundaryField()[valves_[valveI].poppetPatchID().index()].patch()
49 .localPoints().component(vector::Z)
52 // Info << "zpoppet min and max" << endl;
54 if (valves_[valveI].curLift() > valves_[valveI].deformationLift())
55 // if (valves_[valveI].curLift() > valves_[valveI].minLift())
57 // Top of the valve does not move
58 motionU.boundaryField()[valves_[valveI].poppetPatchID().index()] ==
65 motionU.boundaryField()[valves_[valveI].poppetPatchID().index()] ==
71 if (valves_[valveI].curtainInCylinderPatchID().active())
74 label cicIndex = valves_[valveI].curtainInCylinderPatchID().index();
76 componentMixedTetPolyPatchVectorField& pp =
77 refCast<componentMixedTetPolyPatchVectorField>
79 motionU.boundaryField()[cicIndex]
82 pp.refValue() = vector::zero;
83 pp.valueFraction() = vector::zero;
87 scalar zDetMin = -GREAT;
88 scalar zDetMax = GREAT;
91 if (valves_[valveI].curtainInPortPatchID().active())
93 label cipIndex = valves_[valveI].curtainInPortPatchID().index();
97 motionU.boundaryField()[cipIndex].patch()
98 .localPoints().component(vector::Z)
102 // if (valves_[valveI].curLift() > valves_[valveI].minLift())
103 // if (valves_[valveI].curLift() > valves_[valveI].deformationLift())
105 componentMixedTetPolyPatchVectorField& pp =
106 refCast<componentMixedTetPolyPatchVectorField>
108 motionU.boundaryField()[cipIndex]
111 pp.refValue() = vector::zero;
112 pp.valueFraction() = vector::zero;
117 // poppet deformation
119 componentMixedTetPolyPatchVectorField& pp =
120 refCast<componentMixedTetPolyPatchVectorField>
122 motionU.boundaryField()[cipIndex]
125 scalarField cicPoints =
126 motionU.boundaryField()[cipIndex].patch()
127 .localPoints().component(vector::Z);
129 pp.valueFraction() = pos(cicPoints - zPoppetMin)*vector(0,0,1);
131 pp.refValue() = (cicPoints - zCurtainMax)/(zPoppetMin - zCurtainMax)*valveVel;
137 if (valves_[valveI].stemPatchID().active())
139 label stemIndex = valves_[valveI].stemPatchID().index();
141 // if (valves_[valveI].curLift() > valves_[valveI].minLift())
142 // if (valves_[valveI].curLift() > valves_[valveI].deformationLift())
144 componentMixedTetPolyPatchVectorField& pp =
145 refCast<componentMixedTetPolyPatchVectorField>
147 motionU.boundaryField()[stemIndex]
150 pp.refValue() = vector::zero;
151 pp.valueFraction() = vector::zero;
156 // poppet deformation
158 componentMixedTetPolyPatchVectorField& pp =
159 refCast<componentMixedTetPolyPatchVectorField>
161 motionU.boundaryField()[stemIndex]
164 scalarField stemPoints =
165 motionU.boundaryField()[stemIndex].patch()
166 .localPoints().component(vector::Z);
168 Info << "zPoppetMax = " << zPoppetMax << endl;
169 Info << "zDetMax = " << zDetMax << endl;
171 pp.valueFraction() = (1.0 - pos(stemPoints - zPoppetMax))*vector(0,0,1);
173 pp.refValue() = (stemPoints - zDetMax)/(zPoppetMax - zDetMax)*valveVel;
182 label linerIndex = boundaryMesh().findPatchID("liner");
184 componentMixedTetPolyPatchVectorField& pp =
185 refCast<componentMixedTetPolyPatchVectorField>
187 motionU.boundaryField()[linerIndex]
190 scalarField linerPoints =
191 motionU.boundaryField()[linerIndex].patch()
192 .localPoints().component(vector::Z);
194 pp.refValue() = vector::zero;
195 pp.valueFraction() = vector::zero;
201 // Set piston velocity
202 if (piston().patchID().active())
205 componentMixedTetPolyPatchVectorField& pp =
206 refCast<componentMixedTetPolyPatchVectorField>
208 motionU.boundaryField()[piston().patchID().index()]
211 pp.refValue() = vector::zero;
216 label cylinderHeadIndex = boundaryMesh().findPatchID("cylinderHead");
218 // Top of the valve does not move
219 motionU.boundaryField()[cylinderHeadIndex] ==
225 // Setting the boundary position
227 movePoints(mSolver.curPoints());
229 // Blocking vertical motion
230 motionU.internalField().replace
233 scalarField(mSolver.motionU().internalField().size(), 0)