CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM

Problem with boundary conditions

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   October 15, 2012, 10:52
Default Problem with boundary conditions
  #1
Member
 
Simone
Join Date: Sep 2012
Posts: 95
Rep Power: 4
batta31 is on a distinguished road
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
batta31 is offline   Reply With Quote

Old   October 15, 2012, 11:47
Default
  #2
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 787
Rep Power: 12
Bernhard is on a distinguished road
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()";
    }
Bernhard is offline   Reply With Quote

Old   October 16, 2012, 09:41
Default
  #3
Member
 
Simone
Join Date: Sep 2012
Posts: 95
Rep Power: 4
batta31 is on a distinguished road
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?
batta31 is offline   Reply With Quote

Old   October 18, 2012, 18:36
Default
  #4
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,834
Rep Power: 38
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by batta31 View Post
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?
Well. You can write a utility to set the boundary in the way you want. But if you 're allowed to compile your own programs on your OF-installation then you can install swak/groovyBC as well. Because from the standpoint of the sysadmin there is no difference (you're only compiling a program)

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
gschaider is offline   Reply With Quote

Old   October 19, 2012, 02:28
Default
  #5
Member
 
Simone
Join Date: Sep 2012
Posts: 95
Rep Power: 4
batta31 is on a distinguished road
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
batta31 is offline   Reply With Quote

Old   October 22, 2012, 03:09
Default
  #6
Member
 
Simone
Join Date: Sep 2012
Posts: 95
Rep Power: 4
batta31 is on a distinguished road
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
batta31 is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
CG, BICGSTAB(2) : problem with matrix operation and boundary conditions moomba Main CFD Forum 2 February 17, 2010 03:37
mass flow in is not equal to mass flow out saii CFX 2 September 18, 2009 08:07
Problem with Boundary conditions Mahiboobswamulu Main CFD Forum 10 August 26, 2003 13:24
boundary conditions problem reinaldo kuhn Phoenics 1 March 27, 2003 11:46
Boundary conditions? Tom Main CFD Forum 0 November 5, 2002 01:54


All times are GMT -4. The time now is 23:51.