CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Time and Variable Dependent boundary conditions.

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By alvora

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 16, 2012, 10:42
Default Time and Variable Dependent boundary conditions.
  #1
Member
 
Alpesh
Join Date: Jan 2011
Location: Germany
Posts: 52
Rep Power: 15
alvora is on a distinguished road
Hello everyones,

I want to implement new boundary conditions for electrohydrodynamics flow..
There is a conductive plate which is immersed in unipolar charge flow..
I want boundary condition as below on conductive plate surface..

d(Voltage)/dn=(chargeDensity)/epsilon,

where, voltage and charge density are variables parameter and epsilon is constant dimension scalar..
d/dn is normal gradient to surface..
for voltage and charge density, equations are separate.. But, voltage boundary condition on plate surface is depended on charge density...

Can any one tell me that How I can implement?

Thanx in advance

alpesh
alvora is offline   Reply With Quote

Old   July 16, 2012, 13:36
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by alvora View Post
Hello everyones,

I want to implement new boundary conditions for electrohydrodynamics flow..
There is a conductive plate which is immersed in unipolar charge flow..
I want boundary condition as below on conductive plate surface..

d(Voltage)/dn=(chargeDensity)/epsilon,

where, voltage and charge density are variables parameter and epsilon is constant dimension scalar..
d/dn is normal gradient to surface..
for voltage and charge density, equations are separate.. But, voltage boundary condition on plate surface is depended on charge density...

Can any one tell me that How I can implement?

Thanx in advance

alpesh
If the chargeDensity does not change you can do it with fixedGradient. Otherwise I'd (but that is me) use groovyBC with fractionExpression "0" and a gradientExpression
gschaider is offline   Reply With Quote

Old   July 16, 2012, 18:32
Default
  #3
Member
 
Alpesh
Join Date: Jan 2011
Location: Germany
Posts: 52
Rep Power: 15
alvora is on a distinguished road
Hello Bernhard Gschaider,

Thank you very much for reply..

In my case, chargeDensity is also changing with time... I thought to do with groovyBC.. but I dont know how to do in openfoam210.. n moreover I don't know how to implement normal gradient in groovyBC. Because, New voltage surface gradient is equal to chargeDensity/epsilon.. I dont know what to do with d/dn?
Can I consider as new voltage on boundary patch is equal to new_chargeDensity/(epsilon*patch.deltaCoeffs()) ?

Kind Regards
Alpesh
alvora is offline   Reply With Quote

Old   July 16, 2012, 18:41
Default
  #4
Member
 
Alpesh
Join Date: Jan 2011
Location: Germany
Posts: 52
Rep Power: 15
alvora is on a distinguished road
Hello Bernhard Gschaider,

I also tried with this way.. but don't know that is it correct or not?
I put below code in one header file and make link with source file in time loop..

label phifreePatchID = mesh.boundaryMesh().findPatchID("phifreeplate");
//label patchId=patch().boundaryMesh().lookupPatchID(patch Name);

fvPatchScalarField& rho_CD = rhoCharge.boundaryField()[phifreePatchID];
fvPatchScalarField& platevoltage = voltage.boundaryField()[phifreePatchID];

const fvsPatchVectorField& centre = mesh.Cf().boundaryField()[phifreePatchID];
const fvsPatchVectorField& normal = mesh.Sf().boundaryField()[phifreePatchID];
//const surfaceScalarField& delta = mesh.boundaryMesh()[phifreePatchID].snGrad();
const polyPatch& cPatch = mesh.boundaryMesh()[phifreePatchID];

scalar patchArea = 0.0;
scalar r_charge =0.0;
forAll(cPatch, faceI)
{
patchArea += mesh.magSf().boundaryField()[phifreePatchID][faceI];
r_charge += rhoCharge.boundaryField()[phifreePatchID][faceI];
}

forAll (platevoltage, faceI)
{
platevoltage[faceI]= r_charge/(patchArea);
}

I wrote last equations as:
forAll (platevoltage, faceI)
{
platevoltage[faceI]= r_charge/(epsilon0*patchArea*mesh.boundaryMesh()[phifreePatchID].snGrad());
}
and instead of snGrad, I also used .deltaCoeffs(), but I got error in both case..

Can you tell me that this type of way is correct or not? and what mistake I am doing in code?

Thank in advance
kind Regards
Alpesh
alvora is offline   Reply With Quote

Old   July 17, 2012, 19:49
Default
  #5
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by alvora View Post
Hello Bernhard Gschaider,

Thank you very much for reply..

In my case, chargeDensity is also changing with time... I thought to do with groovyBC.. but I dont know how to do in openfoam210.. n moreover I don't know how to implement normal gradient in groovyBC. Because, New voltage surface gradient is equal to chargeDensity/epsilon.. I dont know what to do with d/dn?
Can I consider as new voltage on boundary patch is equal to new_chargeDensity/(epsilon*patch.deltaCoeffs()) ?

Kind Regards
Alpesh
Normal gradient in groovyBC: that's what I explained in the other posting: set fractionExpression to 0 and you have a pure fixedGradient condition (see definition of the mixed-BC).

d/dn: fixedGradient is always defined in the normal direction of the patch. So you already have that
gschaider is offline   Reply With Quote

Old   July 18, 2012, 07:26
Default
  #6
Member
 
Alpesh
Join Date: Jan 2011
Location: Germany
Posts: 52
Rep Power: 15
alvora is on a distinguished road
Hi Bernhard Gschaider,

Thank you very much for reply,
I implemented as below:

phifreeplate
{
type groovyBC;
gradientExpression "(rhoCharge/epsilon)";
variables "rhoCharge@phifreeplate=sum(rhoCharge*mag(Sf() ))/sum(mag(Sf()));epsilon=8.8541e-12;";
value uniform 0;
fractionExpression "0";
}

Can you tell me that is this correct or not, please?

Kind Regards
Alpesh VORA
mm.abdollahzadeh likes this.
alvora is offline   Reply With Quote

Old   July 18, 2012, 11:02
Default
  #7
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by alvora View Post
Hi Bernhard Gschaider,

Thank you very much for reply,
I implemented as below:

phifreeplate
{
type groovyBC;
gradientExpression "(rhoCharge/epsilon)";
variables "rhoCharge@phifreeplate=sum(rhoCharge*mag(Sf() ))/sum(mag(Sf()));epsilon=8.8541e-12;";
value uniform 0;
fractionExpression "0";
}

Can you tell me that is this correct or not, please?

Kind Regards
Alpesh VORA
You're calculating a local variable rhoCharge (BTW: you can omit the @phifreeplate) that is the weighted average of a field rhoCharge. Is that what you want?

From what I understand you might want to skip that variable altogether (variables "epsilon=8.8541e-12;" to get an inhomogenous gradient
gschaider is offline   Reply With Quote

Old   July 19, 2012, 10:15
Default
  #8
Member
 
Alpesh
Join Date: Jan 2011
Location: Germany
Posts: 52
Rep Power: 15
alvora is on a distinguished road
Quote:
Originally Posted by gschaider View Post
You're calculating a local variable rhoCharge (BTW: you can omit the @phifreeplate) that is the weighted average of a field rhoCharge. Is that what you want?

From what I understand you might want to skip that variable altogether (variables "epsilon=8.8541e-12;" to get an inhomogenous gradient

Yes, I need average chargeDensity of only phifreeplates. I mean, a total charge which deposited on phifreeplate divide by total area of phifree plate..

question is: does above BC only calculating charge on phifree plate or whole domain?

Can you tell me last thing again, please? i didn't get why I should have to skip epsilon variable, please?

Kind Regards
A
alvora is offline   Reply With Quote

Old   July 19, 2012, 21:29
Default
  #9
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by alvora View Post
Yes, I need average chargeDensity of only phifreeplates. I mean, a total charge which deposited on phifreeplate divide by total area of phifree plate..

question is: does above BC only calculating charge on phifree plate or whole domain?

Can you tell me last thing again, please? i didn't get why I should have to skip epsilon variable, please?

Kind Regards
A
If I get your verbal explanation right, then your original formula is right. Although I'm not convinced that it makes sense physically: because I think that the d/dn on each face of the patch depends on the amount of charge on that face (and not on the others . in extreme: one face has all the charges and the others have none: then the solution would be different than from the case where you average the charge onto all the other faces: which is what you're proposing)

In short: groovyBC/swak take no responsibility that you got the physics right. That's on you
gschaider is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Difficulty in calculating angular velocity of Savonius turbine simulation alfaruk CFX 14 March 17, 2017 07:08
emag beta feature: charge density charlotte CFX 4 March 22, 2011 10:14
RPM in Wind Turbine Pankaj CFX 9 November 23, 2009 05:05
Time dependent boundary conditions Renaud FLUENT 2 June 21, 2006 20:44
New topic on same subject - Flow around race car Tudor Miron CFX 15 April 2, 2004 07:18


All times are GMT -4. The time now is 08:30.