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

Marangoni bc

Register Blogs Community New Posts Updated Threads Search

Like Tree7Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 6, 2007, 11:59
Default Hi all, I am trying to spec
  #1
New Member
 
Zaki Saldi
Join Date: Mar 2009
Posts: 18
Rep Power: 17
zakifoam is on a distinguished road
Hi all,

I am trying to specify Marangoni boundary condition on the top boundary of a cavity. At first, I am trying to 'enforce' this b.c in the main code I am using (boussinesqBouyantFoam). Later, I will try to learn how to incorporate it in a new b.c library (i.e the elegant way).

The b.c is:

du/dy = (dSigma/dT)*(dT/dx)/mu
dw/dy = (dSigma/dT)*(dT/dz)/mu

where (dSigma/dT) is temperature gradient of surface tension, assumed to be constant.

The implementation is as follows:

=================================================
volVectorField gradT = fvc::grad(T);

volScalarField dTdx = gradT.component(0);
volScalarField dTdy = gradT.component(1);
volScalarField dTdz = gradT.component(2);

label patchI1 = mesh.boundaryMesh().findPatchID("top");

volScalarField u = U.component(0);
volScalarField v = U.component(1);
volScalarField w = U.component(2);

fixedGradientFvPatchScalarField& bufferu = refCast<fixedgradientfvpatchscalarfield>(u.boundar yField()[patchI1]);
fixedGradientFvPatchScalarField& bufferv = refCast<fixedgradientfvpatchscalarfield>(v.boundar yField()[patchI1]);
fixedGradientFvPatchScalarField& bufferw = refCast<fixedgradientfvpatchscalarfield>(w.boundar yField()[patchI1]);

scalarField graduyTop = bufferu.snGrad();
scalarField gradwyTop = bufferw.snGrad();

fvPatchScalarField& dTdxTop = dTdx.boundaryField()[patchI1];
fvPatchScalarField& dTdzTop = dTdz.boundaryField()[patchI1];

forAll (graduyTop, faceI1)
{
graduyTop[faceI1] = dsigmadT.value()*dTdxTop[faceI1]/mu.value();
}

forAll (gradwyTop, faceI1)
{
gradwyTop[faceI1] = dsigmadT.value()*dTdzTop[faceI1]/mu.value();
}

=================================================

There was no error message upon compiling. For the simulation, I used fixedGradient b.c for velocity at top surface, i.e:

in 0/U:

top
{
type fixedGradient;
gradient uniform (0 0 0);
}

When running the simulation, I got this error message:

--> FOAM FATAL ERROR : Attempt to cast type calculated to type fixedGradient

From function refCast<to>(From&)
in file /home/zaki/OpenFOAM/OpenFOAM-1.3/src/OpenFOAM/lnInclude/typeInfo.H at line 103.

FOAM aborting

Foam::error::printStack(Foam:stream&)
Foam::error::abort()
marangoniFoam [0x4142cb]
__libc_start_main
__gxx_personality_v0


Could anyone explain and help me with this problem?

Thanks,

zaki
zakifoam is offline   Reply With Quote

Old   November 8, 2007, 05:14
Default Hi Zaid, I have not really
  #2
Senior Member
 
Thomas Jung
Join Date: Mar 2009
Posts: 102
Rep Power: 17
tehache is on a distinguished road
Hi Zaid,

I have not really lookked at your error - but I have implemented (and tested) a Marangoni boundary condition.
Have a look at it, maybe it serves you.

regards,

Thomas

marangoniFvPatchVectorField.H
marangoniFvPatchVectorField.C
jie.chen likes this.
tehache is offline   Reply With Quote

Old   January 22, 2008, 13:46
Default Hi Thomas, Thanks for the b
  #3
New Member
 
Zaki Saldi
Join Date: Mar 2009
Posts: 18
Rep Power: 17
zakifoam is on a distinguished road
Hi Thomas,

Thanks for the b.c code you provided. Sorry for not replying for long time since I've been busy with other things. Now I want to concentrate back on marangoni b.c.

I tried to compile the marangoni b.c but I got the following error:

/home/zaki/OpenFOAM/OpenFOAM-1.4.1/src/finiteVolume/lnInclude/fvPatchField.H:132 : instantiated from 'Foam::fvPatchField<type>::adddictionaryConstructo rToTable<fvpatchfieldtype>:: adddictionaryConstructorToTable(const Foam::word&) [with fvPatchFieldType = Foam::marangoniFvPatchVectorField, Type = Foam::Vector<double>]'
marangoniFvPatchVectorField.C:228: instantiated from here
/home/zaki/OpenFOAM/OpenFOAM-1.4.1/src/finiteVolume/lnInclude/fvPatchField.H:132 : error: cannot allocate an object of abstract type 'Foam::marangoniFvPatchVectorField'
marangoniFvPatchVectorField.H:51: note: since type 'Foam::marangoniFvPatchVectorField' has pure virtual functions
make: *** [Make/linux64GccDPOpt/marangoniFvPatchVectorField.o] Error 1

Could you explain what might happen?

Thanks

zaki
zakifoam is offline   Reply With Quote

Old   February 25, 2008, 07:35
Default Hi Zaki, I think that versi
  #4
Senior Member
 
Thomas Jung
Join Date: Mar 2009
Posts: 102
Rep Power: 17
tehache is on a distinguished road
Hi Zaki,

I think that version I posted worked for OpenFoam-1.3.
I have a version adapted to version 1.4.1, which you are apparently using, but I have to say I right now do not remember if I tested that. I have set up an installation for 1.4.1 some time ago, compiled it, but am actually still using the 1.4 version. So, here, at your own risk, the 1.4.1 version.
Please note, that in 1.4.1 also the directory structure in fvPatchFields changed, if I remember correctly.

Good luck...

Thomas

marangoniFvPatchVectorField.H
marangoniFvPatchVectorField.C
jie.chen likes this.
tehache is offline   Reply With Quote

Old   February 25, 2008, 11:51
Default Hi Thomas, Thanks a lot! ht
  #5
New Member
 
Zaki Saldi
Join Date: Mar 2009
Posts: 18
Rep Power: 17
zakifoam is on a distinguished road
Hi Thomas,

Thanks a lot! The compilation was successfully done. Now I'm trying to run a test case.

zaki
zakifoam is offline   Reply With Quote

Old   January 19, 2009, 17:10
Default Hi Thomas and Zaki, Is it
  #6
Senior Member
 
Michael Jaworski
Join Date: Mar 2009
Location: Champaign, IL, USA
Posts: 126
Rep Power: 17
mike_jaworski is on a distinguished road
Hi Thomas and Zaki,
Is it possible for one of you to upload an example solver and case file using this boundary file?

Thanks,
Mike J.
mike_jaworski is offline   Reply With Quote

Old   January 21, 2009, 19:16
Default Hello FOAMers, I am havi
  #7
Senior Member
 
Michael Jaworski
Join Date: Mar 2009
Location: Champaign, IL, USA
Posts: 126
Rep Power: 17
mike_jaworski is on a distinguished road
Hello FOAMers,
I am having difficulty getting the marangoni BC to operate correctly and I am hoping for a hint about what I am doing wrong.

First, I am integrating this BC into a solver which uses the conjugateHeatFoam as a template and so have two mesh regions coupled by the energy equation (the fluid portion is replaced with the mhdFoam solver).

Second, I have compiled the BC with the help of the instructions here. It compiles and apparently links correctly.

Third, I have a case file and the <case>/0/U file includes the BC as follows:
Quote:
boundaryField
{
movingWall
{
type marangoni;
marangonicoeff 0.147e-3;
}
Now, when I run the case like this, I get a message that reads:
Quote:
marangoniFvPatchVectorField::snGrad(): object gradT not found!
and no flow. So, looking at the source code which Thomas above supplied, I find the following line:
Quote:
if(!db().foundObject<vectorfield>("gradT")) {
Info << " marangoniFvPatchVectorField::snGrad(): object gradT not found!" << endl;
I think to myself: ah, it expects me to create a volVectorField called gradT somewhere in the solver to calculate this material.

I dutifully add the line:
Quote:
volVectorField gradT = fvc::grad(T);
underneath the reading in of the temperature field in the solver code.

The solver compiles without a hitch.

However, when I run the solver, I get the following error message:
Quote:
Reading field p

Reading field T

Creating field grad(T)


request for volScalarField T from objectRegistry solid failed
available objects of type volScalarField are

0
(
)


From function objectRegistry::lookupObject<type>(const word&) const
in file /home/mjaworsk/OpenFOAM/OpenFOAM-1.5-dev/src/OpenFOAM/lnInclude/objectRegistryTe mplates.C at line 142.

FOAM aborting

Aborted
Ack!

Can anyone help me with this error?

Thank you,
Mike J.
mike_jaworski is offline   Reply With Quote

Old   January 22, 2009, 08:20
Default Hi Mike, The BC is looking
  #8
Member
 
Kati Laakkonen
Join Date: Mar 2009
Location: Espoo, Finland
Posts: 35
Rep Power: 17
kati is on a distinguished road
Hi Mike,

The BC is looking for gradT in database, so you should create it like you do for fields that are written and read from time dumps, i.e. something with IOobject.

Regards,
Kati
kati is offline   Reply With Quote

Old   January 23, 2009, 03:48
Default Hi Kati, This did, indeed
  #9
Senior Member
 
Michael Jaworski
Join Date: Mar 2009
Location: Champaign, IL, USA
Posts: 126
Rep Power: 17
mike_jaworski is on a distinguished road
Hi Kati,
This did, indeed, solve my problem. Thank you.
Regards,
Mike J.
mike_jaworski is offline   Reply With Quote

Old   April 20, 2009, 11:56
Default
  #10
New Member
 
Atsuko Ishida
Join Date: Apr 2009
Posts: 1
Rep Power: 0
Hanna is on a distinguished road
Hello,
I'm new to OpenFOAM and C++ language.
I have a diffucult using the "MarangoniFvPatchVectorField".

Now, I am bringing this BC in solver (icoheatMaFOAM).
However, I couldn't compile the solver and getting following error message.

…/lnInclude/marangoniFvPatchVectorField.H:107: error: cannot allocate an object of abstract type ‘Foam::marangoniFvPatchVectorField’

…/lnInclude/marangoniFvPatchVectorField.H:58: note: because the following virtual functions are pure within ‘Foam::marangoniFvPatchVectorField’:
…/lnInclude/transformFvPatchField.H:109: note: Foam::tmp<Foam::fvPatchField<Type> > Foam::transformFvPatchField<Type>::clone(const Foam:imensionedField<Type, Foam::volMesh>&) const [with Type = Foam::Vector<double>]
…/lnInclude/marangoniFvPatchVectorField.H: In member function ‘virtual Foam::tmp<Foam::fvPatchField<Foam::Vector<double> > > Foam::marangoniFvPatchVectorField::clone(const Foam::vectorField&) const’:
…/lnInclude/marangoniFvPatchVectorField.H:123: error: cannot allocate an object of abstract type ‘Foam::marangoniFvPatchVectorField’
…/lnInclude/marangoniFvPatchVectorField.H:58: note: since type ‘Foam::marangoniFvPatchVectorField’ has pure virtual functions



Could anyone help me with this error.
Thank you.

Hanna
Hanna is offline   Reply With Quote

Old   March 31, 2010, 14:15
Default
  #11
Senior Member
 
isabel
Join Date: Apr 2009
Location: Spain
Posts: 171
Rep Power: 17
isabel is on a distinguished road
Hello everybody,

I have succesfully compiled the boundary condition which Thomas tehache supplied.
In the solver, I have created the gradT as an IOobject:

volVectorField gradT
(
IOobject
(
"gradT",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
fvc::grad(T)
);

In the boundary conditions I wrote this:

boundaryField
{
type marangoni;
marangonicoeff 0.05;
}

The code compiles and runs ok. But when I execute the command foamDataToFluent (I am using Fluent as a posprocessor) I have the following warning:

Time = 0
Converting field pd
Converting field T
marangoniFvPatchVectorField::snGrad(): object gradT not found!
marangoniFvPatchVectorField::snGrad(): object gradT not found!
Converting field gradT

gradT is defined but the solver do not find it. And in the postprocessor I can see that gradT is not zero and is calculated oK.

Other problem is that the solver is not aplying this condition, i.e. although I set the marangonicoeff = 1000000, I have no difference between marangonicoeff = 0.05 or marangonicoeff = 0

Does anybody know which is the problem. May be the boundary conditions of temperature or velocity?
isabel is offline   Reply With Quote

Old   April 1, 2010, 09:25
Default
  #12
Senior Member
 
Thomas Jung
Join Date: Mar 2009
Posts: 102
Rep Power: 17
tehache is on a distinguished road
I have to leave now (urgent holidays...) ... but promise to post next week the version I am currently using with OpenFoam 1.6.x, where the value field is beeing written, and which needed changes to work with 1.6.x.

Thomas
tehache is offline   Reply With Quote

Old   April 9, 2010, 04:28
Default
  #13
Senior Member
 
Thomas Jung
Join Date: Mar 2009
Posts: 102
Rep Power: 17
tehache is on a distinguished road
I updated the boundary condition a little (its now writing also its value, was missing before..), and its working for me now with 1.6.x.
As the testcase was too large to upload here, please find it (and the B.C.) at the links given below.
Under the link named MarangoniTest I add a small testcase. Gravity is set to 0, Marangoni-Number is small in order to obtain a stationary and axisymmetric solution (although calculation is 3D), which I have compared to results from our own 2D-Code Crysmas, and with Fluent, results are (within some percent, did not check grid dependence..) the same.
Therefore, I personally trust it, but dont give any guarantee

I have run the testcase using a slightly modified buoyantBoussinesqSimpleFoam:

add this to createFields to store temperature gradients:

Info<< "Generating/reading field gradT\n" << endl;
volVectorField gradT
(
IOobject
(
"gradT",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
mesh,
dimensionSet(0,-1,0,1,0,0,0)
);
gradT=fvc::grad(T);


and add this in the solver code:

turbulence->correct();
-> gradT=fvc::grad(T);
runTime.write();


specify the B.C. in U as follows:
outerwall
{
type marangoni;
marangonicoeff -9.9e-06;
}

the marangonicoeff to specifiy is the usual marangonicoefficient (d sigma/dT) divided by DYNAMIC viscosity!




http://servww6.ww.uni-erlangen.de/~jung/marangoniFvPatchVectorField-1.6.x.tar.gz
http://servww6.ww.uni-erlangen.de/~jung/MarangoniTest.tar.gz


Thomas
fuguang and YeWang like this.
tehache is offline   Reply With Quote

Old   April 19, 2010, 04:19
Default
  #14
Senior Member
 
isabel
Join Date: Apr 2009
Location: Spain
Posts: 171
Rep Power: 17
isabel is on a distinguished road
Thank you very much, tehache. Now my problem works Ok.
isabel is offline   Reply With Quote

Old   February 15, 2012, 06:15
Default marangoni stress
  #15
New Member
 
U.Magarajan
Join Date: Nov 2011
Location: Vellore
Posts: 7
Rep Power: 15
magarajan84 is on a distinguished road
hey everyone,
i am trying to simulate selective laser sintering process with marangoni stress function wrt time as a boundary condition can u suggest me where i can apply this condition. i am using fluent as my solver and if udf is required can somebody help me with that..

thank you.
magarajan84 is offline   Reply With Quote

Old   June 13, 2013, 07:31
Default returning gradient at the boundary
  #16
Senior Member
 
Srivathsan N
Join Date: Jan 2013
Location: India
Posts: 101
Rep Power: 13
Sherlock_1812 is on a distinguished road
Hi everyone,

I have gone through the marangoniFvPatchVectorField.C file and I have difficulty in understanding parts of the code as I'm not very good at C++ and am new to OpenFOAM

what do the following lines of the code mean?
Code:
tmp<vectorField > marangoniFvPatchVectorField::snGrad() const
{
    //Info << "entering  marangoniFvPatchVectorField::snGrad()" << endl;
    vectorField nHat = this->patch().nf();
    vectorField pif = this->patchInternalField();
    vectorField result;
    if(!db().foundObject<vectorField>("gradT")) {
     Info << " marangoniFvPatchVectorField::snGrad(): object gradT not found!" << endl;
     Foam::error theError(" marangoniFvPatchVectorField::evaluate(): object gradT not found!");
    return transform(I - sqr(nHat),pif);
    }
    else {
    
     fvPatchField<vector> gradT =this->patch().lookupPatchField<volVectorField, vector>("gradT");
     vectorField  gradT_internal = gradT.patchInternalField();
     vectorField gradTplane= transform(I - sqr(nHat),gradT_internal);
     vectorField pifplane= transform(I - sqr(nHat),pif);
    result=pifplane+marangonicoeff_*gradTplane/this->patch().deltaCoeffs();
    return (result-pif)*this->patch().deltaCoeffs();
    }
    //Info << "leaving  marangoniFvPatchVectorField::snGrad()" << endl;    
    return result;
}
What does transform do? Does it help us in returning a gradient along the boundary?


Thanks in advance.

Srivaths
Sherlock_1812 is offline   Reply With Quote

Old   June 14, 2013, 07:40
Default
  #17
Senior Member
 
Thomas Jung
Join Date: Mar 2009
Posts: 102
Rep Power: 17
tehache is on a distinguished road
Hi sherlock (and others),

As I am getting a lot of private messages regarding the Marangoni B.C.:
I posted this thing 4 years ago just as an example of how I tried to solve the problem, not as something I would consider a good programming example.
It worked for me, and some others, in OpenFoam 1.6, since then, I have not touched it, and actually dont really remember what I did and why.

Perhaps I should not have posted it.

As far as I remember, the transform you are asking for gives the projection of the patch internal vector field onto the patch plane, I think you can figure that out looking at the implementation of the base class, transformFvPatchVectorField.

God luck!
tehache is offline   Reply With Quote

Old   June 15, 2013, 01:37
Default Many thanks
  #18
Senior Member
 
Srivathsan N
Join Date: Jan 2013
Location: India
Posts: 101
Rep Power: 13
Sherlock_1812 is on a distinguished road
Hi Thomas,

Thank you. I shall have a look at the base class to try and understand this better.
__________________
Regards,

Srivaths
Sherlock_1812 is offline   Reply With Quote

Old   August 30, 2013, 08:04
Default
  #19
Senior Member
 
Srivathsan N
Join Date: Jan 2013
Location: India
Posts: 101
Rep Power: 13
Sherlock_1812 is on a distinguished road
Hello all,

I have a 2 questions.
Firstly, I have a doubt in the volVectorField definition of gradT. Why is it READ_IF_PRESENT? I'm not able to view the test case attached and so i'm not able to have a look into the 0/gradT file.

Second, if the internal and boundary fields are at constant temperature initially, won't gradT have the same value at all points?

Kindly excuse me if the questions are too naive. I have just started with OpenFOAM.
__________________
Regards,

Srivaths
Sherlock_1812 is offline   Reply With Quote

Old   May 18, 2017, 16:37
Default
  #20
Member
 
Tarang
Join Date: Feb 2011
Location: Delhi, India
Posts: 47
Rep Power: 15
gtarang is on a distinguished road
Quote:
Originally Posted by tehache View Post
I updated the boundary condition a little (its now writing also its value, was missing before..), and its working for me now with 1.6.x.
As the testcase was too large to upload here, please find it (and the B.C.) at the links given below.
Under the link named MarangoniTest I add a small testcase. Gravity is set to 0, Marangoni-Number is small in order to obtain a stationary and axisymmetric solution (although calculation is 3D), which I have compared to results from our own 2D-Code Crysmas, and with Fluent, results are (within some percent, did not check grid dependence..) the same.
Therefore, I personally trust it, but dont give any guarantee

I have run the testcase using a slightly modified buoyantBoussinesqSimpleFoam:

add this to createFields to store temperature gradients:

Info<< "Generating/reading field gradT\n" << endl;
volVectorField gradT
(
IOobject
(
"gradT",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
mesh,
dimensionSet(0,-1,0,1,0,0,0)
);
gradT=fvc::grad(T);


and add this in the solver code:

turbulence->correct();
-> gradT=fvc::grad(T);
runTime.write();


specify the B.C. in U as follows:
outerwall
{
type marangoni;
marangonicoeff -9.9e-06;
}

the marangonicoeff to specifiy is the usual marangonicoefficient (d sigma/dT) divided by DYNAMIC viscosity!




http://servww6.ww.uni-erlangen.de/~jung/marangoniFvPatchVectorField-1.6.x.tar.gz
http://servww6.ww.uni-erlangen.de/~jung/MarangoniTest.tar.gz


Thomas
Hello Thomas,
I am implementing the same boundary condition. However I want to ask, do we really need to update the solver application? There must be another way of adding this IOobject externally I mean through codeStream or function object. Pl. suggest.
-
Tarang
gtarang is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Marangoni stress, help!! dong FLUENT 2 February 23, 2024 13:30
Marangoni flow Tao CFX 0 September 4, 2007 18:14
Marangoni Convection Rucy FLUENT 0 July 6, 2005 06:17
Marangoni Stress At the Wall Peter Nagy FLUENT 4 January 26, 2004 16:06
Marangoni VS Rayleigh-Bernard Peter Nagy FLUENT 2 January 12, 2004 10:53


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