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

LAPLACIAN FOAM for solid/fluid region in a slab

Register Blogs Community New Posts Updated Threads Search

Like Tree6Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 6, 2015, 04:12
Smile LAPLACIAN FOAM for solid/fluid region in a slab
  #1
New Member
 
Join Date: Mar 2015
Posts: 25
Rep Power: 11
Arslan Arshad is on a distinguished road
I am new to OpenFOAM so i dont know how to solve the laplacianfoam for the case of two materials present in a slab?
in that case how to mention two region properties and where?
Please can anyone help me.


Thanks in Advance

Last edited by Arslan Arshad; April 6, 2015 at 04:13. Reason: wrong titles
Arslan Arshad is offline   Reply With Quote

Old   April 15, 2015, 15:09
Default
  #2
New Member
 
mostafa raeisi
Join Date: Dec 2014
Posts: 14
Rep Power: 11
mostafa R is on a distinguished road
Hi
u can define new volscalarField of properties for your domain and use it in your code.
mostafa R is offline   Reply With Quote

Old   April 15, 2015, 20:21
Default
  #3
New Member
 
Join Date: Mar 2015
Posts: 25
Rep Power: 11
Arslan Arshad is on a distinguished road
Hi
Thanks for the reply, but tell me how i am new to OpenFoam.
Arslan Arshad is offline   Reply With Quote

Old   April 16, 2015, 04:24
Default
  #4
New Member
 
mostafa raeisi
Join Date: Dec 2014
Posts: 14
Rep Power: 11
mostafa R is on a distinguished road
define a new volscalarfield in file "arslan.H" for example and type :
//---------------------------------------------------------
#include "createMesh.H"

volScalarField dT
(
IOobject
(
"dT",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
//--------------------------------------------------------------

("dT" is such diffusion number)

if u want solve thermal or electrical field in your domain with different material this file has read with your code.

so u must create "dT" file such as "T" file in your "0" folder (0 - constant - system)

after this, for initializing the dT constant properties like u want append subsequent code end of write "volScalarField dT ......" :::::

//--------------------------------------------------------------------

dT.intenalField() [ mesh.cellZones()[0] ] = dT_0;
dT.intenalField() [ mesh.cellZones()[1] ] = dT_1;
.
.
.
//---------------------------------------------------------------------


because of error in "check dimension" set dimension dimensionless :
@ T , dT file
[0 0 0 0 0 0 0 0]

in body of main source code :

//--------------------------------------------------
#include "arslan.H"
slove(..
.
.
.
.
)
//--------------------------------------------------

Arslan Arshad likes this.
mostafa R is offline   Reply With Quote

Old   April 16, 2015, 04:28
Default
  #5
New Member
 
mostafa raeisi
Join Date: Dec 2014
Posts: 14
Rep Power: 11
mostafa R is on a distinguished road
of course in T file dimension set :

[0 2 0 0 0 0 0 0]

for eliminate Laplace operator dimension
mostafa R is offline   Reply With Quote

Old   April 16, 2015, 04:36
Default
  #6
New Member
 
mostafa raeisi
Join Date: Dec 2014
Posts: 14
Rep Power: 11
mostafa R is on a distinguished road
plz che ck this solver:

chtMultiRegionFoam

perhaps good for your attend
Arslan Arshad likes this.
mostafa R is offline   Reply With Quote

Old   April 17, 2015, 03:22
Default
  #7
New Member
 
Join Date: Mar 2015
Posts: 25
Rep Power: 11
Arslan Arshad is on a distinguished road
"dT.intenalField() [ mesh.cellZones()[0] ] = dT_0;
dT.intenalField() [ mesh.cellZones()[1] ] = dT_1;"


I want to make Slab (2-D) geometry in gambit and want to divide my length in 2 equal parts lets say 0.5m each.
Then how to mention cell zone in my case
Arslan Arshad is offline   Reply With Quote

Old   April 17, 2015, 10:16
Wink
  #8
New Member
 
mostafa raeisi
Join Date: Dec 2014
Posts: 14
Rep Power: 11
mostafa R is on a distinguished road
in gambit create 2 rectangle volume (for example) that face between them is "interior"
remember geometry must be 3D;

set name of left volume be "left"
set name of right volume be "right"
(next tab u set bc in gambit : "fluid")

and type of bc must be wall with different name(this is for refuse unscheduled ERROR)
after using " fluent3DTo.... name.msh " command in boundary file change the type of bc from wall to everything u want...

when this is done u have :
cellzones - faceZones file and u can see inner cellZones file like this:

'''''''''''''''''''''''''''''''''''''''''
4
(
liq
{
type cellZone;
cellLabels List<label>
10620
(
0
1
2
3
4
.
.
.
''''''''''''''''''''''''''''''''''''''''''''''''
mostafa R is offline   Reply With Quote

Old   April 19, 2015, 11:40
Default
  #9
New Member
 
Join Date: Mar 2015
Posts: 25
Rep Power: 11
Arslan Arshad is on a distinguished road
Thank you for your help

I have tried with the geometry you told and coding but something is wrong.
I dont know what is wrong. Please tell me your email id. I will send the geometry files. Check it.

I shall be very thankful to you.
Arslan Arshad is offline   Reply With Quote

Old   April 19, 2015, 11:43
Default
  #10
New Member
 
Join Date: Mar 2015
Posts: 25
Rep Power: 11
Arslan Arshad is on a distinguished road
Link to geometry file is given below:

https://www.mediafire.com/?52cc7cd7x2qwge8
Arslan Arshad is offline   Reply With Quote

Old   April 22, 2015, 02:26
Default
  #11
New Member
 
mostafa raeisi
Join Date: Dec 2014
Posts: 14
Rep Power: 11
mostafa R is on a distinguished road
hi
i check this and reply to u
Arslan Arshad likes this.
mostafa R is offline   Reply With Quote

Old   April 22, 2015, 18:24
Default
  #12
New Member
 
Join Date: Mar 2015
Posts: 25
Rep Power: 11
Arslan Arshad is on a distinguished road
Hi
Thank You
Arslan Arshad is offline   Reply With Quote

Old   April 23, 2015, 00:57
Default
  #13
New Member
 
mostafa raeisi
Join Date: Dec 2014
Posts: 14
Rep Power: 11
mostafa R is on a distinguished road
hi again

I look inside file and check it in gambit:

you first create sides (out cubic) BC (interior - left - right - and sides that not applied)
and export *.msh file

create root folder for your running on linux (without any " "/space/ character like : "new folder")
it has an ERROR

inside this file create and put (constant - system) sub root folder
in constant folder : create empty folder polyMesh

finally run this :
fluent3DMeshToFoam *.msh

* is file name

after this ,go to polyMesh folder and look inside CellZone - faceZone files

Arslan Arshad likes this.
mostafa R is offline   Reply With Quote

Old   April 23, 2015, 21:50
Default
  #14
New Member
 
Join Date: Mar 2015
Posts: 25
Rep Power: 11
Arslan Arshad is on a distinguished road
I tried the procedure u told me.
i made "arslan.H" file and include in my code "#include arslan.H"

but when i gave command in terminal "wmake" for compilation of dependency file i got the following error.
--------------------------------------------------------------------------------------------
In file included from laplacianFoam.C:71:0:
arslan.H: In function ‘int main(int, char**)’:
arslan.H:19:4: error: no match for call to ‘(Foam::volScalarField {aka Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>}) ()’
arslan.H:20:4: error: no match for call to ‘(Foam::volScalarField {aka Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>}) ()’
arslan.H:39:7: error: no match for call to ‘(Foam::volScalarField {aka Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>}) ()’
arslan.H:40:7: error: no match for call to ‘(Foam::volScalarField {aka Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>}) ()’
make: *** [Make/linux64GccDPOpt/laplacianFoam.o] Error 1
-------------------------------------------------------------------------------------------

what should i do?
Arslan Arshad is offline   Reply With Quote

Old   April 23, 2015, 21:51
Default
  #15
New Member
 
Join Date: Mar 2015
Posts: 25
Rep Power: 11
Arslan Arshad is on a distinguished road
Also i am attaching the file "arslan.H" please check it too.
its urgent i have to submit this work in a week.
Attached Files
File Type: h arslan.H (750 Bytes, 10 views)
Arslan Arshad is offline   Reply With Quote

Old   April 23, 2015, 21:52
Default
  #16
New Member
 
Join Date: Mar 2015
Posts: 25
Rep Power: 11
Arslan Arshad is on a distinguished road
Thanks in advance.
Arslan Arshad is offline   Reply With Quote

Old   April 24, 2015, 11:12
Default
  #17
New Member
 
mostafa raeisi
Join Date: Dec 2014
Posts: 14
Rep Power: 11
mostafa R is on a distinguished road
i see.
//---------------------------------------------------------//
#include "createMesh.H"

Info<< "Reading field DT\n" << endl;

volScalarField DT
(
IOobject
(
"DT",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);

// edit :

double dt[2] = {0.0087, 0.0084};

forAll(mesh.cellZones(),i)
{
forAll(mesh.cellZones()[i],j)
{
int index = mesh.cellZoens()[i][j];
DT.internalField()[index] = dt[i]; // (i don't remember - maybe DT.internalFields() )
}
}

////////////////////////////////

do this for k

and then if the BC not set u can set them
by this variables:

DT.boundaryField()[][]

mesh.faceZones() // like zones this is for interface BC

enjoy it
mostafa R is offline   Reply With Quote

Old   April 26, 2015, 04:52
Default
  #18
New Member
 
Join Date: Mar 2015
Posts: 25
Rep Power: 11
Arslan Arshad is on a distinguished road
i am still facing errors i will send you my solver with geometry.......i hope u will check it.
Arslan Arshad is offline   Reply With Quote

Old   April 26, 2015, 06:36
Default
  #19
New Member
 
mostafa raeisi
Join Date: Dec 2014
Posts: 14
Rep Power: 11
mostafa R is on a distinguished road
send your errors

i do this and works good
mostafa R is offline   Reply With Quote

Old   April 26, 2015, 08:24
Default
  #20
New Member
 
Join Date: Mar 2015
Posts: 25
Rep Power: 11
Arslan Arshad is on a distinguished road
I am attaching the solver
please u have the geometry link
and there is nothing in "polyMesh" folder it is empty.
(please use the command fluent3DMeshToFoam HSlab.msh)

and when you use the command "wmake" for compilation of dependency file.
error appears
please check i think i have some errors in declaration

Thank You
Attached Files
File Type: zip laplacianFoam.zip (15.7 KB, 20 views)
Arslan Arshad 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
[blockMesh] Errors during blockMesh meshing Madeleine P. Vincent OpenFOAM Meshing & Mesh Conversion 51 May 30, 2016 10:51
[OpenFOAM] Take derivative of mean velocity in paraFoam hiuluom ParaView 13 April 26, 2016 06:44
laplacian foam simulating diffusion through a porous media mcdonalds OpenFOAM Running, Solving & CFD 1 February 1, 2015 16:51
[Gmsh] GmshToFoam FOAM FATAL ERROR faces deallocated Tobias Prousa (Prousa) OpenFOAM Meshing & Mesh Conversion 14 January 31, 2012 10:45
Nonconvergence in a multiple region Laplacian problem kmurphy OpenFOAM Running, Solving & CFD 4 June 8, 2006 04:40


All times are GMT -4. The time now is 02:18.