|
[Sponsors] |
October 15, 2012, 11:52 |
Problem with boundary conditions
|
#1 |
Member
Simone
Join Date: Sep 2012
Posts: 95
Rep Power: 14 |
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 |
|
October 15, 2012, 12:47 |
|
#2 |
Senior Member
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 22 |
With groovyBC it can be done quite easily (you need to install that as part of swak4Foam)
Code:
patch { type groovyBC; value uniform 0; fractionExpression "1"; valueExpression "(normal()^V)&normal()"; } |
|
October 16, 2012, 10:41 |
|
#3 |
Member
Simone
Join Date: Sep 2012
Posts: 95
Rep Power: 14 |
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?
|
|
October 18, 2012, 19:36 |
|
#4 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
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
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
October 19, 2012, 03:28 |
|
#5 |
Member
Simone
Join Date: Sep 2012
Posts: 95
Rep Power: 14 |
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 |
|
October 22, 2012, 04:09 |
|
#6 |
Member
Simone
Join Date: Sep 2012
Posts: 95
Rep Power: 14 |
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 |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
mass flow in is not equal to mass flow out | saii | CFX | 12 | March 19, 2018 06:21 |
CG, BICGSTAB(2) : problem with matrix operation and boundary conditions | moomba | Main CFD Forum | 2 | February 17, 2010 04:37 |
Problem with Boundary conditions | Mahiboobswamulu | Main CFD Forum | 10 | August 26, 2003 14:24 |
boundary conditions problem | reinaldo kuhn | Phoenics | 1 | March 27, 2003 12:46 |
Boundary conditions? | Tom | Main CFD Forum | 0 | November 5, 2002 02:54 |