CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (http://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   directionalKSolidThermo syntax (http://www.cfd-online.com/Forums/openfoam-pre-processing/105605-directionalksolidthermo-syntax.html)

m_f August 3, 2012 10:38

directionalKSolidThermo syntax
 
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

MarkWithag August 10, 2012 08:45

I am facing with the same problem.
Did you find any solution?

Thanks.

wyldckat August 10, 2012 13:44

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

MarkWithag August 10, 2012 16:35

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

wyldckat August 10, 2012 18:39

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

m_f August 11, 2012 09:14

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

niklas August 15, 2012 02:54

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 August 15, 2012 05:23

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

niklas August 15, 2012 06:11

Im guessing the boundary condition for T is using
K solidThermo;
and not
K directionalSolidThermo;

N

wyldckat August 15, 2012 07:01

2 Attachment(s)
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 (Post 377153)
    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

m_f August 16, 2012 04:41

Hello,

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

wyldckat August 16, 2012 17:37

2 Attachment(s)
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

m_f August 17, 2012 04:05

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

wyldckat August 18, 2012 04:07

Quote:

Originally Posted by m_f (Post 377460)
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 ?

:confused: Isn't chtMultiRegionSimpleFoam for incompressible fluids?

m_f August 18, 2012 16:48

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.

MarkWithag August 20, 2012 06:44

Hi to all of you,

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

regards

wyldckat August 20, 2012 08:38

Quote:

Originally Posted by m_f (Post 377650)
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 (Post 377650)
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.

m_f August 20, 2012 10:42

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.

wyldckat August 20, 2012 16:24

Quote:

Originally Posted by m_f (Post 377811)
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..?

:eek: !! 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

m_f August 22, 2012 07:34

Hello,

Quote:

Originally Posted by wyldckat (Post 377850)
:eek: !! 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


All times are GMT -4. The time now is 19:28.