CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   New boundary condition (https://www.cfd-online.com/Forums/openfoam-solving/60325-new-boundary-condition.html)

tnk April 14, 2009 06:03

Thank you, Alexander for fast reply. As far as I understand inletOutlet, b.c. depend on U vector direction but not magnitude.

I send forum private message to you.

Best regards
Leonid

zhoubinwx June 8, 2009 21:19

Hello,

Can I ask in " valueFraction*U + (1-valueFraction)*dU = 0 ", dU means the normal gradient of U, i.e. dU/dn, or just the difference between internalField velocity and boundary velocity?

Bin



Quote:

Originally Posted by niklas (Post 191998)
Hola,

Not 100 percent sure, but I'd say its like this:

valueFraction*U + (1-valueFraction)*dU = 0

N


makaveli_lcf June 9, 2009 02:49

According to User Guide page 128 it is normal gradient. Learn to use documentation for such questions, it will be more usefull:-)

Shoonya June 24, 2010 15:09

Hello makaveli_lcf
You wrote that you had written your own code for dT/dn = h_ext / k_f * (T_ext - T) this kind of BC. I am trying to solve a problem which concerns the same BC you have talked in post #18. Could you please send me your code of that BC. I would be grateful to you.

thanks

openfoam1 October 6, 2010 00:46

Hi,


the equation

valueFraction * U + (1 - valueFraction) * dU/dy = 0

is not dimensionally consistent !!

i think it should be

valueFraction * U + (1 - valueFraction) *dU= 0

which dU is only the velocity difference

any comments ?

thanks

openfoam1 October 6, 2010 16:48

Quote:

Originally Posted by zhoubinwx (Post 218623)
Hello,

Can I ask in " valueFraction*U + (1-valueFraction)*dU = 0 ", dU means the normal gradient of U, i.e. dU/dn, or just the difference between internalField velocity and boundary velocity?

Bin

That is a good post

dU is not dU/dn it is just the difference between internalField velocity and boundary velocity

because the equation must be dimensionally consistent

by the way , i verified it using simple mesh and icoFoam solver

thank you

makaveli_lcf October 7, 2010 02:31

It is not necessary to guess what is what. Just have a look at the source code, otherwise why do we need it)))

So, from mixedFvPatchField.C:

Code:

00142 template<class Type>
00143 void mixedFvPatchField<Type>::evaluate(const Pstream::commsTypes)
00144 {
00145    if (!this->updated())
00146    {
00147        this->updateCoeffs();
00148    }
00149
00150    Field<Type>::operator=
00151    (
00152        valueFraction_*refValue_
00153      +
00154        (1.0 - valueFraction_)*
00155        (
00156            this->patchInternalField()
00157          + refGrad_/this->patch().deltaCoeffs()
00158        )
00159    );
00160
00161    fvPatchField<Type>::evaluate();
00162 }
00163
00164
00165 template<class Type>
00166 tmp<Field<Type> > mixedFvPatchField<Type>::snGrad() const
00167 {
00168    return
00169        valueFraction_
00170        *(refValue_ - this->patchInternalField())
00171        *this->patch().deltaCoeffs()
00172      + (1.0 - valueFraction_)*refGrad_;
00173 }

That mean,

U_wall = valueFraction*U0 + (1 - valueFraction)*(U_nearwall + Grad0 * dn)

where U0 and Grad0 are our given reference values for boundary field and gradient at the wall. dn is the distance between center of the cell and the boundary face. Now it is possible to transform this condition in whatever form is necessary))) All gradients and matrix coefficients are calculated using this relation.

Good luck!

argonaut February 17, 2011 10:15

To implement something like this
Quote:

Originally Posted by makaveli_lcf (Post 212483)
T - T_ext - k_f /h_f * d(T)/dn = 0 (3)

you could use groovyBC from swak4foam in the similar manner like the following code:
Code:

rightWall
{
    type                  groovyBC;
    variables              "h_f=20.0;T_ext=20.0;k_f=0.2;";
    valueExpression    "T_ext";
    fractionExpression  "1.0/(1.0 + k_f/(mag(delta())*h_f))";
}

For explanation, see thread Mixed BC - heat transfer - laplacianFoam

Kanarya February 8, 2012 13:31

Partial slip boundary
 
thank u in advance!

Kanarya February 17, 2012 11:26

ParticalSlip in OpenFOAM210
 
hi Foamers,

I am trying to compile particleSlip BC but it gives me error. can it be because of the version of OpenFoam because Alberto did code 2009 or 2010?can be the headers are different?
The error is:
Make/linux64GccDPOpt/particleSlipJohnsonJacksonFvPatchVectorField.o: In function `_GLOBAL__sub_I_particleSlipJohnsonJacksonFvPatchV ectorField.C':
particleSlipJohnsonJacksonFvPatchVectorField.C:(.t ext.startup+0xaf): undefined reference to `Foam::fvPatchField<Foam::Vector<double> >::constructpatchConstructorTables()'
particleSlipJohnsonJacksonFvPatchVectorField.C:(.t ext.startup+0xcc): undefined reference to `Foam::fvPatchField<Foam::Vector<double> >::patchConstructorTablePtr_'
particleSlipJohnsonJacksonFvPatchVectorField.C:(.t ext.startup+0xef): undefined reference to `Foam::fvPatchField<Foam::Vector<double> >::constructpatchMapperConstructorTables()'
particleSlipJohnsonJacksonFvPatchVectorField.C:(.t ext.startup+0x10f): undefined reference to `Foam::fvPatchField<Foam::Vector<double> >::patchMapperConstructorTablePtr_'
particleSlipJohnsonJacksonFvPatchVectorField.C:(.t ext.startup+0x132): undefined reference to `Foam::fvPatchField<Foam::Vector<double> >::constructdictionaryConstructorTables()'
particleSlipJohnsonJacksonFvPatchVectorField.C:(.t ext.startup+0x152): undefined reference to `Foam::fvPatchField<Foam::Vector<double> >::dictionaryConstructorTablePtr_'
collect2: ld returned 1 exit status

someone can help me?

Thanks in advance

Kanarya February 27, 2012 16:34

particleSlipJohnsonJackson
 
Hi Foamers,

I would like to apply particleSlip BCs but I have following error and I could not find out the problem...please help me..
Create mesh for time = 0


Reading g
Reading transportProperties



--> FOAM FATAL ERROR:

request for dictionary kineticTheoryProperties from objectRegistry region0 failed
available objects of type dictionary are

4
(
fvSchemes
fvSolution
data
transportProperties
)


From function objectRegistry::lookupObject<Type>(const word&) const
in file /opt/openfoam201/src/OpenFOAM/lnInclude/objectRegistryTemplates.C at line 131.

FOAM aborting

#0 Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam201/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#1 Foam::error::abort() in "/opt/openfoam201/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#2 Foam::IOdictionary const& Foam::objectRegistry::lookupObject<Foam::IOdiction ary>(Foam::word const&) const in "/opt/openfoam201/platforms/linuxGccDPOpt/lib/libfiniteVolume.so"
#3 Foam::particleSlipJohnsonJacksonFvPatchVectorField ::updateCoeffs() in "/home/recepkati/OpenFOAM/recepkati-2.0.1/platforms/linuxGccDPOpt/lib/libJohnsonJackson.so"
#4 Foam:artialSlipFvPatchField<Foam::Vector<double> >::evaluate(Foam::UPstream::commsTypes) in "/opt/openfoam201/platforms/linuxGccDPOpt/lib/libfiniteVolume.so"
#5 Foam:articleSlipJohnsonJacksonFvPatchVectorField:a rticleSlipJohnsonJacksonFvPatchVectorField(Foam::f vPatch const&, Foam::DimensionedField<Foam::Vector<double>, Foam::volMesh> const&, Foam::dictionary const&) in "/home/recepkati/OpenFOAM/recepkati-2.0.1/platforms/linuxGccDPOpt/lib/libJohnsonJackson.so"
#6 Foam::fvPatchField<Foam::Vector<double> >::adddictionaryConstructorToTable<Foam::particleS lipJohnsonJacksonFvPatchVectorField>::New(Foam::fv Patch const&, Foam:imensionedField<Foam::Vector<double>, Foam::volMesh> const&, Foam::dictionary const&) in "/home/recepkati/OpenFOAM/recepkati-2.0.1/platforms/linuxGccDPOpt/lib/libJohnsonJackson.so"
#7 Foam::fvPatchField<Foam::Vector<double> >::New(Foam::fvPatch const&, Foam::DimensionedField<Foam::Vector<double>, Foam::volMesh> const&, Foam::dictionary const&) in "/opt/openfoam201/platforms/linuxGccDPOpt/bin/twoPhaseEulerFoam"
#8 Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>::GeometricBoundaryField::GeometricB oundaryField(Foam::fvBoundaryMesh const&, Foam::DimensionedField<Foam::Vector<double>, Foam::volMesh> const&, Foam::dictionary const&) in "/opt/openfoam201/platforms/linuxGccDPOpt/bin/twoPhaseEulerFoam"
#9 Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>::readField(Foam::dictionary const&) in "/opt/openfoam201/platforms/linuxGccDPOpt/bin/twoPhaseEulerFoam"
#10 Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>::readField(Foam::Istream&) in "/opt/openfoam201/platforms/linuxGccDPOpt/bin/twoPhaseEulerFoam"
#11 at phaseModel.C:0
#12 Foam::phaseModel::phaseModel(Foam::fvMesh const&, Foam::dictionary const&, Foam::word const&) in "/home/recepkati/OpenFOAM/recepkati-2.0.1/platforms/linuxGccDPOpt/lib/libphaseModel.so"
Aborted
thanks in advance..

makaveli_lcf February 28, 2012 02:46

Quote:

request for dictionary kineticTheoryProperties from objectRegistry region0 failed
available objects of type dictionary are
You need that dictionary for your solver.

Kanarya February 28, 2012 05:22

particleSlipJohnsonJackson
 
Hi Alex,

thank you very much for your quick answer. I have already the directory there. I am using twoPhaseEulerFoam solver and I implement particleSlipJohnsonJackson BC in the model which is also from tutorials case "bed2".my file looks like:
dimensions [0 1 -1 0 0 0 0];

internalField uniform (0 0 0);

boundaryField
{
walls
{
type particleSlipJohnsonJackson;
specularityCoefficient 0.5;

}
outlet
{
type zeroGradient;
}
inlet
{
type fixedValue;
value uniform (0 0 0);
}
frontAndBackPlanes
{
type empty;
}
}

I changed BC of the walls.

and I have the directory kineticTheoryProperties in the model.

thanks a lot again

makaveli_lcf February 28, 2012 05:25

Quote:

and I have the directory kineticTheoryProperties in the model.
That should be a file in "constant/" folder, see
bed2/constant/kineticTheoryProperties

in tutorial

Kanarya February 28, 2012 05:33

particleSlipJohnsonJackson
 
1 Attachment(s)
Hi Alex,
yes I had a look to this file but I could not find the problem what I should add there?

I attached the code as well.

thank you very much and I appreciate your time to send me this suggestions.

recep

makaveli_lcf February 28, 2012 06:46

Do you have this file in your case folder?

makaveli_lcf February 28, 2012 06:48

Ok, if you look in your BC file

Quote:

void particleSlipJohnsonJacksonFvPatchVectorField::upda teCoeffs()
{
if (updated())
{
return;
}

if ((specularityCoefficient_ < 0) || (specularityCoefficient_ > 1))
{
FatalErrorIn
(
"particleSlipJohnsonJacksonFvPatchScalarField: :"
"updateCoeffs()"
) << "The value of the specularity coefficient has to be between 0 and 1."
<< abort(FatalError);
}

const dictionary& transportProperties = db().lookupObject<IOdictionary>
(
"transportProperties"
);

const dictionary& kineticTheoryProperties = db().lookupObject<IOdictionary>
(
"kineticTheoryProperties"
);

...
so your BC looks for the dictionary kineticTheoryProperties in the memory,
but does not find.

Which solver do you use?

Kanarya February 28, 2012 06:49

particleSlipJohnsonJackson
 
hi Alex,

I think you forget to say the name of the file, which file?

best regards and thanks again

recep

makaveli_lcf February 28, 2012 06:50

no, that which you send me

Kanarya February 28, 2012 06:52

particleSlipJohnsonJackson
 
hi Alex

I am using twoPhaseEulerFoam.

yes, I understood the problem but I do not know how to modify it.

thanks

Recep


All times are GMT -4. The time now is 20:41.