Custom boundary condition - how to use indices?
Hey guys, I'm trying to use indices to define a fixed value boundary conditions but I have no idea how to, check this out:
========== forAll(*this, i) { scalar yy=patch().Cf()[i].component(1); operator[i]== (n*0); if (yy < .03) { operator[i]= (n*(-0.005)); } if (yy > .07 ) { operator[i]= (n*(.005)); } } ========== Of course, the use of "[i]" is totally inappropriate. Just wanted to make sure y'all understand what I'm looking for! But I did accomplished a mixed boundary conditions. I basically looking for something like this: ========= forAll(*this, i) { scalar yy=patch().Cf()[i].component(1); this->refValue()[i]= vector::zero; this->refGrad()[i] = vector::zero; this->valueFraction()[i] = 1.0; if (yy < .03) { this->refValue()[i]= n*UUU1; this->refGrad()[i] = vector::zero; this->valueFraction()[i] = 1.0; } if (yy > .07 ) { this->refValue()[i]= n*UUU2; this->refGrad()[i] = vector::zero; this->valueFraction()[i] = 1.0; } } ========= Thank you for your attention Mehdi |
All times are GMT -4. The time now is 13:27. |