
[Sponsors] 
July 17, 2006, 06:37 
Hello friends
Hope everyone

#1 
Senior Member
kumar
Join Date: Mar 2009
Posts: 112
Rep Power: 17 
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 

July 17, 2006, 07:12 
You have to specify any bounda

#2 
Member
stefan
Join Date: Mar 2009
Posts: 96
Rep Power: 17 
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. 

July 17, 2006, 07:14 
You have to specify any bounda

#3 
Member
stefan
Join Date: Mar 2009
Posts: 96
Rep Power: 17 
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. 

July 18, 2006, 00:14 
Hi Stefan,
Thanks a lot for

#4 
Senior Member
kumar
Join Date: Mar 2009
Posts: 112
Rep Power: 17 
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 

July 18, 2006, 01:19 
I'am not sure but I think you

#5 
Member
chris book
Join Date: Mar 2009
Posts: 85
Rep Power: 17 
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!


July 18, 2006, 07:29 
Hi chris
Thanks for your re

#6 
Senior Member
kumar
Join Date: Mar 2009
Posts: 112
Rep Power: 17 
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 nonscalar type âFoam::GeometricField<foam::vector,>â requested any ideas ? kumar 

July 18, 2006, 07:50 
I do not know what you are try

#7 
Member
chris book
Join Date: Mar 2009
Posts: 85
Rep Power: 17 
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>&'


July 18, 2006, 08:07 
Hi Chris
what i want to do

#8 
Senior Member
kumar
Join Date: Mar 2009
Posts: 112
Rep Power: 17 
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 

July 18, 2006, 08:11 
May be I get you wrong but a c

#9 
Member
chris book
Join Date: Mar 2009
Posts: 85
Rep Power: 17 
May be I get you wrong but a cell might have more than one neighbour?


July 18, 2006, 08:26 
You are totally right. But i f

#10 
Senior Member
kumar
Join Date: Mar 2009
Posts: 112
Rep Power: 17 
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 

July 18, 2006, 09:01 
Ok I have looked into Hendrik'

#11 
Member
stefan
Join Date: Mar 2009
Posts: 96
Rep Power: 17 
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. 

July 19, 2006, 07:06 
Hi Stefan,
Many thanks for

#12 
Senior Member
kumar
Join Date: Mar 2009
Posts: 112
Rep Power: 17 
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 

July 20, 2006, 00:55 
Hi Stefan ,
I think i got a

#13 
Senior Member
kumar
Join Date: Mar 2009
Posts: 112
Rep Power: 17 
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 

July 20, 2006, 03:14 
I don't know. Look at the impl

#14 
Member
chris book
Join Date: Mar 2009
Posts: 85
Rep Power: 17 
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]]; } 

July 20, 2006, 16:33 
Hi chris
as you suggested i

#15 
Senior Member
kumar
Join Date: Mar 2009
Posts: 112
Rep Power: 17 
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 

July 20, 2006, 22:20 
Hi Stefan
i am still stuck

#16 
Senior Member
kumar
Join Date: Mar 2009
Posts: 112
Rep Power: 17 
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 

Thread Tools  Search this Thread 
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Problem with defaultFvPatchField gradientInternalCoeffs  booz  OpenFOAM PreProcessing  8  February 8, 2010 13:20 