CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (http://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   New Boundary Condition (http://www.cfd-online.com/Forums/openfoam-pre-processing/79656-new-boundary-condition.html)

Chrisi1984 August 30, 2010 11:24

New Boundary Condition
 
Hi all,

I want to create a new boundary conditon, that combines inletOutlet and timeVaryingUniformFixedValue.

Therfore I followed this instructions http://www.tfd.chalmers.se/~hani/kurser/OS_CFD_2008/implementBoundaryCondition.pdf. But when I only copy one existing boundary and then try to compile it. I allways get errors because of redefinitions like this:
Quote:

SOURCE=inletOutletFvPatchField.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-40 -I/cfd/CFD/PROGRAMME/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude -IlnInclude -I. -I/cfd/CFD/PROGRAMME/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude -I/cfd/CFD/PROGRAMME/OpenFOAM/OpenFOAM-1.6/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/inletOutletFvPatchField.o
inletOutletFvPatchField.C:41: error: redefinition of ‘Foam::inletOutletFvPatchField<Type>::inletOutletF vPatchField(const Foam::fvPatch&, const Foam::DimensionedField<Type, Foam::volMesh>&)’
inletOutletFvPatchField.C:41: error: ‘Foam::inletOutletFvPatchField<Type>::inletOutletF vPatchField(const Foam::fvPatch&, const Foam::DimensionedField<Type, Foam::volMesh>&)’ previously declared here
inletOutletFvPatchField.C:59: error: redefinition of ‘Foam::inletOutletFvPatchField<Type>::inletOutletF vPatchField(const Foam::inletOutletFvPatchField<Type>&, const Foam::fvPatch&, const Foam::DimensionedField<Type, Foam::volMesh>&, const Foam::fvPatchFieldMapper&)’
inletOutletFvPatchField.C:59: error: ‘Foam::inletOutletFvPatchField<Type>::inletOutletF vPatchField(const Foam::inletOutletFvPatchField<Type>&, const Foam::fvPatch&, const Foam::DimensionedField<Type, Foam::volMesh>&, const Foam::fvPatchFieldMapper&)’ previously declared here
inletOutletFvPatchField.C:72: error: redefinition of ‘Foam::inletOutletFvPatchField<Type>::inletOutletF vPatchField(const Foam::fvPatch&, const Foam::DimensionedField<Type, Foam::volMesh>&, const Foam::dictionary&)’
inletOutletFvPatchField.C:72: error: ‘Foam::inletOutletFvPatchField<Type>::inletOutletF vPatchField(const Foam::fvPatch&, const Foam::DimensionedField<Type, Foam::volMesh>&, const Foam::dictionary&)’ previously declared here
inletOutletFvPatchField.C:100: error: redefinition of ‘Foam::inletOutletFvPatchField<Type>::inletOutletF vPatchField(const Foam::inletOutletFvPatchField<Type>&)’
inletOutletFvPatchField.C:100: error: ‘Foam::inletOutletFvPatchField<Type>::inletOutletF vPatchField(const Foam::inletOutletFvPatchField<Type>&)’ previously declared here
inletOutletFvPatchField.C:112: error: redefinition of ‘Foam::inletOutletFvPatchField<Type>::inletOutletF vPatchField(const Foam::inletOutletFvPatchField<Type>&, const Foam::DimensionedField<Type, Foam::volMesh>&)’
inletOutletFvPatchField.C:112: error: ‘Foam::inletOutletFvPatchField<Type>::inletOutletF vPatchField(const Foam::inletOutletFvPatchField<Type>&, const Foam::DimensionedField<Type, Foam::volMesh>&)’ previously declared here
inletOutletFvPatchField.C:122: error: redefinition of ‘void Foam::inletOutletFvPatchField<Type>::updateCoeffs( )’
inletOutletFvPatchField.C:122: error: ‘virtual void Foam::inletOutletFvPatchField<Type>::updateCoeffs( )’ previously declared here
inletOutletFvPatchField.C:143: error: redefinition of ‘void Foam::inletOutletFvPatchField<Type>::write(Foam::O stream&) const’
inletOutletFvPatchField.C:143: error: ‘virtual void Foam::inletOutletFvPatchField<Type>::write(Foam::O stream&) const’ previously declared here
inletOutletFvPatchField.C:161: error: redefinition of ‘void Foam::inletOutletFvPatchField<Type>::operator=(con st Foam::fvPatchField<Type>&)’
inletOutletFvPatchField.C:161: error: ‘virtual void Foam::inletOutletFvPatchField<Type>::operator=(con st Foam::fvPatchField<Type>&)’ previously declared here

What's wrong?

Can anybody help me?

Best regards Chrisi

Chrisi1984 September 1, 2010 09:42

Hi,

I am now abled to compile the original boundary conditions!!

But I have problems in combining the two boundaries. I want that the inletValue is read out of a file with time depending values, like in timeVaryingUniformFixedValue.

How can I do this?

Regards Chrisi

N. A. September 8, 2010 15:50

Re:
 
Chris,

Were you able to solve this problem? Even I am looking to give time-varying boundary conditions. I know I can give for lagrangian particles as it is given in dieselFoam, but dont know how to give for boundary conditions in gas-phase.

Also do you know how can we impose mass flow boundary conditions.

Thanks,
Nir

Chrisi1984 September 9, 2010 02:19

Hi,

I implemented my bc by using groovyBC.

Quote:

type groovyBC;
gradientExpression "gradT";
fractionExpression "(phi > 0) ? 0 : 1";
timelines (
{
name Temp;
outOfBounds repeat;
fileName "$FOAM_CASE/rb_p_T";
}
);
variables "gradT=0;";
valueExpression "Temp";
value uniform 900;
Details about this contirbutions can be found here: http://openfoamwiki.net/index.php/Co...s_are_defined:

You can also make bc incorporating the mass-flow. Therefor you can take flowRateInletVelocity for example. Or for time depending mass-flow take timeVaryingFlowRateInletVelocity.

I hope I could help you.

Regards Chrisi

Peter Müller November 8, 2011 11:05

Hello Chrisi

I'm quite new in openFoam and I also try to create an own bc. I receive the same error as you with the redefinitions. What have you done to get rid of these errors?

Thanks Peter


All times are GMT -4. The time now is 15:46.