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

directionalKSolidThermo syntax

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 3, 2012, 11:38
Default directionalKSolidThermo syntax
  #1
m_f
Member
 
M
Join Date: Jul 2012
Posts: 33
Rep Power: 14
m_f is on a distinguished road
Hello,

I'm trying to create an orthotropic material, with an orthotropic conductivity. So, i try to use the directionalKSolidThermo function with this syntax :
Code:
directionalKSolidThermoCoeffs
{
    //- does interpolation and directional K in coordinate system.
    //  Specify multiple values, one for each temperature. Properties are
    //  interpolated according to the local temperature.

    //- thermo properties
    TValues             (100 1000);
    rhoValues           (1700 1700);
    cpValues            (1700 1700);
    KValues             ((10 10 1) (10 10 1));

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

    //- chemical properties
    HfValues            (0 0);

    //- radiation properties
    emissivityValues    (0.95 0.95);
    kappaValues         (0 0);
    sigmaSValues         (0 0);
}
But it doesn't work...

That's the error :


Code:
--> FOAM FATAL ERROR: 
Not implemented

    From function directionalKSolidThermo::K(const label) const
    in file directionalKSolidThermo/directionalKSolidThermo.H at line 134.

FOAM aborting
Any idea about where the mistake is ?

Thank you for any hint.
Excuse my english

Best Regards, m_f
m_f is offline   Reply With Quote

Old   August 10, 2012, 09:45
Default
  #2
New Member
 
Nikola
Join Date: Oct 2011
Posts: 4
Rep Power: 15
MarkWithag is on a distinguished road
I am facing with the same problem.
Did you find any solution?

Thanks.
MarkWithag is offline   Reply With Quote

Old   August 10, 2012, 14:44
Default
  #3
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings to all!

What version of OpenFOAM are you using?
And can you attach an example case? This way it'll be easier for people here at the forum to help you!

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   August 10, 2012, 17:35
Default
  #4
New Member
 
Nikola
Join Date: Oct 2011
Posts: 4
Rep Power: 15
MarkWithag is on a distinguished road
Hi Wyldckat,

I am using openfoam211.

I have problem to attached this file but this file can be find following the next path in openfoam211:
tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/constant/heater/solidThermophysicalProperties.
I changed feature "thermoType constSolidThermo" to "thermoType directionalKSolidThermo" which was already inside.

If this feature is not technically implemented yet could you tell me how I can model directional conductivity in solid. For instance, K=0 in x-direction, K=17 in y-direction and K=17 in z-direction?

Thank you in advance.

Regards,
Nikola
MarkWithag is offline   Reply With Quote

Old   August 10, 2012, 19:39
Default
  #5
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Nikola,

I'm stumped... apparently this feature is broken! It was sort-of fixed here: http://www.openfoam.org/mantisbt/view.php?id=438
But technically it only delegates the problem down the line... but I can't understand if there is any derived class that reimplements this method

I've checked OpenFOAM 2.1.0, 2.0.x, 1.7.x and even the variant 1.6-ext, and it doesn't look like it will work in either one of the them... actually, in 1.7.x and 1.6-ext, this case isn't even implemented in the same way

I guess I'm only able to suggest the thing you where earlier thinking: this is a bug! But this should be reported here: http://www.openfoam.org/mantisbt/my_view_page.php
Please describe there the same steps you've described here.

Best regards and good luck!
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   August 11, 2012, 10:14
Default
  #6
m_f
Member
 
M
Join Date: Jul 2012
Posts: 33
Rep Power: 14
m_f is on a distinguished road
Hello,
As MarkWithag :

Quote:
I have problem to attached this file but this file can be find following the next path in openfoam211:
tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/constant/heater/solidThermophysicalProperties.
I changed feature "thermoType constSolidThermo" to "thermoType directionalKSolidThermo" which was already inside.
I do approximately the same case, with the same version of OpenFOAM. I'm a bit disappointed by answers, but thank you, we are all fixed now.
The bug was reported by MarkWithag. Please follow this link : http://www.openfoam.org/mantisbt/view.php?id=622

Best regards. Have a good week-end.

m_f
m_f is offline   Reply With Quote

Old   August 15, 2012, 03:54
Default
  #7
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29
niklas will become famous soon enoughniklas will become famous soon enough
I think I know what the problem is.

you are trying to access a scalar-valued K, which is not defined for the tensor approach.

If you go to the code

applications/solvers/heatTransfer/chtMultiRegionFoam/solid/setRegionSolidFields.H

you will see that K is defined as a scalar

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

if you uncomment the tensor-part and comment the scalar part and recompile the code
and try to run your case what will happen then.

N
wyldckat likes this.
niklas is offline   Reply With Quote

Old   August 15, 2012, 06:23
Default
  #8
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Niklas,

I was curious and tried this myself. The same error message came out
Here's a more complete output:
Code:
Region: bottomAir Courant Number mean: 0.002118344 max: 0.003438382
Region: topAir Courant Number mean: 0.02267985 max: 0.03164373
Region: heater Diffusion Number mean: 2.495128e-06 max: 3.140529e-06
Region: leftSolid Diffusion Number mean: 2.499425e-06 max: 3.038856e-06
Region: rightSolid Diffusion Number mean: 2.499393e-06 max: 3.040031e-06
deltaT = 0.009475679
Region: bottomAir Courant Number mean: 0.02007275 max: 0.032581
Region: topAir Courant Number mean: 0.214907 max: 0.2998459
Region: heater Diffusion Number mean: 2.364303e-05 max: 2.975865e-05
Region: leftSolid Diffusion Number mean: 2.368375e-05 max: 2.879523e-05
Region: rightSolid Diffusion Number mean: 2.368345e-05 max: 2.880636e-05
deltaT = 0.009475679
Time = 0.00947568


Solving for fluid region bottomAir
diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
DILUPBiCG:  Solving for Ux, Initial residual = 1, Final residual = 5.185517e-10, No Iterations 3
DILUPBiCG:  Solving for Uy, Initial residual = 1, Final residual = 8.709587e-11, No Iterations 3
DILUPBiCG:  Solving for Uz, Initial residual = 1, Final residual = 5.069313e-10, No Iterations 3
Got here 00.


--> FOAM FATAL ERROR: 
Not implemented

    From function directionalKSolidThermo::K(const label) const
    in file directionalKSolidThermo/directionalKSolidThermo.H at line 134.

FOAM aborting

#0  Foam::error::printStack(Foam::Ostream&) in "/home/user/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1  Foam::error::abort() in "/home/user/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2  Foam::directionalKSolidThermo::K(int) const in "/home/user/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libbasicSolidThermo.so"
#3  Foam::temperatureCoupledBase::K(Foam::Field<double> const&) const in "/home/user/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libcompressibleTurbulenceModel.so"
#4  Foam::compressible::turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::updateCoeffs() in "/home/user/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libcompressibleTurbulenceModel.so"
#5  Foam::mixedFvPatchField<double>::evaluate(Foam::UPstream::commsTypes) in "/home/user/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libbasicThermophysicalModels.so"
#6  Foam::mixedEnthalpyFvPatchScalarField::updateCoeffs() in "/home/user/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libbasicThermophysicalModels.so"
#7   at gaussLaplacianSchemes.C:0
#8  Foam::fv::gaussLaplacianScheme<double, double>::fvmLaplacianUncorrected(Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) in "/home/user/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libfiniteVolume.so"
#9  Foam::fv::gaussLaplacianScheme<double, double>::fvmLaplacian(Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) in "/home/user/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libfiniteVolume.so"
#10  Foam::fv::laplacianScheme<double, double>::fvmLaplacian(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) in "/home/user/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libfiniteVolume.so"
#11  Foam::tmp<Foam::fvMatrix<double> > Foam::fvm::laplacian<double, double>(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) in "/home/user/OpenFOAM/user-2.1.x/platforms/linux64GccDPOpt/bin/chtMultiRegionFoam_TensorK"
#12  
 in "/home/user/OpenFOAM/user-2.1.x/platforms/linux64GccDPOpt/bin/chtMultiRegionFoam_TensorK"
#13  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#14  
 in "/home/user/OpenFOAM/user-2.1.x/platforms/linux64GccDPOpt/bin/chtMultiRegionFoam_TensorK"
Aborted
The message "Got here 00." was put in by me to diagnose where the problem occurs. It happens in "fluid/hEqn.h", when defining "fvScalarMatrix hEqn".

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   August 15, 2012, 07:11
Default
  #9
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29
niklas will become famous soon enoughniklas will become famous soon enough
Im guessing the boundary condition for T is using
K solidThermo;
and not
K directionalSolidThermo;

N
wyldckat likes this.
niklas is offline   Reply With Quote

Old   August 15, 2012, 08:01
Default
  #10
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Niklas,

Confirmed! It works!

Attached is the modified solver "chtMultiRegionFoamTensorK.tar.gz" and adapted tutorial "snappyMultiRegionHeaterDirectionalSolid.tar.g z".

To unpack and build the solver:
Code:
tar -xf chtMultiRegionFoamTensorK.tar.gz
cd chtMultiRegionFoamTensorK
wmake
To run the tutorial:
Code:
./Allrun
Modifications made:
  1. Like Niklas said:
    Quote:
    Originally Posted by niklas View Post
    If you go to the code

    applications/solvers/heatTransfer/chtMultiRegionFoam/solid/setRegionSolidFields.H

    you will see that K is defined as a scalar

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

    if you uncomment the tensor-part and comment the scalar part and recompile the code
    and try to run your case what will happen then.
  2. Modified the binary name in "Make/files" to chtMultiRegionFoamTensorK.
  3. As for the tutorial, did as Niklas indicated and modified the following files:
    Code:
    system/heater/changeDictionaryDict
    system/leftSolid/changeDictionaryDict
    system/rightSolid/changeDictionaryDict
    You'll see the following modified lines:
    Code:
    //K               basicThermo;
    K               directionalSolidThermo;
  4. In the tutorial, also modified "system/controlDict" to use chtMultiRegionFoamTensorK.
  5. Still in the tutorial, added in a piece of code for copying the STL files from the original tutorial, so that the attached file would be as small as possible...
Now to think of a way to make this more generic and post in the bug report

Best regards,
Bruno
Attached Files
File Type: gz chtMultiRegionFoamTensorK.tar.gz (6.8 KB, 41 views)
File Type: gz snappyMultiRegionHeaterDirectionalSolid.tar.gz (10.1 KB, 45 views)
__________________
wyldckat is offline   Reply With Quote

Old   August 16, 2012, 05:41
Default
  #11
m_f
Member
 
M
Join Date: Jul 2012
Posts: 33
Rep Power: 14
m_f is on a distinguished road
Hello,

Quote:
Attached Files
chtMultiRegionFoamTensorK.tar.gz (6.8 KB, 2 views)
snappyMultiRegionHeaterDirectionalSolid.tar.gz (10.1 KB, 2 views)
It works ! Thanks a lot.
Now, i would try to use the MultiRegionSimpleFoam, with KDirectionalSolid.
Do you think it's possible to modify this solver too ?
I'm not very adroit with the compilation of a new solver (your second step).

Best regards,
m_f
m_f is offline   Reply With Quote

Old   August 16, 2012, 18:37
Default
  #12
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi m_f,

Attached are both modified solvers inside "chtMultiRegionFoamTensorK_v2.tar.gz" and the adapted tutorial "multiRegionHeaterDirectionalSolid.tar.gz" for chtMultiRegionSimpleFoamTensorK.

To unpack and build the two solvers:
Code:
tar -xf chtMultiRegionFoamTensorK_v2.tar.gz
cd chtMultiRegionFoamTensorK
./Allwmake
To run the attached tutorial:
Code:
./Allrun
The modification steps taken are pretty much identical.

Best regards,
Bruno
Attached Files
File Type: gz multiRegionHeaterDirectionalSolid.tar.gz (7.3 KB, 36 views)
File Type: gz chtMultiRegionFoamTensorK_v2.tar.gz (9.1 KB, 28 views)
__________________
wyldckat is offline   Reply With Quote

Old   August 17, 2012, 05:05
Default
  #13
m_f
Member
 
M
Join Date: Jul 2012
Posts: 33
Rep Power: 14
m_f is on a distinguished road
Hello wyldckat,

No words to describe my joy. Thank you very much for your investment - in terms of time - in this problem.
I saw that this solver use compressible proprieties for the fluid, is it possible to change a parameter (easily) to work with an incompressible flow ?

I have an other "easy" question but it isn't the same theme.

Thanks again.

Best regards,

m_f

Last edited by m_f; August 17, 2012 at 08:39.
m_f is offline   Reply With Quote

Old   August 18, 2012, 05:07
Default
  #14
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quote:
Originally Posted by m_f View Post
I saw that this solver use compressible proprieties for the fluid, is it possible to change a parameter (easily) to work with an incompressible flow ?
Isn't chtMultiRegionSimpleFoam for incompressible fluids?
__________________
wyldckat is offline   Reply With Quote

Old   August 18, 2012, 17:48
Default
  #15
m_f
Member
 
M
Join Date: Jul 2012
Posts: 33
Rep Power: 14
m_f is on a distinguished road
Hello and good Saturday,

I don't have my data on this computer but, I remember I had a text-file for rho parameter, and there is a variation in the fluid (between 1,25 and 0,98).
And I see on severals websites that it was a compressible solver (source : 1 & 2). Maybe a confirmation on Monday...You make me doubtful.

I don't know how to switch between compressible and incompressible or between perfect gaz and boussinesq approximation...

To conclude, I search a kind of solver which could solve all heat transfert (conduction/convection(natural or forced)/radiation) between solid and fluid regions, with incompressible flow. I thought that it could exist an incompressible fluids solver as chtMultiRegionSimpleFoam could be a kind of chtMultiRegionBoussinesqSimpleFoam (Combination of heatConductionFoam and buoyantBoussinesqSimpleFoam) including radiation.

Have a good week-end !

Best regards,

m_f

EDIT : Yes I've got a text-file for the density of the fluid.

Last edited by m_f; August 20, 2012 at 04:02.
m_f is offline   Reply With Quote

Old   August 20, 2012, 07:44
Default
  #16
New Member
 
Nikola
Join Date: Oct 2011
Posts: 4
Rep Power: 15
MarkWithag is on a distinguished road
Hi to all of you,

Thank you very much for a great help you provided to me.

regards
MarkWithag is offline   Reply With Quote

Old   August 20, 2012, 09:38
Default
  #17
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quote:
Originally Posted by m_f View Post
To conclude, I search a kind of solver which could solve all heat transfert (conduction/convection(natural or forced)/radiation) between solid and fluid regions, with incompressible flow. I thought that it could exist an incompressible fluids solver as chtMultiRegionSimpleFoam could be a kind of chtMultiRegionBoussinesqSimpleFoam (Combination of heatConductionFoam and buoyantBoussinesqSimpleFoam) including radiation.
OpenFOAM is open-source, which means you yourself can create "chtMultiRegionBoussinesqSimpleFoam"!

Quote:
Originally Posted by m_f View Post
EDIT : Yes I've got a text-file for the density of the fluid.
Having the file doesn't mean that file will be used by the solver.
__________________
wyldckat is offline   Reply With Quote

Old   August 20, 2012, 11:42
Default
  #18
m_f
Member
 
M
Join Date: Jul 2012
Posts: 33
Rep Power: 14
m_f is on a distinguished road
Yes but this file is used during the resolution. It appears that solver write a new rho file at each iteration, and I can post process it.
:/ So I suppose..?

Extract of log.chtMultiRegionSimpleFoamTensorK :
Code:
Time = 10
Solving for fluid region fluid
DILUPBiCG:  Solving for Ux, Initial residual = 7.805865e-08, Final residual = 7.805865e-08, No Iterations 0
[...]
time step continuity errors : sum local = 7.809642e-07, global = -6.653458e-08, cumulative = -0.001835181
Min/max rho:0.997834 1.186319
Quote:
OpenFOAM is open-source, which means you yourself can create "chtMultiRegionBoussinesqSimpleFoam"!
You're totally right... I will begin to learn how create a solver.
m_f is offline   Reply With Quote

Old   August 20, 2012, 17:24
Default
  #19
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quote:
Originally Posted by m_f View Post
Yes but this file is used during the resolution. It appears that solver write a new rho file at each iteration, and I can post process it.
:/ So I suppose..?
!! I've checked the original tutorial "heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater" and it does create the rho field!
Mmm... well, it does make sense and SIMPLE itself doesn't imply incompressible flow. But since before I've only seen PIMPLE being used for compressible and SIMPLE for incompressible... I then wrongly assumed chtMultiRegionSimpleFoam was incompressible...


As for getting started with modifying solvers, check this tutorial: http://openfoamwiki.net/index.php/Ho...ure_to_icoFoam
__________________
wyldckat is offline   Reply With Quote

Old   August 22, 2012, 08:34
Default
  #20
m_f
Member
 
M
Join Date: Jul 2012
Posts: 33
Rep Power: 14
m_f is on a distinguished road
Hello,

Quote:
Originally Posted by wyldckat View Post
!! I've checked the original tutorial "heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater" and it does create the rho field!
Thanks ! I'm not crazy, What a relief ! x)

Quote:
As for getting started with modifying solvers, check this tutorial: http://openfoamwiki.net/index.php/Ho...ure_to_icoFoam
Let's have fun

Best regards,

m_f
m_f 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
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 17: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 04:53.