CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Some basic doubts on solvers

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 27, 2011, 17:46
Default Some basic doubts on solvers
  #1
pkr
Member
 
Join Date: Nov 2010
Posts: 33
Rep Power: 14
pkr is an unknown quantity at this point
I have some basic doubts in the working of interFoam/dambreak case:

1. What difference does it make case if the following changes are made in controlDict:
Start time: 0
end time : 1
Changed to
start time: 0
end time: 0.25

I understand that it reduces the simulation time, but what happens to the quality/correctness of the results?

2. What equation is interFoam/dambreak actually solving? From the code in pEqn.H:
Code:
{
    volScalarField rUA = 1.0/UEqn.A();
    surfaceScalarField rUAf = fvc::interpolate(rUA);

    U = rUA*UEqn.H();

    surfaceScalarField phiU
    (
        "phiU",
        (fvc::interpolate(U) & mesh.Sf())
      + fvc::ddtPhiCorr(rUA, rho, U, phi)
    );

    adjustPhi(phiU, U, p);

    phi = phiU +
        (
            fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)*mesh.magSf()
          + fvc::interpolate(rho)*(g & mesh.Sf())
        )*rUAf;

    for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
    {
        fvScalarMatrix pEqn
        (
            fvm::laplacian(rUAf, p) == fvc::div(phi)
        );

        pEqn.setReference(pRefCell, pRefValue);

        if (corr == nCorr-1 && nonOrth == nNonOrthCorr)
        {
            pEqn.solve(mesh.solver(p.name() + "Final"));
        }
        else
        {
            pEqn.solve(mesh.solver(p.name()));
        }

        if (nonOrth == nNonOrthCorr)
        {
            phi -= pEqn.flux();
        }
    }

    U += rUA*fvc::reconstruct((phi - phiU)/rUAf);
    U.correctBoundaryConditions();
}
How do you interpret the mathematical version of equation being solved?


3. How does solving of some equation narrows down to PCG solver which solves the equation of the form Ax=b?


Thanks.
pkr is offline   Reply With Quote

Old   February 28, 2011, 07:46
Default
  #2
Senior Member
 
santiagomarquezd's Avatar
 
Santiago Marquez Damian
Join Date: Aug 2009
Location: Santa Fe, Santa Fe, Argentina
Posts: 452
Rep Power: 23
santiagomarquezd will become famous soon enough
Quote:
Originally Posted by pkr View Post
I have some basic doubts in the working of interFoam/dambreak case:

1. What difference does it make case if the following changes are made in controlDict:
Start time: 0
end time : 1
Changed to
start time: 0
end time: 0.25

I understand that it reduces the simulation time, but what happens to the quality/correctness of the results?
I should be the same with the only difference of total simulation time.

Quote:
2. What equation is interFoam/dambreak actually solving? From the code in pEqn.H:
Code:
{
    volScalarField rUA = 1.0/UEqn.A();
    surfaceScalarField rUAf = fvc::interpolate(rUA);

    U = rUA*UEqn.H();

    surfaceScalarField phiU
    (
        "phiU",
        (fvc::interpolate(U) & mesh.Sf())
      + fvc::ddtPhiCorr(rUA, rho, U, phi)
    );

    adjustPhi(phiU, U, p);

    phi = phiU +
        (
            fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)*mesh.magSf()
          + fvc::interpolate(rho)*(g & mesh.Sf())
        )*rUAf;

    for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
    {
        fvScalarMatrix pEqn
        (
            fvm::laplacian(rUAf, p) == fvc::div(phi)
        );

        pEqn.setReference(pRefCell, pRefValue);

        if (corr == nCorr-1 && nonOrth == nNonOrthCorr)
        {
            pEqn.solve(mesh.solver(p.name() + "Final"));
        }
        else
        {
            pEqn.solve(mesh.solver(p.name()));
        }

        if (nonOrth == nNonOrthCorr)
        {
            phi -= pEqn.flux();
        }
    }

    U += rUA*fvc::reconstruct((phi - phiU)/rUAf);
    U.correctBoundaryConditions();
}
How do you interpret the mathematical version of equation being solved?
Check Edin Berberovic's paper "Drop impact onto a liquid..."


Quote:
3. How does solving of some equation narrows down to PCG solver which solves the equation of the form Ax=b?

Thanks.
I can't understand the phrase at all, but type of solvers are selected in fvSolution dictionary. This dictionary tells to .solve() method which solver have to be used.

Regards.
__________________
Santiago MÁRQUEZ DAMIÁN, Ph.D.
Research Scientist
Research Center for Computational Methods (CIMEC) - CONICET/UNL
Tel: 54-342-4511594 Int. 7032
Colectora Ruta Nac. 168 / Paraje El Pozo
(3000) Santa Fe - Argentina.
http://www.cimec.org.ar
santiagomarquezd is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
basic question: Specifying Pressure for comressible solvers nileshjrane OpenFOAM Running, Solving & CFD 2 October 14, 2010 10:16
Basic Blade Design Code apoorv Main CFD Forum 0 April 5, 2010 06:37
Please explain some basic doubts jaswi OpenFOAM 0 September 13, 2007 08:37
network comms amg solvers bob Main CFD Forum 0 March 1, 2007 19:58
PHOENICS Solvers Hu Phoenics 0 June 28, 2002 07:37


All times are GMT -4. The time now is 16:59.