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

Laplacian(A*B)

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

Like Tree4Likes

Reply
 
LinkBack Thread Tools Display Modes
Old   August 14, 2013, 12:22
Default
  #21
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 21
niklas will become famous soon enoughniklas will become famous soon enough
you could try to implement it implicitly
fvc::laplacian(delta*F,Psat) = fvc::div( delta*F*grad(Psat) )

volVectorField dps = delta * fvc::grad(Psat);
surfaceScalarField dpsf = fvc::interpolate(dps) & mesh.Sf();

then you can view the dps field as a 'convective' change of F due to the Psat gradient
and rewrite it like this

fvc::laplacian(delta*F,Psat) = fvm::div(dpsf, F)


...should work
niklas is offline   Reply With Quote

Old   August 14, 2013, 13:35
Default
  #22
Senior Member
 
Fabian Roesler
Join Date: Mar 2009
Location: Germany
Posts: 209
Rep Power: 10
fabian_roesler is on a distinguished road
Hi

That's a pitty. But the code of niklas seems to be promissing. Ricardo, I didn't get your approach in total. Could you explain it in a little more detail? Especially the part of the lduAddressing.

Regards

Fabian
immortality likes this.
fabian_roesler is offline   Reply With Quote

Old   August 14, 2013, 14:21
Default
  #23
New Member
 
Richard
Join Date: Aug 2013
Location: Zilina, Slovakia
Posts: 20
Rep Power: 5
Ricardo is on a distinguished road
Quote:
Originally Posted by niklas View Post
fvc::laplacian(delta*F,Psat) = fvm::div(dpsf, F)
...should work
implementation to solver >> solve (fvm::ddt(dw,F)==fvm::laplacian(lambdaD*Psat,F)+fv m::div(dpsf, F)); doen't works, too

Quote:
Originally Posted by fabian_roesler View Post
Hi

That's a pitty. But the code of niklas seems to be promissing. Ricardo, I didn't get your approach in total. Could you explain it in a little more detail? Especially the part of the lduAddressing.

Regards

Fabian
This is my code, but it I am still working ...

a part of code ...
Code:
    float tdelta = 1.0;
    float tdeltaN = 1.0;
    
    float fdelta = 1.0;
    float fdeltaN = 1.0;

    double relFaktor = 1.0;
    int iter = 0;
    
    #include "boundaryCalculation.H"
    
    do 
    {

    Tt = T;
    
    #include "heatParameters.H"

    solve
            (
               fvm::ddt(cap,T)==fvm::laplacian(lambda, T)//+hv*fvc::laplacian(lambdaD, Psat*F)
         );

    T=(relFaktor)*T+(1-relFaktor)*Tt;
    
    tdeltaN=diffFields(T,Tt);

    #include "saturatedpressure.H"
    #include "moistureParameters.H"


    fvScalarMatrix mat1
    (
          fvm::laplacian(lambdaD,F)
     );

    
    label Nc = mesh.nCells(); //Total number of cells
    
    // Diagonal coefficients calculation
        for(label i=0; i<Nc; i++)
        {
          mat1.diag()[i]*=Psat[i];
        }
        
    //Off-diagonal coefficients calculation
        for(label faceI=0; faceI<mat1.lduAddr().lowerAddr().size(); faceI++)
        {
    mat1.lower()[faceI]*=Psat[mesh.faceOwner()[faceI]];
      mat1.upper()[faceI]*=Psat[mesh.faceNeighbour()[faceI]];
        }


      dimensionedScalar Pa ("Pa",dimensionSet(1,-1,-2,0,0,0,0), 1.0 );

    mat1*=Pa;
 
    solve
        (
            fvm::ddt(dw,F)==mat1
    //fvm::laplacian(lambdaD*Psat,F)//+fvc::laplacian(dT,T)// //  
         );
    
    F=(relFaktor)*F + (1-relFaktor)*Ft;

    fdeltaN=diffFields(F,Ft);
     
    #include "w_prepocet.H"
    iter++;
    
    if (iter==1)
    {
    tdelta=tdeltaN;
    fdelta=fdeltaN;
    }

    if ((tdeltaN>tdelta) || (fdeltaN>fdelta))
    {
    relFaktor=relFaktor/2;
    T=(relFaktor)*T+(1-relFaktor)*Tt;
    F=(relFaktor)*F + (1-relFaktor)*Ft;
    }
    
    } while (((tdeltaN>maxDeltaT) || (fdeltaN>maxDeltaH)) && iter < maxIter);
my approach to laplacian(labmbdaD,F*Psat) is in code, maybe for expert it could be ridiculous , but I am working with openFoam and C++ 2 weeks, and this code gives some "expected" values. Other approach gives unstability or doesn't work...

I tried next approach, rewrite partial pressure by gradient of temperature, it seems, that gives similar values like lduaddressing script

I don't know where is problem, I have to check all functions, material parameters and other properties again,...

thanks to all for support and advices
Richard
Ricardo is offline   Reply With Quote

Old   August 14, 2013, 15:11
Default
  #24
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 21
niklas will become famous soon enoughniklas will become famous soon enough
you REALLY need to be more specific when you say 'it doesnt work'.
niklas is offline   Reply With Quote

Old   August 14, 2013, 15:39
Default
  #25
New Member
 
Richard
Join Date: Aug 2013
Location: Zilina, Slovakia
Posts: 20
Rep Power: 5
Ricardo is on a distinguished road
I was wrong , It works, but obtained values ...

dimensions [0 0 0 0 0 0 0];

internalField nonuniform List<scalar>
4000
(
-1.35814e-10
4.58031e-11
4.58031e-11
4.58031e-11
4.5803e-11
4.58031e-11
4.58031e-11
4.58031e-11
-1.82592e-10
-1.77054e-12
-2.23032e-11

So it seems (two scheme unstable), that a problem could be somewhere else,

Is right using parameters (lambda), stored as volScalaField and (ununiform field) calculated in each step equation by this way? (fvm::laplacian(lambda,T)) Is it interpreted correctly to scheme or is used average values?

Thanks
Richard
Ricardo 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



All times are GMT -4. The time now is 13:52.