|
[Sponsors] |
September 14, 2016, 01:25 |
|
#21 | |
Member
Viraj Belekar
Join Date: Jun 2016
Posts: 68
Rep Power: 10 |
Quote:
Please find the attached file. |
||
September 14, 2016, 17:11 |
|
#22 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Quick answer: The problem was that there were a few steps that failed, where I had written how to download the updated "constitutiveModel" files.
Please follow these steps instead, which hopefully will fix the problem:
|
|
September 15, 2016, 01:33 |
|
#23 | |
Member
Viraj Belekar
Join Date: Jun 2016
Posts: 68
Rep Power: 10 |
Quote:
Hi wyldckat, Please find the attached file. There already existed an src folder at this location: cd $WM_PROJECT_USER_DIR/FluidStructureInteraction from the previous installation. I did exactly what you said. |
||
September 16, 2016, 10:06 |
|
#24 | |
Member
Viraj Belekar
Join Date: Jun 2016
Posts: 68
Rep Power: 10 |
Quote:
Hi wyldckat, Please find the attached file. I did exactly what you told me |
||
September 17, 2016, 08:06 |
|
#25 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Hi viraj20feb,
Sorry for the late reply, but I didn't manage to find enough free time to look into this sooner. Something strange is going on with your version of foam-extend 3.1. I need more details, namely:
Bruno
__________________
|
|
September 19, 2016, 01:43 |
|
#26 | |
Member
Viraj Belekar
Join Date: Jun 2016
Posts: 68
Rep Power: 10 |
Quote:
Hi Bruno, Following are the answers of your question: 1. I am working as Research Assistant in a project and foam-extend 3.1 was already installed in the system alloted to me. So I don't know about the installation instructions, sorry! 2. Same as 1. 3. Code:
foam Code:
foam: command not found Code:
/foam/foam-extend-3.1$ Code:
git log -1 Code:
fatal: Not a git repository (or any of the parent directories): .git |
||
September 26, 2016, 19:09 |
|
#27 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Quick answer: My apologies for taking so long to give an answer. Since there aren't enough details about the specific snapshot of foam-extend 3.1, it becomes considerably harder to diagnose which version it is.
Running the following commands might help to diagnose, but it's not 100% guaranteed it will work: Code:
foam cat .build Code:
3.1-1dd681f6e943 |
|
March 12, 2019, 11:05 |
|
#28 |
Senior Member
Hojatollah Gholami
Join Date: Jan 2019
Posts: 171
Rep Power: 7 |
Dear Samkhaniani
Did you simulate a non-Newtonian flow with flexible pipe? I want to simulate non-newtonian fluid with fsiFoam. I was modified icoFsiElasticNonLinULSolidFoam in createField and fluidSolver and was seen correct. But In this Solver I can't do that. Can you favor me? Thanks |
|
March 13, 2019, 12:16 |
|
#29 |
Senior Member
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,267
Blog Entries: 1
Rep Power: 25 |
could you please tell me what problems are you dealing with?
Best regards
__________________
My Personal Website (http://nimasamkhaniani.ir/) Telegram channel (https://t.me/cfd_foam) |
|
March 14, 2019, 09:32 |
|
#30 |
Senior Member
Hojatollah Gholami
Join Date: Jan 2019
Posts: 171
Rep Power: 7 |
Dear Samkhaniani
I uses fsiFoam as the solver for FSI problem. As you know, this solver has fluidSolver such as icoFluid, PisoFluid and ConsistIcoFluid for solving Newtonian fluid. I want to solve non-Newtonian fluid with fsiFoam. I modified simply some code of icoFsiElasticNonLinULSolidFoam in createField and fluidSolver to solve now-Newtonian fluid. Only I changed reading nu in solvers. I do that change in this solver but have error. the icoNonFluid.C is Code:
/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | foam-extend: Open Source CFD \\ / O peration | Version: 4.0 \\ / A nd | Web: http://www.foam-extend.org \\/ M anipulation | For copyright notice see file Copyright ------------------------------------------------------------------------------- License This file is part of foam-extend. foam-extend is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. foam-extend is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with foam-extend. If not, see <http://www.gnu.org/licenses/>. \*---------------------------------------------------------------------------*/ #include "icoNonFluid.H" #include "singlePhaseTransportModel.H" #include "volFields.H" #include "fvm.H" #include "fvc.H" #include "fvMatrices.H" #include "addToRunTimeSelectionTable.H" #include "findRefCell.H" #include "adjustPhi.H" #include "fluidSolidInterface.H" #include "fixedGradientFvPatchFields.H" #include "EulerDdtScheme.H" #include "CrankNicolsonDdtScheme.H" #include "backwardDdtScheme.H" #include "elasticSlipWallVelocityFvPatchVectorField.H" #include "elasticWallVelocityFvPatchVectorField.H" #include "elasticWallPressureFvPatchScalarField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { namespace fluidSolvers { // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // defineTypeNameAndDebug(icoNonFluid, 0); addToRunTimeSelectionTable(fluidSolver, icoNonFluid, dictionary); // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // icoNonFluid::icoNonFluid(const fvMesh& mesh) : fluidSolver(this->typeName, mesh), U_ ( IOobject ( "U", runTime().timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh ), p_ ( IOobject ( "p", runTime().timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh ), gradp_(fvc::grad(p_)), gradU_(fvc::grad(U_)), phi_ ( IOobject ( "phi", runTime().timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE ), fvc::interpolate(U_) & mesh.Sf() ), singlePhaseTransportModel fluid(U, phi); //the new code transportProperties_ ( IOobject ( "transportProperties", runTime().constant(), mesh, IOobject::MUST_READ, IOobject::NO_WRITE ) ), // nu_(transportProperties_.lookup("nu")), rho_( transportProperties.lookup("rho")) {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // const volVectorField& icoNonFluid::U() const { return U_; } const volScalarField& icoNonFluid::p() const { return p_; } const volScalarField& icoNonFluid::nu() const { return nu_; } //- Patch viscous force (N/m2) tmp<vectorField> icoNonFluid::patchViscousForce(const label patchID) const { tmp<vectorField> tvF ( new vectorField(mesh().boundary()[patchID].size(), vector::zero) ); tvF() = rho_.value()*nu().value()*U().boundaryField()[patchID].snGrad(); vectorField n = mesh().boundary()[patchID].nf(); tvF() -= n*(n&tvF()); return tvF; } //- Patch pressure force (N/m2) tmp<scalarField> icoNonFluid::patchPressureForce(const label patchID) const { tmp<scalarField> tpF ( new scalarField(mesh().boundary()[patchID].size(), 0) ); tpF() = rho_.value()*p().boundaryField()[patchID]; return tpF; } //- Patch viscous force (N/m2) tmp<vectorField> icoNonFluid::faceZoneViscousForce ( const label zoneID, const label patchID ) const { vectorField pVF = patchViscousForce(patchID); tmp<vectorField> tvF ( new vectorField(mesh().faceZones()[zoneID].size(), vector::zero) ); vectorField& vF = tvF(); const label patchStart = mesh().boundaryMesh()[patchID].start(); forAll(pVF, i) { vF[mesh().faceZones()[zoneID].whichFace(patchStart + i)] = pVF[i]; } // Parallel data exchange: collect pressure field on all processors reduce(vF, sumOp<vectorField>()); return tvF; } //- Patch pressure force (N/m2) tmp<scalarField> icoNonFluid::faceZonePressureForce ( const label zoneID, const label patchID ) const { scalarField pPF = patchPressureForce(patchID); tmp<scalarField> tpF ( new scalarField(mesh().faceZones()[zoneID].size(), 0) ); scalarField& pF = tpF(); const label patchStart = mesh().boundaryMesh()[patchID].start(); forAll(pPF, i) { pF[mesh().faceZones()[zoneID].whichFace(patchStart + i)] = pPF[i]; } // Parallel data exchange: collect pressure field on all processors reduce(pF, sumOp<scalarField>()); return tpF; } tmp<scalarField> icoNonFluid::faceZoneMuEff ( const label zoneID, const label patchID ) const { tmp<scalarField> tMuEff ( new scalarField ( mesh().faceZones()[zoneID].size(), rho_.value()*nu_.value() ) ); return tMuEff; } void icoNonFluid::evolve() { Info << "Evolving fluid solver: " << this->type() << endl; const fvMesh& mesh = fluidSolver::mesh(); int nCorr(readInt(fluidProperties().lookup("nCorrectors"))); int nNonOrthCorr = readInt(fluidProperties().lookup("nNonOrthogonalCorrectors")); int nOuterCorr = readInt(fluidProperties().lookup("nOuterCorrectors")); // Prepare for the pressure solution label pRefCell = 0; scalar pRefValue = 0.0; setRefCell(p_, fluidProperties(), pRefCell, pRefValue); for (int oCorr = 0; oCorr < nOuterCorr; oCorr++) { if(mesh.moving()) { // Make the fluxes relative phi_ -= fvc::meshPhi(U_); } // CourantNo { scalar CoNum = 0.0; scalar meanCoNum = 0.0; scalar velMag = 0.0; if (mesh.nInternalFaces()) { surfaceScalarField SfUfbyDelta = mesh.surfaceInterpolation::deltaCoeffs()*mag(phi_); CoNum = max(SfUfbyDelta/mesh.magSf()) .value()*runTime().deltaT().value(); meanCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf())) .value()*runTime().deltaT().value(); velMag = max(mag(phi_)/mesh.magSf()).value(); } Info<< "Courant Number mean: " << meanCoNum << " max: " << CoNum << " velocity magnitude: " << velMag << endl; } fvVectorMatrix UEqn ( fvm::ddt(U_) + fvm::div(phi_, U_) - fvm::laplacian(nu_, U_) ); solve(UEqn == -gradp_); // --- PISO loop volScalarField rAU = 1.0/UEqn.A(); surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU)); for (int corr=0; corr<nCorr; corr++) { U_ = rAU*UEqn.H(); phi_ = (fvc::interpolate(U_) & mesh.Sf()); // + fvc::ddtPhiCorr(rUA, U_, phi_); # include "updateRobinFsiInterface.H" adjustPhi(phi_, U_, p_); for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { fvScalarMatrix pEqn ( fvm::laplacian ( rAUf, p_, "laplacian((1|A(U)),p)" ) == fvc::div(phi_) // fvm::laplacian(rAUf, p_) == fvc::div(phi_) ); pEqn.setReference(pRefCell, pRefValue); pEqn.solve(); gradp_ = fvc::grad(p_); if (nonOrth == nNonOrthCorr) { phi_ -= pEqn.flux(); } } // Continuity error { volScalarField contErr = fvc::div(phi_); scalar sumLocalContErr = runTime().deltaT().value()* mag(contErr)().weightedAverage(mesh.V()).value(); scalar globalContErr = runTime().deltaT().value()* contErr.weightedAverage(mesh.V()).value(); Info<< "time step continuity errors : sum local = " << sumLocalContErr << ", global = " << globalContErr << endl; } U_ -= rAU*gradp_; U_.correctBoundaryConditions(); gradU_ = fvc::grad(U_); } } } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace fluidSolvers } // End namespace Foam // ************************************************************************* // Code:
/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | foam-extend: Open Source CFD \\ / O peration | Version: 4.0 \\ / A nd | Web: http://www.foam-extend.org \\/ M anipulation | For copyright notice see file Copyright ------------------------------------------------------------------------------- License This file is part of foam-extend. foam-extend is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. foam-extend is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with foam-extend. If not, see <http://www.gnu.org/licenses/>. Class icoNonFluid Description icoFoam fluid solver Author Hrvoje Jasak, Wikki Ltd. All rights reserved. modified SourceFiles icoNonFluid.C \*---------------------------------------------------------------------------*/ #ifndef icoNonFluid_H #define icoNonFluid_H #include "fluidSolver.H" #include "volFields.H" #include "surfaceFields.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { namespace fluidSolvers { /*---------------------------------------------------------------------------*\ Class icoNonFluid Declaration \*---------------------------------------------------------------------------*/ class icoNonFluid : public fluidSolver { // Private data //- Velocity field volVectorField U_; //- Pressure field volScalarField p_; //- viscousity field volScalarField nu_; //- Pressure gradient volVectorField gradp_; //- Velocity gradient volTensorField gradU_; //- Flux field surfaceScalarField phi_; // Transport properties dictionary IOdictionary transportProperties_; //- Density dimensionedScalar rho_; // //- // scalarField nGradUn_; // Private Member Functions //- Disallow default bitwise copy construct icoNonFluid(const icoNonFluid&); //- Disallow default bitwise assignment void operator=(const icoNonFluid&); public: //- Runtime type information TypeName("icoNonFluid"); // Constructors //- Construct from components icoNonFluid(const fvMesh& mesh); // //- Construct from components // icoNonFluid // ( // const word& type, // const fvMesh& mesh // ); // Destructor virtual ~icoNonFluid() {} // Member Functions // Access //- Return velocity field virtual const volVectorField& U() const; //- Return velocity field volVectorField& U() { return U_; } //- Return pressure field virtual const volScalarField& p() const; //- Return pressure field volScalarField& p() { return p_; } // return viscousity field virtual const volScalarField& nu() const; //- Return viscousity field volScalarField& nu() { return nu_; } //- Return pressure gradient volVectorField& gradp() { return gradp_; } //- Return pressure gradient volTensorField& gradU() { return gradU_; } //- Return flux field surfaceScalarField& phi() { return phi_; } //- Density const dimensionedScalar& rho() { return rho_; } //- Patch viscous force (N/m2) virtual tmp<vectorField> patchViscousForce ( const label patchID ) const; //- Patch pressure force (N/m2) virtual tmp<scalarField> patchPressureForce ( const label patchID ) const; //- Patch viscous force (N/m2) virtual tmp<vectorField> faceZoneViscousForce ( const label zoneID, const label patchID ) const; //- Patch pressure force (N/m2) virtual tmp<scalarField> faceZonePressureForce ( const label zoneID, const label patchID ) const; //- Face zone effective dynamic viscosity virtual tmp<scalarField> faceZoneMuEff ( const label zoneID, const label patchID ) const; // Edit //- Evolve the fluid solver virtual void evolve(); }; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace fluidSolvers } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #endif // ************************************************************************* // Last edited by wyldckat; March 16, 2019 at 19:34. Reason: [QUOTE]->[CODE] |
|
March 14, 2019, 09:36 |
|
#31 |
Senior Member
Hojatollah Gholami
Join Date: Jan 2019
Posts: 171
Rep Power: 7 |
first error is from "singlePhaseTransportModel fluid(U, phi);" type is not direct base of "icoNonFluid"
|
|
March 14, 2019, 14:00 |
|
#32 |
Senior Member
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,267
Blog Entries: 1
Rep Power: 25 |
no need to write new solver, use pisoFlow as your fluid solver, then you can use non-Newtonian fluid
__________________
My Personal Website (http://nimasamkhaniani.ir/) Telegram channel (https://t.me/cfd_foam) |
|
March 17, 2019, 00:31 |
|
#33 |
Senior Member
Hojatollah Gholami
Join Date: Jan 2019
Posts: 171
Rep Power: 7 |
Dear Samkhaniani
Thanks for your comment. I used the pisoFluid, and worked with non-Newtonian fluid. But the problem have diverging. I will try to change fvscheme for the converging. thanks again |
|
March 21, 2019, 00:31 |
|
#34 | |||
Senior Member
Hojatollah Gholami
Join Date: Jan 2019
Posts: 171
Rep Power: 7 |
Dear Samkhaniani
I changed fvscheme to converge the solution, but still I unsuccessful. I also modify the icoFluid to add add nu() as non-Newtonian fluid in that. the problem is in here "part of icoFluid" Quote:
Quote:
the compiler give this error. Quote:
Thanks |
||||
March 26, 2019, 10:16 |
|
#35 |
Senior Member
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,267
Blog Entries: 1
Rep Power: 25 |
it seems that you used the wrong constructor to make your object!
maybe you need to do something like this (im not sure ) Code:
tmp<scalarField> icoNonFluid::faceZoneMuEff ( const label zoneID, const label patchID ) const { tmp<scalarField> tMuEff ( new scalarField ( mesh().faceZones()[zoneID].size(), rho_.value() //Here ) ); tMuff=tMuff*fluid_.nu().boundaryField()[patchID]; return tMuEff; } void icoNonFluid::evolve()
__________________
My Personal Website (http://nimasamkhaniani.ir/) Telegram channel (https://t.me/cfd_foam) |
|
Tags |
flexible pipe, fsi |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
different results between serial solver and parallel solver | wlt_1985 | FLUENT | 11 | October 12, 2018 09:23 |
error in two way fsi | kmgraju | CFX | 1 | May 2, 2011 03:32 |
Working directory via command line | Luiz | CFX | 4 | March 6, 2011 21:02 |
FSI Negative Element Volume Fatal Error | Aaron | CFX | 2 | July 1, 2008 21:48 |
why the solver reject it? Anyone with experience? | bearcat | CFX | 6 | April 28, 2008 15:08 |