Problem with boundary conditions
Hi to all!
I need to set on a semicircular patch a fixedValue bc. Is it possible, since the bc is related to the patch normals, to set a condition like this? type fixedValue; value uniform (patch().nf() & general_vector)*patch().nf() If it couldn't be possible, is there something similar that I could use? Thanks Simone |
With groovyBC it can be done quite easily (you need to install that as part of swak4Foam)
Code:
patch |
Thanks for the answer Bernhand..up to now it's a bit difficult for me to install a third party program like groovyBC..there isn't a command (such nonuniform) to achieve my aim in another way?
|
Quote:
Or you can use the coded-boundary condition And there is always the possibility to set nonuniform-BCs "by hand" in the text-editot |
Thanks for your advice gschaider
I was trying to set up my own BC such that it takes the normal vectors to the patch and multiplies them to a specific constant vector and this dot product is then multiplied again to the normal vectors to the patch. Its seems to work, I've modified an existing BC..by the way I'd have a question: when I assign the value of this vector to the patch with the operator command, the value of this vector is automatically put on the patch when it's called the function Ua.correctBoundaryConditions(); right? And, since it is a constant vector, the same value of the BC is put on the patch at each iteration? Thanks Simone |
What I've tried to do is find a similar BC and modify the updateCoeffs() function in this way:
void Foam::adjointVelocityAirfoil::updateCoeffs() { if (updated()) { return; } const fvPatchField<vector>& Uap = patch().lookupPatchField<volVectorField, vector>("Ua"); float alpha = 4*3.14/180; float a1= cos(alpha); float a2= sin(alpha); float a3=0; vector d(a1, a2, a3); forAll(patch().faceCells(), i) { if(pos(Uap[i] & patch().Sf()[i])) { vectorField::operator=((-(d & patch().Sf()[i]))/sqr(patch().magSf()[i])*patch().Sf()[i]); } else vectorField::operator=((d & patch().Sf()[i])/sqr(patch().magSf()[i])*patch().Sf()[i]); } } My aim is to put at each cell of the patch a value of velocity which is given with the scalar product between a constant vector d and the normal to the face, everything projected in the normal direction, and before I make a check on each face to veriry if the scalar product between the quantity Uap and the normal face to the cell is greater than zero or not. Is my code correct or am I making something wrong? Any suggestion would be very grateful Thanks Simone |
All times are GMT -4. The time now is 22:36. |