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/)
-   -   Different material properties on the same mesh (http://www.cfd-online.com/Forums/openfoam-solving/58668-different-material-properties-same-mesh.html)

fw407 June 26, 2008 18:53

Hi everyone, I am trying to
 
Hi everyone,

I am trying to create a mesh which has different material properties on the specified domains of the mesh. I am thinking that maybe I can make the material properties a field, then I can define different properties on the specified domain. Is that possible? or could someone give me some better ideas on this problem?

Kind regards

feng

gschaider June 27, 2008 05:53

Hi feng! No that is the way
 
Hi feng!

No that is the way to go. As a simple example try to change the constant D to a field in the laplacianFoam-solver.

Bernhard

fw407 June 27, 2008 07:33

Hi Bernhard, Thanks for you
 
Hi Bernhard,

Thanks for your help!

I have defined the diffusivity to be a field, and specified different diffusivity in the "transportProperties" for different domains, but
I don't know how to specify the regions of the mesh with different diffusivity. I am thinking maybe a sub-domain for the mesh could help me, is that right?

Kind regards

feng

gschaider June 27, 2008 08:23

Hi Feng! If your regions ar
 
Hi Feng!

If your regions are rectangles then you can use the setField-utility (have a look at the damBreak-case). If you're going for something more fancy try funkySetFields. Or you'll have to program yourself a utility.

Bernhard

fw407 June 27, 2008 19:43

Hi Bernhard, I am trying to
 
Hi Bernhard,

I am trying to solve the stress distribution of a elastic body which has different Young's modulus. and "setFields" is a good starting point for me to solve such problems. I have defined the Young's modulus , Poisson ratio and lame's constant as a "volScalarField", then I added the "setFieldsDict" file in the "system" directory, which looks like:

/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

defaultFieldValues
(
volScalarFieldValue E 20000000
volVectorFieldValue nu 0.3
);

regions
(
boxToCell
{
box (0 2.5 -0.11) (2 3 0.132);

fieldValues
(
volScalarFieldValue E 2000000
);
}
);


// ************************************************** *********************** //

but when I use "setFields", I run into errors :

Setting field default values
--> FOAM Warning :
From function void setFieldType(const fvMesh& mesh, const labelList& selectedCells,Istream& fieldValueStream)
in file setFields.C at line 100
Field E not found


--> FOAM FATAL IO ERROR : wrong token type - expected word found on line 27 the label 20000000

file: /home/snail/OpenFOAM/snail-1.3/run/tutorials/materialStressedFoam/wedge/system/s etFieldsDict::defaultFieldValues at line 27.

From function operator>>(Istream&, word&)
in file primitives/strings/word/wordIO.C at line 67.

FOAM exiting

the error tells me that the field I defined for E is not found, How could I help the compiler find it?

Kind regards

feng

gschaider July 1, 2008 06:38

Sorry feng! I don't know an
 
Sorry feng!

I don't know anything about the setFields utility that isn't in the userguide.
But it seems to me that at least for nu to be a vector (really?) like you specified it shoul look something like this "(0.3 0 0)" or such

Bernhard

fw407 July 1, 2008 08:00

Hi Bernhard, Thanks for you
 
Hi Bernhard,

Thanks for your help!

It is a silly mistake(sorry about that). I have corrected it, but I still run into the same errors.

So far, I only define E and mu as a volScalarfield by IOobject, and create a "setFieldsDic" in the "system" directory, is that right?

Kind regards

feng

fw407 August 6, 2008 10:56

Hi everyone, So far, I have
 
Hi everyone,

So far, I haven't succed in achieving it, I think maybe it will be more helpful to make myself clear:

I want to creat a 3D unhealthy blood vessel, the geometry is acually a 3D straight pipe, at somewhere in the blood vessel innnerface, a small patch of the blood vessel innerface is unhealthy and the young's modulus following the Gaussian distribution and is much higher than some other places in the blood vessel.

Has anyone done this before or is there some utilities capable of doing this?

kind regards

feng

uwe August 6, 2008 12:42

Hi Feng, in the development v
 
Hi Feng,
in the development version of OF-1.4.1 you can find a tutorial for the solver newStressedFoam named plateHole. In the definition of the rheologyProperties you can find an example how to define different materials (multiMaterial).

Uwe

albem April 18, 2011 18:08

localized force with setField
 
1 Attachment(s)
Hi everybody

I am a new OpenFOAM user, and I want to add a source term (body force) to icoFoam

I created a new field named "F" and added F to the N-S equation. After
compile, I tested it in a 2D Poiseuille flow configuration (2 parallel
plates), for the moment I want to use the force as an opposing force.

fvVectorMatrix UEqn
(
fvm::ddt(U)
+ fvm::div(phi, U)
- fvm::laplacian(nu, U)
== RHOM1*A123
);

solve(UEqn == -fvc::grad(p));


Using "setField" I have defined A123 as an opposing force to the flow in the x-direction, in a small region of the flow domain (a localized force), I am using a 2D rectangular domain of 20 units in x-direcion 2 units in y-direction, the force is zero in the whole domain except in 9.5<x<10.5 and -0.5<y<0.5, with values (-0.25, 0.0, 0.0)

FoamFile
{
version 2.0;
format ascii;
class dictionary;
object setFieldsDict;
}

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

defaultFieldValues
(
volVectorFieldValue A123 (0.0 0.0 0.0)
);

regions
(
boxToCell
{
box (9.5 -0.5 0.05) (10.5 0.5 0.05);

fieldValues
(
volVectorFieldValue A123 (-0.25 0.0 0.0)
);
}
);


the problem was when I ran the solver and plotted the x-component of the force in the y-direction, its behaviour is not constant in the specified interval, please see the profiles.png file attached, also looking at the vector field force in Paraview it looks with different values in the specified domain,

it seems that the solver modifies the force and I do not know why?

Any suggestions will be appreciated!

thanks in advance

Alberto


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