CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Pre-Processing

directionalKSolidThermo syntax

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree3Likes

Reply
 
LinkBack Thread Tools Display Modes
Old   September 10, 2012, 08:24
Default
  #21
New Member
 
Romain
Join Date: Aug 2012
Posts: 12
Rep Power: 4
romain.h is on a distinguished road
Quote:
Originally Posted by m_f View Post
...

You're totally right... I will begin to learn how create a solver.
You should probably start with this topic : chtIcoMultiRegionFoam - Incompressible version of chtMultiRegionFoam. as someone did already worked on an incompressible version of chtMultiRegionFoam.

Romain
romain.h is offline   Reply With Quote

Old   October 26, 2012, 07:32
Default
  #22
New Member
 
Michael
Join Date: Sep 2012
Posts: 23
Rep Power: 4
mirx is on a distinguished road
Hello,

did anyone of you successfully run chtMultiRegion(Simple)FoamTensorK? I tried it and the simulation runs properly, but the results are not as expected.

I used different KValues. I thought the vector would represent conductivity values in x, y and z. But they don't. It seems more like a polar definition rather than a cartesian. Furthermore I am not able to change the orientation. Changing the values of coordinateSystem doesn't effect the results. It seems not to be recognized by the solver, as spelling mistakes don't raise error.

Thank you in advance!
mirx is offline   Reply With Quote

Old   November 8, 2012, 10:13
Default
  #23
Member
 
Richard Kenny
Join Date: Mar 2009
Posts: 59
Rep Power: 9
richpaj is on a distinguished road
I encountered the same problems as mirx. Am wondering whether to attempt my own customized definition for the relevant field of tensorial K.

Rgds,

Richard K.
richpaj is offline   Reply With Quote

Old   November 8, 2012, 10:33
Default
  #24
New Member
 
Michael
Join Date: Sep 2012
Posts: 23
Rep Power: 4
mirx is on a distinguished road
Hello,

do you think the problem is only related to the definition of tensor K in solidThermophysicalProperties? Would we get the expected behaviour, if tensor K was defined properly?
How the tensor has to look like, so that we are able to define the conductivity in x-/y-/z-direction and is it possible to define the tensor somewhere else?
Richard, do know, how to implement this into the solver?

Regards
mirx is offline   Reply With Quote

Old   November 8, 2012, 10:41
Default
  #25
Member
 
Richard Kenny
Join Date: Mar 2009
Posts: 59
Rep Power: 9
richpaj is on a distinguished road
I've only just encountered the problem today so haven't had much time to think about it. But for sure it would make use of the interpolation approach currently employed in directionalKSolidThermo and related classes.

At the bug report site it seems they might overhaul the approach in any case in the next upgrade to openFOAM.

Regards,

Richard K.
richpaj is offline   Reply With Quote

Old   November 8, 2012, 11:14
Default
  #26
Member
 
Richard Kenny
Join Date: Mar 2009
Posts: 59
Rep Power: 9
richpaj is on a distinguished road
I just realised that I was using an old version of OF21, it's quite possible that this procedure is updated in later versions of OF21x
richpaj is offline   Reply With Quote

Old   November 8, 2012, 11:27
Default
  #27
Member
 
Richard Kenny
Join Date: Mar 2009
Posts: 59
Rep Power: 9
richpaj is on a distinguished road
seems to be working now, though have yet to satisfy myself with the output.
Good luck

Richard K.
richpaj is offline   Reply With Quote

Old   November 8, 2012, 11:50
Default
  #28
New Member
 
Michael
Join Date: Sep 2012
Posts: 23
Rep Power: 4
mirx is on a distinguished road
Do you mean it works with the newest version 2.1.x from git?
mirx is offline   Reply With Quote

Old   November 8, 2012, 11:54
Default
  #29
Member
 
Richard Kenny
Join Date: Mar 2009
Posts: 59
Rep Power: 9
richpaj is on a distinguished road
certainly from early November. So yes the latest git will provide a fix for you.
richpaj is offline   Reply With Quote

Old   November 9, 2012, 05:13
Default
  #30
New Member
 
Michael
Join Date: Sep 2012
Posts: 23
Rep Power: 4
mirx is on a distinguished road
Today I compiled the new git version 2.1.x and recompiled chtMultiRegionSimpleFoamTensorK but it doesn't change anything. I still get the same unexpected results as described in post #22 of this thread.
coordinateSystem is ignored and KValues don't behave like in a cartesian x, y, z definition.

Richard, do you get good results with chtMultiRegion(Simple)FoamTensorK?
mirx is offline   Reply With Quote

Old   November 9, 2012, 05:27
Default
  #31
Member
 
Richard Kenny
Join Date: Mar 2009
Posts: 59
Rep Power: 9
richpaj is on a distinguished road
I seem to get what I expect. For example in solidThermophysicalProperties if I use

{
..
KValues ( (4 10 25) (4 10 25) );

coordinateSystem
{
origin (0 0 0);
//
coordinateRotation
{
type axes;
e1 (1 0 0);
e3 (0 0 1);
}
}
}

Inserting an Info statement into the code now yields

(4 0 0 10 0 25) which agrees with the format


( "xx", "xy", "xz", "yy", "yz", "zz" )

as specified in "/src/OpenFOAM/primitives/SymmTensor/symmTensor/symmTensor.C". Previously, a "..not isotropic tensor" error would be emitted at this stage.

I must admit, however, I haven't tried alternative alignments as our geometry is already aligned
to the above. Presumably you're having trouble interacting with the 'coordinateSystem'
in the above subdictionary?

Rgds,

Richard
richpaj is offline   Reply With Quote

Old   November 9, 2012, 05:52
Default
  #32
New Member
 
Michael
Join Date: Sep 2012
Posts: 23
Rep Power: 4
mirx is on a distinguished road
Where in the code did you insert the info statement?
mirx is offline   Reply With Quote

Old   November 9, 2012, 05:57
Default
  #33
Member
 
Richard Kenny
Join Date: Mar 2009
Posts: 59
Rep Power: 9
richpaj is on a distinguished road
I put the following in "setRegionSolidFields.H"

Info<<"setRegionSolidFields.H:: kappa = "<<kappa<<endl;

after:

//tmp<volScalarField> tkappa = thermo.K();
tmp<volSymmTensorField> tkappa = thermo.directionalK();

//const volScalarField& kappa = tkappa();
const volSymmTensorField& kappa = tkappa();

Rgds,

Richard
richpaj is offline   Reply With Quote

Old   November 9, 2012, 07:04
Default
  #34
New Member
 
Michael
Join Date: Sep 2012
Posts: 23
Rep Power: 4
mirx is on a distinguished road
Thank you very much!
It seems that my tensor is not calculated correctly.

I have the following dict:

KValues ((10 100 10) (10 100 10));

coordinateSystem
{
origin ( 0 0 0);
coordinateRotation
{
type axes;
e1 (1 0 0);
e3 (0 0 1);
}
}

But my tensor field looks like this:
...
(22.4138 31.03449 0 87.5862 0 10)
(63.11475 44.2623 0 46.88525 0 10)
(63.11475 -44.2623 0 46.88525 0 10)
(22.4138 -31.03449 0 87.5862 0 10)
(22.4138 31.03449 0 87.5862 0 10)
...

The *z-values are correct. Everything else is messed up.

This simulation was run with the latest git 2.1.x, chtMultiRegionFoamTensorK_v2 and multiRegionHeaterDirectionalSolid. I just changed the solidThermophysicalProperties.
mirx is offline   Reply With Quote

Old   November 9, 2012, 07:12
Default
  #35
Member
 
Richard Kenny
Join Date: Mar 2009
Posts: 59
Rep Power: 9
richpaj is on a distinguished road
Actually I never used "chtMultiRegionFoamTensorK_v2", I just edited the original OF solver and renamed it "myChtMultiRegionDirectionalKsimpleFoam".

I wonder if that might account for the different in behaviours we're observing?
richpaj is offline   Reply With Quote

Old   November 10, 2012, 09:17
Default
  #36
New Member
 
Michael
Join Date: Sep 2012
Posts: 23
Rep Power: 4
mirx is on a distinguished road
Now I used my newly under ubuntu 12.04 compiled git version 2.1.x., copied the original solver and changed the two lines in setRegionSolidFields.h:

//tmp<volScalarField> tkappa = thermo.K();
tmp<volSymmTensorField> tkappa = thermo.directionalK();

//const volScalarField& kappa = tkappa();
const volSymmTensorField& kappa = tkappa();

Then I compiled this new solver as myChtMultiRegionDirectionalKSimpleFoam. But I still get the same results. I'm absolutely puzzled. If I use the same KValues for x/y/z, i.e. (10 10 10), then the tensor is (10 0 0 10 0 10). But if I have different values, it calculates a completely wrong tensor (except for z-component). coordinateSystem values are still not recognized. Maybe this is related to my problem. Did I miss something in the solver code?
mirx is offline   Reply With Quote

Old   November 10, 2012, 09:42
Default
  #37
Member
 
Richard Kenny
Join Date: Mar 2009
Posts: 59
Rep Power: 9
richpaj is on a distinguished road
What about your boundary condition I wonder? I use


Solid4_to_Solid5
{
type compressible::turbulentTemperatureCoupledBaffleMix ed;
value uniform 300;
neighbourFieldName T;
K directionalSolidThermo;
KName none;
}

and if that looks fine what about the cood system of the mesh?

Otherwise, it looks like you'll have to track the bug in the class library directionalKSolidThermo.

I should add that my test case was 2D cylindrically symmetric.

Regards,

Richard K.
richpaj is offline   Reply With Quote

Old   November 10, 2012, 10:20
Default
  #38
New Member
 
Michael
Join Date: Sep 2012
Posts: 23
Rep Power: 4
mirx is on a distinguished road
My boundary conditions are the same and I never touched settings for the global coordinate system.
Could it be possible, that you didn't notice this problem because of your 2D setup? If you had some time, I would be grateful if you could run a simple 3D case with your solver. In this thread is a modified version of multiRegionHeater tutorial (post #12). I guess, you just have to modifiy the solver in controlDict to let it run and use some anisotropic values as KValues.

Regards

Michael
mirx is offline   Reply With Quote

Old   November 11, 2012, 01:48
Default
  #39
Member
 
Richard Kenny
Join Date: Mar 2009
Posts: 59
Rep Power: 9
richpaj is on a distinguished road
I tried ((10 20 30) (10 20 30)) for the heater and generated:
92
(
(10 0 0 20 0 30)
(10 0 0 20 0 30)
(10 0 0 20 0 30)
(10 0 0 20 0 30)
(10 0 0 20 0 30)
(10 0 0 20 0 30)
(10 0 0 20 0 30)
(10 0 0 20 0 30)
(10 0 0 20 0 30)
(10 0 0 20 0 30)
(10 0 0 20 0 30)
(10 0 0 20 0 30)
(19.28367 -2.578796 0 10.71633 0 30)
(19.91499 -0.9180551 0 10.08501 0 30)
(19.91499 0.9180551 0 10.08501 0 30)
(19.28367 2.578796 0 10.71633 0 30)
..

(15.90164 4.918033 0 14.09836 0 30)
(10.82569 2.752294 0 19.17431 0 30)
(11.37931 3.448276 0 18.62069 0 30)
(10 0 0 20 0 30)
(10 0 0 20 0 30)
(10 0 0 20 0 30)
(10 0 0 20 0 30)
(10 0 0 20 0 30)
(10 0 0 20 0 30)
(10 0 0 20 0 30)
(10 0 0 20 0 30)
(10 0 0 20 0 30)
(10 0 0 20 0 30)
(10 0 0 20 0 30)
(10 0 0 20 0 30)
(10 0 0 20 0 30)
(10 0 0 20 0 30)
(10 0 0 20 0 30)
(10 0 0 20 0 30)
)

presumably, the principal values are being transformed in regions of this mesh. I think
you'll have to track through the directionalK.. class library to see the details of this.

I'll probably be revisiting this problem in the next couple of weeks but have to now
move onto something completely different.

In the meantimes, good luck,

Richard K.
richpaj is offline   Reply With Quote

Old   November 13, 2012, 07:00
Default
  #40
New Member
 
Michael
Join Date: Sep 2012
Posts: 23
Rep Power: 4
mirx is on a distinguished road
Hello,

I think I found the answer to our problem. I had a look at directionalKSolidThermo.C and debuged it with info statements. I recognized, that the definition of coordinateSystem for the cells and patches is very strange. They all get a local coordinate system that points to the origin of the defined global coordinate system. This results in a sphirical definition of KValues.
Another problem is that the functions, which should read the coordinateSystem values out of thermoPhysicalProperties dict, are not used. That's why directionalKSolidThermo ignores the coordinateSystem definition and always uses the default coordinateSystem.

I was able to fix these issues as follows:
(This fix is only tested with versions 2.1.1 and 2.1.x)

In directionalKSolidThermo.C in member function Foam::directionalKSolidThermo::init() (line 135)

Remove
Code:
KValues_ = Field<vector>(subDict(typeName + "Coeffs").lookup("KValues"));
and replace it with
Code:
read();
This function reads the dict values KValues AND coordinateSystem.

Than in the forAll(mesh_.C(), cellI) loop remove
Code:
vector dir = mesh_.C()[cellI] - coordSys_.origin();
dir /= mag(dir);
and replace the coordinate system definition so that it looks like this:
Code:
        coordinateSystem cs
        (
            "cc",
                coordSys_.origin(),
                coordSys_.e3(), 
                coordSys_.e1() 
        );
Than in forAll(mesh_.C().boundaryField(), patchI) in forAll(tc, i) remove

Code:
            vector dir = patchC[i] - coordSys_.origin();
            dir /= mag(dir);
and again change the coordinate system definition to
Code:
        coordinateSystem cs
        (
            "cc",
                coordSys_.origin(),
                coordSys_.e3(), 
                coordSys_.e1() 
        );
I attached the modified file directionalKSolidThermo.C to this post.
Attached Files
File Type: c directionalKSolidThermo.C (10.6 KB, 14 views)
wyldckat likes this.

Last edited by mirx; November 13, 2012 at 07:49.
mirx is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
what is syntax error : missing ')' before ';' aleisia Fluent UDF and Scheme Programming 8 March 10, 2015 16:42
syntax error on config.h ehooi Fluent UDF and Scheme Programming 3 November 9, 2011 11:05
[Other] Turbogrid power syntax la7low ANSYS Meshing & Geometry 0 January 15, 2011 23:20
Interpolation command '-interp-iv' in syntax file KM CFX 4 October 12, 2007 16:29
error while compiling the USER Sub routine CFD user CFX 3 November 25, 2002 16:16


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