|
[Sponsors] |
March 27, 2020, 11:57 |
|
#22 | ||
Super Moderator
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,097
Rep Power: 34 |
Quote:
Also, it is worth mentioning that all solid models calculate the deformation but deepening on the formulation they might not move the mesh. Quote:
Code:
void Foam::fluidSolidInterface::moveFluidMesh() { // Get fluid patch displacement from fluid zone displacement // Take care: these are local patch fields not global patch fields List<vectorField> fluidPatchesPointsDispls ( nGlobalPatches_, vectorField() ); List<vectorField> fluidPatchesPointsDisplsPrev ( nGlobalPatches_, vectorField() ); ... } |
|||
March 27, 2020, 15:08 |
|
#23 |
Senior Member
|
1. Though a solid solver uses staticFvMesh, the mesh moves according to the displacement field. The solid mesh is moved when calling updateTotalFields() in the coupling, for instance in AitkenCouplingInterface::evolve().
Code:
void nonLinGeomUpdatedLagSolid::updateTotalFields() { // Density rho_ = rho_.oldTime()/relJ_; // Move the mesh to the deformed configuration #ifdef OPENFOAMESIORFOUNDATION const vectorField oldPoints = mesh().points(); #else const vectorField oldPoints = mesh().allPoints(); #endif moveMesh(oldPoints, DD(), pointDD()); solidModel::updateTotalFields(); } 2. If I want to manually add some displacement to the solid, is the following procedure correct? The purpose is to give the boundary of the interface a rigid body motion. (I do not want to model the whole solid domain but need to consider the gravity force) The procedure I use is as follows: First, move the solid mesh due to force. (But do not solve the solid, because it only adds a same constant displacement to all the points) Next, move the interface boundary of fluid, using dynamic solver update the mesh. Then, solve the fluid domain to update the force. Finally, enter into the ordinary fulid-solid coupling loop with modified meshes. The nonLinGeomUpdatedLagSolid solver is used which solves the Displacement Increment, so I modify the incremental displacement manually. Code:
bool AitkenCouplingInterface::evolve() { initializeFields(); updateInterpolatorAndGlobalPatches(); scalar residualNorm = 0; { // Total force at the solid side of the interface scalar mass=33.4/2; static vector v=vector(0,0,0); scalar ds=0.0; //prepare rigid body motion vector totalForceOnFluid=vector::zero; { for (label interfaceI = 0; interfaceI < nGlobalPatches(); interfaceI++) { // Take references to zones const standAlonePatch& fluidZone = fluid().globalPatches()[interfaceI].globalPatch(); const standAlonePatch& solidZone = solid().globalPatches()[interfaceI].globalPatch(); // Calculate total traction of fluid zone vectorField fluidZoneTotalTraction = fluid().faceZoneViscousForce(interfaceI) - fluid().faceZonePressureForce(interfaceI)*fluidZone.faceNormals(); // Initialise the solid zone traction field that is to be interpolated from the fluid zone vectorField solidZoneTotalTraction(solidZone.size(), vector::zero); // Transfer the field frm the fluid interface to the solid interface interfaceToInterfaceList()[interfaceI].transferFacesZoneToZone ( fluidZone, // from zone solidZone, // to zone fluidZoneTotalTraction, // from field solidZoneTotalTraction // to field ); // Flip traction sign after transferring from fluid to solid solidZoneTotalTraction = -solidZoneTotalTraction; totalForceOnSolid+=totalForceOnInterface(solidZone, solidZoneTotalTraction); } vector a=totalForceOnSolid/mass+vector(0,0,-9.81); scalar dt=runTime().deltaT().value(); v=v+a*dt; ds=v.z()*dt; // only consider z direction Info << "Acceleration = " << a << endl; Info << "Rigid displacement = " << ds <<endl; } // modify solid mesh { volVectorField vdd ( IOobject ( "vdd", runTime().timeName(), solid().mesh(), IOobject::NO_READ, IOobject::NO_WRITE ), solid().mesh(), dimensionedVector("vdd", dimensionSet(0,1,0,0,0,0,0), vector(0,0,ds)) ); solid().DD()==vdd; // manually add the rigid body motion to the whole solid. solid().updateTotalFields(); // solid mesh is moved according to PointDD which is interpelated from DD. } //modify fluid mesh { Info<< "#-------------modifying pointMotionU ---------------# " << endl; //Find the reference to the location of pointMotionU field pointVectorField& pointMotionU = const_cast<pointVectorField&> ( fluid().mesh().objectRegistry::lookupObject<pointVectorField> ( "pointMotionU" ) ); //Get the vector field of the patch forAll(fluidPatchIndices(), patchi) { vectorField &pMotionU=refCast<vectorField>(pointMotionU.boundaryField()[fluidPatchIndices()[patchi]]); //Find the relevant size of the vector and declare a vectorField. int Psize= pMotionU.size(); vectorField pointMotionUVals(Psize); // loop over points to move the nodes forAll(pointMotionUVals, index) { pointMotionUVals[index].x() = 0; pointMotionUVals[index].y() = 0; pointMotionUVals[index].z() = v.z(); } //Once the values have been assigned to pointMotionUVals, assign them to pointMotionU boundaryField pointMotionU.boundaryField()[fluidPatchIndices()[patchi]] == pointMotionUVals; fluid().mesh().update(); // mesh is updated due to the updated pointMotionU using velocityLaplacian(dynamicMotionSolverFvMesh) solver. fluid().mesh().moving(false); // Avoid affect the dynamic mesh in the fsi coupling loop. Not sure if it is necesary. } // after rigid body motion, Solve fluid fluid().evolve(); } // end of modification } //original coupling loop do { //break; outerCorr()++; // Transfer the displacement from the solid to the fluid updateDisplacement(); // Move the fluid mesh moveFluidMesh(); // Solve fluid fluid().evolve(); // Transfer the force from the fluid to the solid updateForce(); // Solve solid solid().evolve(); // Calculate the FSI residual residualNorm = updateResidual(); // Optional: write residuals to file if (writeResidualsToFile() && Pstream::master()) { residualFile() << runTime().value() << " " << outerCorr() << " " << residualNorm << endl; } } while (residualNorm > outerCorrTolerance() && outerCorr() < nOuterCorr()); solid().updateTotalFields(); return 0; } |
|
March 27, 2020, 15:30 |
|
#24 |
Senior Member
|
From the picture, the mesh moving and deformation can be seen, though the fluid boundary (interface) is not conformal with the solid interface (something is wrong with the solution).
The final solid shape is the actual position but not the warped one. |
|
March 30, 2020, 06:27 |
|
#25 | |
Super Moderator
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,097
Rep Power: 34 |
Quote:
I am struggling a bit to understand what you are trying to do, however, the following points may help to clarify some things:
Hope it helps, Philip |
||
March 31, 2020, 19:26 |
|
#26 |
Senior Member
|
Hi Philip,
Thank you for your reply. I know it is not practical, but I intend to have solid4Foam solve the coupling problem without considering the gravity of solid first (g=0 in solid region), then I manually add the rigid body motion to the solution. Because I need to take the counterweight into account, i.e., the mass cannot be calculated by the solid solver, but should be specified manually. By the way, is the solid mass calculated by density*volume, where the volume is the total solid mesh volume and density is specified in 'mechanicalProperties'? Can I just increase the density to count for the counterweight? As for my wedge model, I am struggling with setting appropriate boundary conditions on them. I want the two ends to have no deformation but the whole wedge is free to fall. I have tried fixDisplacment, symmetryPlane, solidTractionFree and solidSymmetry; they are all not appropriate. The results look more reasonable by the ad hoc way I aformentioned, i.e. 1) before the fsi coupling, the rigid body motion (considering the gravity of solid) is calculated and superimposed to the solid, which just change the initial state (a constant value is added to the mesh, D, and DD) 2) accordingly, move the interface boundary of the fluid domain and solve the fluid problem and update the force(the initial one to be transferred to solid in the coupling loop). 3) then solving the fsi problem (without considering the gravity of solid) by fixing the two ends (fixedDisplacement). In my opinion, the additional rigid body motion only does not affect the coupling algorithm because it only changes the initial conditions before entering the coupling loop. Of course, it may cause more coupling iterations. Hopefully, my problem and intention are a little bit clearer. I appreciate any of your comments or suggestions. Michael |
|
August 24, 2020, 05:41 |
|
#27 | |
New Member
QianZe ZHUANG
Join Date: Oct 2019
Location: DA LIAN
Posts: 3
Rep Power: 7 |
Quote:
I'm trying to simulate a case just like you said, there are two solids, 6DoF for one solid, and FSI for the other. I remember you said that the displacementLaplacian can not be applied in solid4Foam, but as I know the sixDoRigidBodyDisplacement can only be uesd when I choose the displacementLaplacian, so does that mean I can not use 6DoF in the situation? Thanks, zqz |
||
August 24, 2020, 05:52 |
|
#28 | |
Super Moderator
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,097
Rep Power: 34 |
Quote:
Philip |
||
August 24, 2020, 06:46 |
|
#29 | |
New Member
QianZe ZHUANG
Join Date: Oct 2019
Location: DA LIAN
Posts: 3
Rep Power: 7 |
Quote:
|
||
August 24, 2020, 06:50 |
|
#30 |
Super Moderator
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,097
Rep Power: 34 |
It is the "feature-displacementLaplacian" branch here: https://bitbucket.org/philip_cardiff...ease/branches/
|
|
January 17, 2024, 10:00 |
|
#31 | |
New Member
Runxin Luo
Join Date: Mar 2022
Posts: 6
Rep Power: 4 |
Quote:
|
||
April 28, 2024, 12:55 |
|
#32 | |
New Member
QianZe ZHUANG
Join Date: Oct 2019
Location: DA LIAN
Posts: 3
Rep Power: 7 |
Quote:
|
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
pimpleFoam is right, how about solids4Foam pimpleFluid? | amuzeshi | OpenFOAM Running, Solving & CFD | 6 | December 9, 2019 11:55 |
[solids4Foam] How to calculate drag coeff when using solids4Foam | amuzeshi | OpenFOAM CC Toolkits for Fluid-Structure Interaction | 15 | November 7, 2019 13:50 |
Fatal error in solids4Foam | brunomramoa | OpenFOAM CC Toolkits for Fluid-Structure Interaction | 1 | October 16, 2019 13:26 |
Overset FSI - pimpleOversetFluid is unknown to solids4Foam | amuzeshi | OpenFOAM CC Toolkits for Fluid-Structure Interaction | 2 | September 29, 2019 15:31 |
[FSI] solids4Foam vs icoFsiElasticNonLinULSolidFoam on HPC server | amuzeshi | OpenFOAM CC Toolkits for Fluid-Structure Interaction | 7 | August 31, 2019 06:26 |