CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Creating a new OpenFOAM case (https://www.cfd-online.com/Forums/openfoam/65167-creating-new-openfoam-case.html)

anijdon May 2, 2011 09:55

1 Attachment(s)
hello Martin;
excuse me; I did some change in the solver's code and compiled it eventually, but it seems has a main problem when running a case; It doesn't do well and gives this error:

Attachment 7521

I don't know what to do:confused:; would you guide me?
thanks;

MartinB May 2, 2011 10:21

Hi Maryam ,

just add this line to constant/transportProperties:
nu nu [0 2 -1 0 0 0 0] 1e-5; // value for kinematic viscosity

Change the value to the correct one for your main fluid.

Martin

anijdon May 2, 2011 11:26

hello;
thank you for reply;I want it read the nu from that formula which determined in the createFields not from transportProperties; If I change it's name there would be no problem?
thanks

MartinB May 2, 2011 12:05

Hi,

it will not work the way you have implemented it right now.

In your createFields.H this transport model and a turbulence model (although it might be a laminar one) is defined:
Code:

    singlePhaseTransportModel laminarTransport(U, phi);
    autoPtr<incompressible::RASModel> turbulence
    (
        incompressible::RASModel::New(U, phi, laminarTransport)
    );

During the setup of these models nu is read from transportProperties. Later on in your UEqn.H the viscosity from these models is used via this line:
Code:

      + turbulence->divDevReff(U)
So your own viscosity is not used so far. You must replace the divDevReff by your own formulation, if you want to continue with your hardwired approach. You can see what has to be done by looking into OpenFOAM-xxx/src/turbulenceModels/incompressible/turbulenceModel/laminar/laminar.C.

The more elegant solution would be to define your own viscosity model. These are located in OpenFOAM-xxx/src/transportModels/incompressible/viscosityModels/. There are examples how to make a new one in the forum.

Martin

anijdon May 2, 2011 14:49

hello Martin;
I am extremely thankful for your kindness but I am beginner in openFoam and not familiar to the way that you said;could you explain more and tell me what shoud I do step by step; I realy apologize to you for my asking;
thanks;

MartinB May 3, 2011 01:18

Hi,

in your UEqn.H change:
Code:

    tmp<fvVectorMatrix> UEqn
    (
        fvm::div(phi, U)
      // + turbulence->divDevReff(U)              // removed
      - fvm::laplacian(nuEff, U)                        // nuEff is your effective viscosity
      - fvc::div(nuEff*dev(fvc::grad(U)().T())) // nuEff is your effective viscosity
    );

In your createFields.H remove:
Code:

    // singlePhaseTransportModel laminarTransport(U, phi);

    // autoPtr<incompressible::RASModel> turbulence
    //(
    //    incompressible::RASModel::New(U, phi, laminarTransport)
    //);

In your nanoalaki.C remove:
Code:

        // turbulence->correct();
And check the line:
Code:

    volTensorField gradU = fvc::grad(U); // gradU is not used in this context
If compilation errors occur, read them very carefully and fix them, beginning from the first one.

Martin

anijdon May 3, 2011 12:26

Hello;
thank you a lot; I hope it'll resolve in this way:); This problem is just for nu and not for other properties like rho or k ; Am I right?


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