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

GradientInternalCoeffs

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

Reply
 
LinkBack Thread Tools Display Modes
Old   July 17, 2006, 05:37
Default Hello friends Hope everyone
  #1
Senior Member
 
kumar
Join Date: Mar 2009
Posts: 112
Rep Power: 8
kumar2 is on a distinguished road
Hello friends

Hope everyone is having a good start to the week.

I introduced a new variable called gammaStar in rasInterFoam. the idea is to implement henrik rusche's phd thesis to smoothen out the interface.

volScalarField gammaStar = 1.0*gamma;

but when i do

fvScalarMatrix gammaStarEqn
(
fvm::laplacian(1.0,gammaStar) == gammaStar+gamma
) ;


i get the following error


--> FOAM FATAL ERROR : gradientInternalCoeffs cannot be called for a calculatedFvPatchField.
You are probably trying to solve for a field with a calculated or default boundary conditions.

From function calculatedFvPatchField<type>::gradientInternalCoef fs() const
in file fields/fvPatchFields/basicFvPatchFields/calculated/calculatedFvPatchField.H at line 174.

Any help is appreciated.

thanks

Kumar
kumar2 is offline   Reply With Quote

Old   July 17, 2006, 06:12
Default You have to specify any bounda
  #2
Member
 
stefan
Join Date: Mar 2009
Posts: 96
Rep Power: 8
stefanke is on a distinguished road
You have to specify any boundary conditions for gammaStar otherwise you cannot solve the gammaStarEqn!

The error messages you have reported gave you already a hint what you have to do.
stefanke is offline   Reply With Quote

Old   July 17, 2006, 06:14
Default You have to specify any bounda
  #3
Member
 
stefan
Join Date: Mar 2009
Posts: 96
Rep Power: 8
stefanke is on a distinguished road
You have to specify any boundary conditions for gammaStar otherwise you cannot solve the gammaStarEqn!

The error messages you have reported gave you already a hint what is going wrong.
stefanke is offline   Reply With Quote

Old   July 17, 2006, 23:14
Default Hi Stefan, Thanks a lot for
  #4
Senior Member
 
kumar
Join Date: Mar 2009
Posts: 112
Rep Power: 8
kumar2 is on a distinguished road
Hi Stefan,

Thanks a lot for pointing out the mistake. I implemented the boundary condition ( ofcourse through a boundary file in /0 and things are working fine.)

Do you know by anychance , how to access the vector d . d is the vector from any cell to its neighbour ?

Thanks for the reply

Kumar
kumar2 is offline   Reply With Quote

Old   July 18, 2006, 00:19
Default I'am not sure but I think you
  #5
Member
 
chris book
Join Date: Mar 2009
Posts: 85
Rep Power: 8
chris1980 is on a distinguished road
I'am not sure but I think you can use the function directions() from the fvMesh class. Have a look at the member functions of the fvMesh class!
chris1980 is offline   Reply With Quote

Old   July 18, 2006, 06:29
Default Hi chris Thanks for your re
  #6
Senior Member
 
kumar
Join Date: Mar 2009
Posts: 112
Rep Power: 8
kumar2 is on a distinguished road
Hi chris

Thanks for your reply , as you pointed out directions is indeed a function in fvMesh class. but when i do

volVectorField ddNew = gammaStar.mesh().directions();

i get the following error.

gammaEqn.H:4: error: conversion from ‚const Foam::Vector<foam::label>‚ to non-scalar type ‚Foam::GeometricField<foam::vector,>‚ requested


any ideas ?

kumar
kumar2 is offline   Reply With Quote

Old   July 18, 2006, 06:50
Default I do not know what you are try
  #7
Member
 
chris book
Join Date: Mar 2009
Posts: 85
Rep Power: 8
chris1980 is on a distinguished road
I do not know what you are trying to do but as you can see in the error message the function directions() returns a 'const Vector<label>&'
chris1980 is offline   Reply With Quote

Old   July 18, 2006, 07:07
Default Hi Chris what i want to do
  #8
Senior Member
 
kumar
Join Date: Mar 2009
Posts: 112
Rep Power: 8
kumar2 is on a distinguished road
Hi Chris

what i want to do is solve this equation which is

laplacian(A,gammaStar)=gammaStar + gamma

where A = 0.25/(mag(d))^2 . here d is defined as the vector between the centre of the cell of interest P and the centre of a neighbouring cell N. gammaStar is for smoothening gamma , which is the volume fraction. ( this formulation is in henrik rusche's thesis)

i need to access 'd' but not sure how. my C++ skills are pretty poor. as you can see i am still stuck. can you think of an alternate way of accessing 'd'.

thanks

kumar
kumar2 is offline   Reply With Quote

Old   July 18, 2006, 07:11
Default May be I get you wrong but a c
  #9
Member
 
chris book
Join Date: Mar 2009
Posts: 85
Rep Power: 8
chris1980 is on a distinguished road
May be I get you wrong but a cell might have more than one neighbour?
chris1980 is offline   Reply With Quote

Old   July 18, 2006, 07:26
Default You are totally right. But i f
  #10
Senior Member
 
kumar
Join Date: Mar 2009
Posts: 112
Rep Power: 8
kumar2 is on a distinguished road
You are totally right. But i feel the 'd' is similar to Sf. just as each cell can have as many Sf as there are faces , it can also have as many 'd' s

But i am not sure how to include this idea into laplacian given in henrik's phd. let me also give you his equation:

div.( 0.25/|d|^2 grad[gammaStar] ) = [gammaStar] +gamma

maybe i am totally wrong in my approach , but i would love to hear from you

thanks again chris
kumar
kumar2 is offline   Reply With Quote

Old   July 18, 2006, 08:01
Default Ok I have looked into Hendrik'
  #11
Member
 
stefan
Join Date: Mar 2009
Posts: 96
Rep Power: 8
stefanke is on a distinguished road
Ok I have looked into Hendrik's thesis and I assume you want to solve Eqn (4.16).
You do not discretise the laplacian operator directly instead you are applying Gauss' theorem. So in theory you have to come up with the face gradients of gammaStar and the vector between the cell center and the cell center of the neighbouring cell for each face of the cell of interest.

What you need to do is to construct a surfaceVectorField containing the desired cell center connection vectors for each face.
stefanke is offline   Reply With Quote

Old   July 19, 2006, 06:06
Default Hi Stefan, Many thanks for
  #12
Senior Member
 
kumar
Join Date: Mar 2009
Posts: 112
Rep Power: 8
kumar2 is on a distinguished road
Hi Stefan,

Many thanks for your reply. i have been desperately looking for a function to find cell centre connection vectors . i came across ( what i think ) will do the job . i got this function from /interpolations . Could you please take a look at the function and the following errors.

const volVectorField& cellCentres = mesh.C();
const unallocLabelList& owner = mesh.owner();
const unallocLabelList& neighbour = mesh.neighbour();

forAll (owner, faceI)
{

const vector& dist = cellCentres[neighbour[faceI]] - cellCentres[owner[faceI]];
}
[ all ok till here ! ]

But when i assign

surfaceVectorField New = dist

i get this error:

error: dist was not declared in this scope

Hoping to hear from you .

Kumar
kumar2 is offline   Reply With Quote

Old   July 19, 2006, 23:55
Default Hi Stefan , I think i got a
  #13
Senior Member
 
kumar
Join Date: Mar 2009
Posts: 112
Rep Power: 8
kumar2 is on a distinguished road
Hi Stefan ,

I think i got a better function for 'd' ( which is the vector from any cell centre to its neighbour ) . got this function from Co.C

mesh.surfaceInterpolation::deltaCoeffs() . This seems to be 1/mag(d). Is this correct?

Thanks

Kumar
kumar2 is offline   Reply With Quote

Old   July 20, 2006, 02:14
Default I don't know. Look at the impl
  #14
Member
 
chris book
Join Date: Mar 2009
Posts: 85
Rep Power: 8
chris1980 is on a distinguished road
I don't know. Look at the implementation of deltaCoeffs() and you know if you are right!


to calculate the connection vector you can do something like this:

forAll(owner, faceI)
{
d[faceI] = cellCentres[neighbour[faceI]] - cellCentres[owner[faceI]];
}
chris1980 is offline   Reply With Quote

Old   July 20, 2006, 15:33
Default Hi chris as you suggested i
  #15
Senior Member
 
kumar
Join Date: Mar 2009
Posts: 112
Rep Power: 8
kumar2 is on a distinguished road
Hi chris

as you suggested i went back and took a look at the deltaCoeffs . turs out they are derived from a loop similar to what you have. which makes me think it is correct.

thanks a lot to chris and stefan for helping me out here. i really appreciate the support. good luck to both of you

kumar
kumar2 is offline   Reply With Quote

Old   July 20, 2006, 21:20
Default Hi Stefan i am still stuck
  #16
Senior Member
 
kumar
Join Date: Mar 2009
Posts: 112
Rep Power: 8
kumar2 is on a distinguished road
Hi Stefan

i am still stuck with equation 4.16

Stefan said>
Ok I have looked into Hendrik's thesis and I assume you want to solve Eqn (4.16).
You do not discretise the laplacian operator
directly instead you are applying Gauss' theorem

Are you saying that i should split the laplacian into a div.grad . but both div and grad are explicit. is this not a problem

thanks

kumar
kumar2 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
Problem with defaultFvPatchField gradientInternalCoeffs booz OpenFOAM Pre-Processing 8 February 8, 2010 13:20


All times are GMT -4. The time now is 03:06.