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

explain implications of this comment

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 5, 2019, 00:27
Unhappy explain implications of this comment
  #1
Member
 
Join Date: Oct 2013
Posts: 92
Rep Power: 13
fedvasu is on a distinguished road
Hi Forum,

I am porting my code from OF-6 to OF-dev (latest)

what are the implications of of this commits

https://github.com/OpenFOAM/OpenFOAM...c39005b2091117

https://github.com/OpenFOAM/OpenFOAM...c39005b2091117

mesh.solver is no longer present, then how can i specify that for this equation this particular solver settings, I have two separate pressure equations and I have two different settings in fvSolution but for second equation is constructed using a copy of the original pressure how can I tell OF to use the settings for the other equation?
fedvasu is offline   Reply With Quote

Old   February 5, 2019, 13:58
Default
  #2
Senior Member
 
Andrew Somorjai
Join Date: May 2013
Posts: 175
Rep Power: 13
massive_turbulence is on a distinguished road
Quote:
Originally Posted by fedvasu View Post
Hi Forum,

I am porting my code from OF-6 to OF-dev (latest)

what are the implications of of this commits

https://github.com/OpenFOAM/OpenFOAM...c39005b2091117

https://github.com/OpenFOAM/OpenFOAM...c39005b2091117

mesh.solver is no longer present, then how can i specify that for this equation this particular solver settings, I have two separate pressure equations and I have two different settings in fvSolution but for second equation is constructed using a copy of the original pressure how can I tell OF to use the settings for the other equation?
It would help if you posted the pressure equations, the fvSolutions and whatever is necessary to see the problem.
massive_turbulence is offline   Reply With Quote

Old   February 6, 2019, 19:19
Default
  #3
Member
 
Join Date: Oct 2013
Posts: 92
Rep Power: 13
fedvasu is on a distinguished road
Quote:
Originally Posted by massive_turbulence View Post
It would help if you posted the pressure equations, the fvSolutions and whatever is necessary to see the problem.

Quote:
Main pressure equation
Code:
// Pressure corrector
    fvScalarMatrix pEqn
    (
        fvm::ddt(psi, p)
        + fvc::div(phiHbyA)
        - fvm::laplacian(rhorAUf, p)
        ==

        fvOptions(psi, p, rho.name())
    );

    fvOptions.constrain(pEqn);

    pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));

    if (pimple.finalNonOrthogonalIter())
    {
        phi = phiHbyA + pEqn.flux();
    }
Quote:
other pressure equation, variable named pressure
Code:
fvScalarMatrix pressureEqn
            (
	            fvm::laplacian(rhorAUf, pressure)
	            - fvm::ddt(psi, pressure)
	            ==
                Rm_
                //Rm_TA
            );

            pressureEqn.setReference(pressureRefCell, pressureRefValue);
            pressureEqn.solve(mesh_.solver("pressure")); //how would I give this info?

            if (nonOrth == nNonOrthCorr)
            {
		        phiFVstage3 =  -pressureEqn.flux();
            }
fedvasu is offline   Reply With Quote

Old   February 6, 2019, 20:09
Default
  #4
Senior Member
 
Andrew Somorjai
Join Date: May 2013
Posts: 175
Rep Power: 13
massive_turbulence is on a distinguished road
Quote:
Originally Posted by fedvasu View Post
Code:
// Pressure corrector
    fvScalarMatrix pEqn
    (
        fvm::ddt(psi, p)
        + fvc::div(phiHbyA)
        - fvm::laplacian(rhorAUf, p)
        ==

        fvOptions(psi, p, rho.name())
    );

    fvOptions.constrain(pEqn);

    pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));

    if (pimple.finalNonOrthogonalIter())
    {
        phi = phiHbyA + pEqn.flux();
    }


Code:
fvScalarMatrix pressureEqn
            (
	            fvm::laplacian(rhorAUf, pressure)
	            - fvm::ddt(psi, pressure)
	            ==
                Rm_
                //Rm_TA
            );

            pressureEqn.setReference(pressureRefCell, pressureRefValue);
            pressureEqn.solve(mesh_.solver("pressure")); //how would I give this info?

            if (nonOrth == nNonOrthCorr)
            {
		        phiFVstage3 =  -pressureEqn.flux();
            }
What would be wrong with doing this in the second one

Code:
fvScalarMatrix pressureEqn
            (
	            fvm::laplacian(rhorAUf, pressure)
	            - fvm::ddt(psi, pressure)
	            ==
                fvOptions(???)
            );

fvOptions.constrain(pressureEqn);
Is it because that would only check the same object file as before in the 1st or because you would overwrite variables needed from the 1st call?
massive_turbulence is offline   Reply With Quote

Old   March 22, 2019, 00:44
Default
  #5
Member
 
Join Date: Oct 2013
Posts: 92
Rep Power: 13
fedvasu is on a distinguished road
Quote:
Originally Posted by massive_turbulence View Post
What would be wrong with doing this in the second one

Code:
fvScalarMatrix pressureEqn
            (
	            fvm::laplacian(rhorAUf, pressure)
	            - fvm::ddt(psi, pressure)
	            ==
                fvOptions(???)
            );

fvOptions.constrain(pressureEqn);
Is it because that would only check the same object file as before in the 1st or because you would overwrite variables needed from the 1st call?
My RHS is not 0 or given through fvOptions.

Anyway it seems, this is a API simplification it seems,
pEqn.solve() will find apply the fvSolution settings for the appropriate variable automatically.

This hasn't affected me at all. (adversley or otherwise).

I would mark this thread solved, if anyone with intimate knowledge of the API can definitively answer this.
fedvasu is offline   Reply With Quote

Reply

Tags
development, new code, openfoam, pressure


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
[Commercial meshers] fluent3DMeshToFoam bego OpenFOAM Meshing & Mesh Conversion 31 August 16, 2023 10:04
[Commercial meshers] COnvert FLuent MEsh to openfoam with interface manuc OpenFOAM Meshing & Mesh Conversion 1 July 25, 2017 04:13
[Commercial meshers] converting Fluent mesh to openfoam standard mesh deepesh OpenFOAM Meshing & Mesh Conversion 31 March 29, 2017 06:59
dsmcInitialise - dsmcFoam archymedes OpenFOAM Pre-Processing 94 July 15, 2016 17:14
[Other] How to create an MRF zone ? aminem OpenFOAM Meshing & Mesh Conversion 2 December 8, 2014 11:45


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