CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Some basic doubts on solvers (https://www.cfd-online.com/Forums/openfoam-programming-development/85494-some-basic-doubts-solvers.html)

 pkr February 27, 2011 18:46

Some basic doubts on solvers

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.

 santiagomarquezd February 28, 2011 08:46

Quote:
 Originally Posted by pkr (Post 297212) 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.

 All times are GMT -4. The time now is 07:31.