CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   BC evaluation by means of external lists allocated in the solver (http://www.cfd-online.com/Forums/openfoam-solving/59857-bc-evaluation-means-external-lists-allocated-solver.html)

shrina January 18, 2007 07:09

Hi all, I have to work simu
 
Hi all,

I have to work simultaneously on different meshes and their relative geometricfieds, and the BC for a field on certain patches are calculated by means of of another geometricfield (relative to a different mesh), evaluated at each iteration in the solver.
Three of the meshes represent three distinct regions of a physical domain, and this method is used to determine the boundary conditions at the interfaces between the three contiguous regions : each interface is splitted into two distinct patches, each belonging to one of the two confining meshes, and the continuity of the physical quantity at the interface is imposed by imposing the equality of the two fieds on the two distict patches (each relative to a distict mesh) and in a similar way the equality of the fluxes at the interface (an iterative method is used).
Other meshes instead represent non physical regions, since I have to implement population balances.

My question is: is there a specific class that allows to evaluate and update the BC of a geometric field by using one or more scalarLists evaluated at each iteration in the solver (determined by means of other geometricfields evaluated in the solver and relative to different meshes)?

I tried to define specific classes, inheriting from the class fvPatchField to accomplish that: for example externalListFvPatchField, extGradFvPatchFiled.
I added to the GeometricBoundaryField class data members that are pointers to external lists allocated in the solver.
In these lists the values determined by means of other geometricfields, defined on different meshes and that must be assigned to the patchfiled, or that are used to evaluate the patchfield (if a gradient is imposed) are stored; in one of these lists the names of the patches that must be determined in this way are stored.
I then overloaded the fvPatchField::New function, adding protypes and relative definitions that have these additional input parameters, that are then passed to the constructor of the new classes (externalListFvPatchField, extGradFvPatch).
These data about external lists are data members of these new classes, they are not added to the superclass fvPatchField.
I defined these classes, I added them to the basic fvPatchField folder, I added them in the Make/files, I tried to compile the finiteVolume library, but it gave me the following compilation error:


//////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////
Make/linuxGcc4DPDebug/externalListFvPatchField.o
fields/fvPatchFields/basicFvPatchFields/externalList/externalListFvPatchField.C: 68: error: redefinition of 'Foam::externalListFvPatchField<type>::externalLis tFvPatchField(const Foam::fvPatch&, const Foam::Field<type>&, Foam::label, Foam::wordList*, Foam::labelList*, Foam::scalarList***)'
fields/fvPatchFields/basicFvPatchFields/externalList/externalListFvPatchField.C: 68: error: 'Foam::externalListFvPatchField<type>::externalLis tFvPatchField(const Foam::fvPatch&, const Foam::Field<type>&, Foam::label, Foam::wordList*, Foam::labelList*, Foam::scalarList***)' previously declared here
fields/fvPatchFields/basicFvPatchFields/externalList/externalListFvPatchField.C: 117: error: redefinition of 'Foam::externalListFvPatchField<type>::externalLis tFvPatchField(const Foam::fvPatch&, const Foam::Field<type>&, const Foam::dictionary&, Foam::label, Foam::wordList*, Foam::labelList*, Foam::scalarList***)'
fields/fvPatchFields/basicFvPatchFields/externalList/externalListFvPatchField.C: 117: error: 'Foam::externalListFvPatchField<type>::externalLis tFvPatchField(const Foam::fvPatch&, const Foam::Field<type>&, const Foam::dictionary&, Foam::label, Foam::wordList*, Foam::labelList*, Foam::scalarList***)' previously declared here
fields/fvPatchFields/basicFvPatchFields/externalList/externalListFvPatchField.C: 136: error: redefinition of 'Foam::externalListFvPatchField<type>::externalLis tFvPatchField(const Foam::externalListFvPatchField<type>&, const Foam::Field<type>&)'
fields/fvPatchFields/basicFvPatchFields/externalList/externalListFvPatchField.C: 136: error: 'Foam::externalListFvPatchField<type>::externalLis tFvPatchField(const Foam::externalListFvPatchField<type>&, const Foam::Field<type>&)' previously declared here
fields/fvPatchFields/basicFvPatchFields/externalList/externalListFvPatchField.C: 179: error: redefinition of 'void Foam::externalListFvPatchField<type>::evaluate()'
fields/fvPatchFields/basicFvPatchFields/externalList/externalListFvPatchField.C: 179: error: 'virtual void Foam::externalListFvPatchField<type>::evaluate()' previously declared here
fields/fvPatchFields/basicFvPatchFields/externalList/externalListFvPatchField.C: 249: error: redefinition of 'Foam::tmp<foam::field<type> > Foam::externalListFvPatchField<type>::valueInterna lCoeffs(const Foam::tmp<foam::field<double> >&) const'
fields/fvPatchFields/basicFvPatchFields/externalList/externalListFvPatchField.C: 249: error: 'virtual Foam::tmp<foam::field<type> > Foam::externalListFvPatchField<type>::valueInterna lCoeffs(const Foam::tmp<foam::field<double> >&) const' previously declared here
fields/fvPatchFields/basicFvPatchFields/externalList/externalListFvPatchField.C: 260: error: redefinition of 'Foam::tmp<foam::field<type> > Foam::externalListFvPatchField<type>::valueBoundar yCoeffs(const Foam::tmp<foam::field<double> >&) const'
fields/fvPatchFields/basicFvPatchFields/externalList/externalListFvPatchField.C: 260: error: 'virtual Foam::tmp<foam::field<type> > Foam::externalListFvPatchField<type>::valueBoundar yCoeffs(const Foam::tmp<foam::field<double> >&) const' previously declared here
fields/fvPatchFields/basicFvPatchFields/externalList/externalListFvPatchField.C: 269: error: redefinition of 'Foam::tmp<foam::field<type> > Foam::externalListFvPatchField<type>::gradientInte rnalCoeffs() const'
fields/fvPatchFields/basicFvPatchFields/externalList/externalListFvPatchField.C: 269: error: 'virtual Foam::tmp<foam::field<type> > Foam::externalListFvPatchField<type>::gradientInte rnalCoeffs() const' previously declared here
fields/fvPatchFields/basicFvPatchFields/externalList/externalListFvPatchField.C: 278: error: redefinition of 'Foam::tmp<foam::field<type> > Foam::externalListFvPatchField<type>::gradientBoun daryCoeffs() const'
fields/fvPatchFields/basicFvPatchFields/externalList/externalListFvPatchField.C: 278: error: 'virtual Foam::tmp<foam::field<type> > Foam::externalListFvPatchField<type>::gradientBoun daryCoeffs() const' previously declared here
fields/fvPatchFields/basicFvPatchFields/externalList/externalListFvPatchField.C: 286: error: redefinition of 'void Foam::externalListFvPatchField<type>::write(Foam:http://www.cfd-online.com/OpenFOAM_D...part/proud.gifstream&) const'
fields/fvPatchFields/basicFvPatchFields/externalList/externalListFvPatchField.C: 286: error: 'virtual void Foam::externalListFvPatchField<type>::write(Foam:http://www.cfd-online.com/OpenFOAM_D...part/proud.gifstream&) const' previously declared here
make: *** [Make/linuxGcc4DPDebug/externalListFvPatchField.o] Error 1
miriam@ACERM:~/OpenFOAM/OpenFOAM-1.3-debug/src/finiteVolume>
//////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////


I cannot understand where the problem is.
I suppose that I also have to overload the function declareRunTimeSelectionTable by considering the new input parameters, but I do not know how.
Please, could anyone help me!


Thanks a lot in advance

P.S. What should I do to attach here the folder with my files?

shrina January 18, 2007 11:48

Hi, these are the files I ha
 
Hi,
these are the files I have talked about.

{FilesMiriam.zip}

Bye

Miriam

shrina January 18, 2007 12:29

Sorry, I have not attached the
 
Sorry, I have not attached the folder correctly.
I try again

http://www.cfd-online.com/OpenFOAM_D...hment_icon.gif FilesMiriam.tar.gz

Bye

Miriam


All times are GMT -4. The time now is 07:43.